https://bugs.llvm.org/show_bug.cgi?id=41230
Bug ID: 41230
Summary: Unable to use __builtin_cpu_supports with compiler-rt
Product: compiler-rt
Version: 8.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: compiler-rt
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
When using the toolchain provided by
http://releases.llvm.org/7.0.1/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz
Consider the following file test.cc:
>bool Foo() {
> return __builtin_cpu_supports("avx2");
>}
The following compiles sucessfully:
>$ bin/clang++ -shared -o test.so test.cc -fPIC
And the following leads to an error:
>$ bin/clang++ -shared -o test.so test.cc -fPIC -rtlib=compiler-rt
>/usr/bin/ld: /tmp/test-46520d.o: relocation R_X86_64_PC32 against symbol
>`__cpu_model' can not be used when making a shared object; recompile with -fPIC
>/usr/bin/ld: final link failed: Bad value
>clang-8: error: linker command failed with exit code 1 (use -v to see
>invocation)
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs