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

            Bug ID: 43722
           Summary: libclang_rt.scudo[_minimal]-<arch>.a contains LLVM IR
                    files when compiling with ThinLTO
           Product: compiler-rt
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: scudo
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

The following five object files in libclang_rt.scudo-x86_64.a and
libclang_rt.scudo_minimal-x86_64.a are LLVM IR files instead of ELF objects
when building with LLVM_ENABLE_LTO=Thin:

  guarded_pool_allocator_posix.cpp.o
  mutex_posix.cpp.o
  guarded_pool_allocator.cpp.o
  random.cpp.o
  backtrace_linux_libc.cpp.o

This is problematic if users want to link with the static library, which then
contains a mix of LLVM IR and ELF object files.

The files come from gwp_asan, where the targets are for some reason built
without SANITIZER_COMMON_CFLAGS (see lib/gwp_asan/CMakeLists.txt), which
contains -fno-lto.

The issue can be reproduced by configuring a build with -DLLVM_ENABLE_LTO=Thin
and then running

> ar x <...>/libclang_rt.scudo-x86_64.a
> file *
backtrace_linux_libc.cpp.o:         LLVM IR bitcode
guarded_pool_allocator.cpp.o:       LLVM IR bitcode
guarded_pool_allocator_posix.cpp.o: LLVM IR bitcode
interception_linux.cc.o:            ELF 64-bit LSB relocatable, x86-64, version
1 (SYSV), with debug_info, not stripped
interception_mac.cc.o:              ELF 64-bit LSB relocatable, x86-64, version
1 (SYSV), not stripped
interception_type_test.cc.o:        ELF 64-bit LSB relocatable, x86-64, version
1 (SYSV), not stripped
interception_win.cc.o:              ELF 64-bit LSB relocatable, x86-64, version
1 (SYSV), not stripped
mutex_posix.cpp.o:                  LLVM IR bitcode
options_parser.cpp.o:               ELF 64-bit LSB relocatable, x86-64, version
1 (SYSV), with debug_info, not stripped
random.cpp.o:                       LLVM IR bitcode
sancov_flags.cc.o:                  ELF 64-bit LSB relocatable, x86-64, version
1 (SYSV), with debug_info, not stripped
...

-- 
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

Reply via email to