llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.34k stars 12.13k forks source link

apple x86-64 build Symbol not found __ZNSt3__122__libcpp_verbose_abortEPKcz #74559

Open calvin2021y opened 11 months ago

calvin2021y commented 11 months ago

build with

llvm/utils/release/test-release.sh \
  -release 17.0.6\
  -final \
  -triple x86_64-apple-darwin22 \
  -j 8 \
  -use-ninja \
  -configure-flags  "-DLLVM_USE_STATIC_ZSTD=ON" \
  -lldb
cd /opt/procjets/llvm-project/final/Phase3/Release/llvmCore-17.0.6-final.obj && /opt/procjets/llvm-project/final/Phase3/Release/llvmCore-17.0.6-final.obj/bin/llvm-min-tblgen -gen-vt -I /opt/procjets/llvm-project/final/llvm-project/llvm/include/llvm/CodeGen -I/opt/procjets/llvm-project/final/Phase3/Release/llvmCore-17.0.6-final.obj/include -I/opt/procjets/llvm-project/final/llvm-project/llvm/include /opt/procjets/llvm-project/final/llvm-project/llvm/include/llvm/CodeGen/ValueTypes.td --write-if-changed -o include/llvm/CodeGen/GenVT.inc -d include/llvm/CodeGen/GenVT.inc.d
dyld[85665]: Symbol not found: __ZNSt3__122__libcpp_verbose_abortEPKcz
  Referenced from: <CB47C4F5-A6AD-3C77-9708-F01B764A6FA9> /opt/procjets/llvm-project/final/Phase3/Release/llvmCore-17.0.6-final.obj/bin/llvm-min-tblgen
  Expected in:     <B8339FB2-CBAE-3D84-B080-BD19DDB2981C> /usr/lib/libc++.1.dylib

arm64-apple-darwin22 get the same error.

macOS 13.2.1 with xcode 14.3.1

ykfq commented 10 months ago

Got same error when building latest ungoogled-chromium-macos from source for Intel Core i5:

dyld[57934]: Symbol not found: (__ZNSt3__122__libcpp_verbose_abortEPKcz)
  Referenced from: '~/workpsace/ungoogled-chromium-macos/build/src/third_party/llvm-build/Release+Asserts/bin/clang-17'
  Expected in: '/usr/lib/libc++.1.dylib'
ninja: build stopped: subcommand failed.
Rubyer77 commented 3 months ago

@ykfq did you find a fix, i have the same problem

calvin2021y commented 3 months ago

I use cmake build now, this will skip IOS related files:

cmake -S llvm -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DCMAKE_INSTALL_PREFIX=/opt/local/llvm \
-DLLVM_TARGETS_TO_BUILD='AArch64' \
-DLLVM_DEFAULT_TARGET_TRIPLE='aarch64-apple-darwin23' \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind;openmp" \
-DLLVM_CREATE_XCODE_TOOLCHAIN=OFF \
-DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)" \
-DLLVM_ENABLE_LIBCXX=ON \
-DLIBCXX_PSTL_CPU_BACKEND=libdispatch