[llvm-bugs] [Bug 41671] New: libcxx custom build from fuzzer not built PIC (causes regression test failures on AArch64 due to msan enforcing -fPIE on non X86 platforms)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 30 06:37:33 PDT 2019


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: unassignedbugs at nondot.org
          Reporter: peter.smith at linaro.org
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190430/0bcb18b7/attachment-0001.html>


More information about the llvm-bugs mailing list