[llvm-bugs] [Bug 47323] New: Building scudo trunk

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 26 17:26:38 PDT 2020


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

            Bug ID: 47323
           Summary: Building scudo trunk
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: scudo
          Assignee: unassignedbugs at nondot.org
          Reporter: josh at joshtriplett.org
                CC: llvm-bugs at lists.llvm.org

I tried to build scudo from LLVM trunk (commit
486ed885339d70cd71ee55567282a43cce28d763), following the instructions on
https://www.llvm.org/docs/ScudoHardenedAllocator.html (under "You may also
build Scudo like this:"). (I had to make the slight modification of changing cc
to cpp when referencing sanitizer_common.)

I ended up with this error:

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol
__interception::real_vfork; recompile with -fPIC
>>> defined in /tmp/sanitizer_common_interceptors_vfork_x86_64-5badfa.o
>>> referenced by /tmp/sanitizer_common_interceptors_vfork_x86_64-5badfa.o:(vfork)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I get the same error (other than symbol encoding) if I build with ld:

/usr/bin/ld: /tmp/sanitizer_common_interceptors_vfork_x86_64-01b7d5.o: warning:
relocation against `_ZN14__interception10real_vforkE' in read-only section
`.text'
/usr/bin/ld: /tmp/sanitizer_common_interceptors_vfork_x86_64-01b7d5.o:
relocation R_X86_64_PC32 against symbol `_ZN14__interception10real_vforkE' can
not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I used this command line:

clang++-11 -fPIC -std=c++11 -msse4.2 -O2 -I. scudo/*.cpp $(\ls
sanitizer_common/*.{cpp,S} | grep -v
"sanitizer_termination\|sanitizer_common_nolibc\|sancov_\|sanitizer_unwind\|sanitizer_symbol")
-shared -o libscudo.so -pthread

-- 
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/20200827/1e6592a0/attachment.html>


More information about the llvm-bugs mailing list