[llvm-bugs] [Bug 41230] New: Unable to use __builtin_cpu_supports with compiler-rt

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 25 18:56:26 PDT 2019


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: unassignedbugs at nondot.org
          Reporter: chris at detrino.org
                CC: llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190326/5d5c459d/attachment.html>


More information about the llvm-bugs mailing list