LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 51247 - LTO plugin uses wrong ABI for LTO objects on riscv
Summary: LTO plugin uses wrong ABI for LTO objects on riscv
Status: NEW
Alias: None
Product: tools
Classification: Unclassified
Component: gold-plugin (show other bugs)
Version: 12.0
Hardware: Other Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-28 04:15 PDT by Andreas Schwab
Modified: 2021-07-28 04:15 PDT (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2021-07-28 04:15:44 PDT
It looks like the LTO plugin fails to properly set the target-abi for the LTO object.

$ clang -flto hello.c -v
clang version 12.0.1
Target: riscv64-suse-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib64/gcc/riscv64-suse-linux/10
Found candidate GCC installation: /usr/bin/../lib64/gcc/riscv64-suse-linux/11
Found candidate GCC installation: /usr/bin/../lib64/gcc/riscv64-suse-linux/9
Found candidate GCC installation: /usr/lib64/gcc/riscv64-suse-linux/10
Found candidate GCC installation: /usr/lib64/gcc/riscv64-suse-linux/11
Found candidate GCC installation: /usr/lib64/gcc/riscv64-suse-linux/9
Selected GCC installation: /usr/bin/../lib64/gcc/riscv64-suse-linux/11
 "/usr/bin/clang-12.0.1" -cc1 -triple riscv64-suse-linux-gnu -emit-llvm-bc -flto -flto-unit -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -target-feature +m -target-feature +a -target-feature +f -target-feature +d -target-feature +c -target-feature +relax -target-feature -save-restore -target-abi lp64d -msmall-data-limit 8 -fno-split-dwarf-inlining -debugger-tuning=gdb -v -resource-dir /usr/lib64/clang/12.0.1 -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/12.0.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /suse/schwab/src/test -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -o /tmp/hello-229842.o -x c hello.c
clang -cc1 version 12.0.1 based upon LLVM 12.0.1 default target riscv64-suse-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib64/clang/12.0.1/include
 /usr/include
End of search list.
 "/usr/bin/ld" -z relro --hash-style=gnu --hash-style=both --build-id --enable-new-dtags --eh-frame-hdr -m elf64lriscv -dynamic-linker /lib/ld-linux-riscv64-lp64d.so.1 -o a.out /usr/bin/../lib64/gcc/riscv64-suse-linux/11/../../../../lib64/crt1.o /usr/bin/../lib64/gcc/riscv64-suse-linux/11/crti.o /usr/bin/../lib64/gcc/riscv64-suse-linux/11/crtbegin.o -L/usr/bin/../lib64/gcc/riscv64-suse-linux/11 -L/usr/bin/../lib64/gcc/riscv64-suse-linux/11/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/lib64/lp64d -L/usr/lib64/lp64d -L/usr/bin/../lib64/gcc/riscv64-suse-linux/11/../../../../riscv64-suse-linux/lib -L/usr/bin/../lib64/gcc/riscv64-suse-linux/11/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib -plugin /usr/bin/../lib64/LLVMgold.so /tmp/hello-229842.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib64/gcc/riscv64-suse-linux/11/crtend.o /usr/bin/../lib64/gcc/riscv64-suse-linux/11/crtn.o
/usr/bin/ld: /tmp/lto-llvm-5c94e7.o: can't link soft-float modules with double-float modules
/usr/bin/ld: failed to merge target specific data of file /tmp/lto-llvm-5c94e7.o
clang-12.0: error: linker command failed with exit code 1 (use -v to see invocation)