[llvm-bugs] [Bug 52427] New: lld/mac-linked clang crashes at runtime

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 5 15:04:43 PDT 2021


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

            Bug ID: 52427
           Summary: lld/mac-linked clang crashes at runtime
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: gkm at fb.com, jezreel at gmail.com,
                    llvm-bugs at lists.llvm.org, smeenai at fb.com

Repro file for linking clang:
https://drive.google.com/file/d/1uoZnBDRWrG6HQUsPzXsG5yA6t-I0zAoL/view?usp=sharing

This is a clang that was built with -DLLVM_BUILD_INSTRUMENTED=IR.

Linking clang with the repro file with lld.ld64 and then running `bin/clang++
-target x86_64-unknown-unknown -O2 -g -std=c++14 -fno-exceptions -fno-rtti -w
-c pgo_training-1.ii pgo_training-1.ii` makes clang crash after ~25s.

clang doesn't crash if it's linked with ld64 (it succeeds after ~31s).

You can obtain pgo_training-1.ii by running `curl -L -O
https://commondatastorage.googleapis.com/chromium-browser-clang/pgo_training-1.ii`.




1: Full cmake invocation for producing the .o files:
```
 Running cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=OFF
'-DLLVM_ENABLE_PROJECTS=clang;compiler-rt;lld;clang-tools-extra;libcxx'
'-DLLVM_TARGETS_TO_BUILD=AArch64;ARM;Mips;PowerPC;SystemZ;WebAssembly;X86'
-DLLVM_ENABLE_PIC=OFF -DLLVM_ENABLE_UNWIND_TABLES=OFF
-DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_Z3_SOLVER=OFF
-DCLANG_PLUGIN_SUPPORT=OFF -DCLANG_ENABLE_STATIC_ANALYZER=OFF
-DCLANG_ENABLE_ARCMT=OFF '-DBUG_REPORT_URL=https://crbug.com and run
tools/clang/scripts/process_crashreports.py (only works inside Google) which
will upload a report' -DLLVM_INCLUDE_GO_TESTS=OFF
-DENABLE_X86_RELAX_RELOCATIONS=NO -DLLVM_ENABLE_DIA_SDK=OFF
'-DCOMPILER_RT_SANITIZERS_TO_BUILD=asan;dfsan;msan;hwasan;tsan;cfi'
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF -DLIBCXX_ENABLE_SHARED=OFF
-DLIBCXX_ENABLE_STATIC=OFF -DLIBCXX_INCLUDE_TESTS=OFF
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF -DLLVM_ENABLE_LIBXML2=FORCE_ON
-DLLVM_ENABLE_LLD=ON '-DLLVM_ENABLE_PROJECTS=clang;libcxx;compiler-rt'
-DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS= -DCMAKE_EXE_LINKER_FLAGS=
-DCMAKE_SHARED_LINKER_FLAGS= -DCMAKE_MODULE_LINKER_FLAGS=
-DLLVM_BUILD_INSTRUMENTED=IR
-DCMAKE_C_COMPILER=/Users/thakis/src/chrome/src/third_party/llvm-bootstrap-install/bin/clang
-DCMAKE_CXX_COMPILER=/Users/thakis/src/chrome/src/third_party/llvm-bootstrap-install/bin/clang++
/Users/thakis/src/chrome/src/third_party/llvm/llvm
```
This is with a "normally" built clang as stage0 compiler, but it might repro
when just using system clang as host compiler.

-- 
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/20211105/15ea06b0/attachment.html>


More information about the llvm-bugs mailing list