[llvm-bugs] [Bug 49963] New: "Wrong types for attribute" linking cbindgen with LTO

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 14 17:38:34 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49963

            Bug ID: 49963
           Summary: "Wrong types for attribute" linking cbindgen with LTO
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: alex_y_xu at yahoo.ca
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

I'm pretty sure this worked in LLVM 11, and doesn't work in LLVM 12.0.0-rc4.

Steps to reproduce:

1. get cbindgen-0.19.0
2. RUSTFLAGS='-C linker=clang -C linker-plugin-lto -C link-arg=-fuse-ld=lld'
cargo build --release

Expected results:

It builds.

Actual results:

Wrong types for attribute: inalloca nest noalias nocapture noundef nonnull
readnone readonly signext zeroext byref(void) byval(void) preallocated(void)
sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
  tail call fastcc align 8 void
@"_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_uninit_in28_$u7b$$u7b$closure$u7d$$u7d$17hbccd242c986790e3E.llvm.8415993583334446782"(i64
%15, i64 %14) #27, !noalias !2535
in function
_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_uninit_in17h5b16d4d82e1b1c53E
LLVM ERROR: Broken function found, compilation aborted!
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Running pass 'Function Pass Manager' on module
'/tmp/portage/dev-util/cbindgen-0.19.0/work/cbindgen-0.19.0/target/release/deps/cbindgen-799b8ea374c5985e.cbindgen.dndfdl99-cgu.13.rcgu.o'.
1.      Running pass 'Module Verifier' on function
'@"_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_uninit_in17h5b16d4d82e1b1c53E"'
Wrong types for attribute: inalloca nest noalias nocapture noundef nonnull
readnone readonly signext zeroext byref(void) byval(void) preallocated(void)
sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
  tail call fastcc align 8 void
@"_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_uninit_in28_$u7b$$u7b$closure$u7d$$u7d$17hbccd242c986790e3E.llvm.8415993583334446782"(i64
%15, i64 %14) #21, !noalias !2033
in function
_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_uninit_in17h5b16d4d82e1b1c53E
LLVM ERROR: Broken function found, compilation aborted!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210415/e0fce974/attachment.html>


More information about the llvm-bugs mailing list