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

            Bug ID: 41671
           Summary: libcxx custom build from fuzzer not built PIC (causes
                    regression test failures on AArch64 due to msan
                    enforcing -fPIE on non X86 platforms)
           Product: compiler-rt
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: fuzzer
          Assignee: unassignedb...@nondot.org
          Reporter: peter.sm...@linaro.org
                CC: llvm-bugs@lists.llvm.org

Some recently added libfuzzer tests are failing with link errors on AArch64
when the libcxx/libcxxabi sources are available [*].
msan.text
sigint.test

Both of these tests use -sanitize=memory,fuzzer which on non X86_64 platforms
implicitly sets -fPIE and -pie. The test fails with a link error due to non-PIC
relocations. Tracing through to find where these are coming from it it seems
like libfuzzer is being built -fPIC as is libc++abi, but libc++ is not.

I can make the test fail on x86_64 by adding -fPIE -pie to the line:
RUN: %msan_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGINT
lib/clang/9.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a(fuzzer.o): relocation
R_X86_64_32 against `.bss' can not be used when making a shared object;
recompile with -fPIC
This may not be a fair test on x86_64, some distributions default to -fPIE -PIE
but it can be overridden.

Assuming that using msan and fuzzer on a non x86_64 platform is a supported
combination. I think that the static libc++ that is merged into libfuzzer needs
to be built -fPIC. If it is not supported then msan.test and sigint.test need
to be disabled on non x86_64 platforms. 

The AArch64 buildbots currently do not have the libcxx/libcxxabi sources
available so they are not showing up the problem as they don't build it. When
the bots switch to the monorepo and LLVM_ENABLE_PROJECTS they will start
failing these tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to