abseil / abseil/abseil-cpp

[Bug]: Missing symbol when compiling 32-bit monolithic shared libs with lld-link (MSVC-like)

Đang mở
#2,035 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
18.1k
Fork
3.2k
Merge trung bình
20 giờ 36 phút
Pull request đã merge (30 ngày)
1

Mô tả

### Describe the issue

All definitions defined by `ABSL_INTERNAL_C_SYMBOL` are not found by lld-link

```
$ninja abseil_dll

lld-link: error: : undefined symbol: __AbslContainerInternalSampleEverything
lld-link: error: : undefined symbol: __AbslInternalMutexYield
lld-link: error: : undefined symbol: __AbslInternalOnFatalLogMessage
lld-link: error: : undefined symbol: __AbslInternalPerThreadSemInit
lld-link: error: : undefined symbol: __AbslInternalPerThreadSemPoke
lld-link: error: : undefined symbol: __AbslInternalPerThreadSemPost
lld-link: error: : undefined symbol: __AbslInternalPerThreadSemWait
lld-link: error: : undefined symbol: __AbslInternalSleepFor
lld-link: error: : undefined symbol: __AbslInternalSpinLockDelay
lld-link: error: : undefined symbol: __AbslInternalSpinLockWake
lld-link: error: : undefined symbol: __AbslInternalTraceContinue
lld-link: error: : undefined symbol: __AbslInternalTraceObserved
lld-link: error: : undefined symbol: __AbslInternalTraceSignal
lld-link: error: : undefined symbol: __AbslInternalTraceWait
lld-link: error: : undefined symbol: ____local_stdio_printf_options
lld-link: error: : undefined symbol: __fprintf
lld-link: error: : undefined symbol: __snprintf
```

cmake command are like
```
LLVM_PATH=$HOME/clang+llvm-22.1.3-arm64-apple-darwin20.1.0
cmake -G Ninja \
-DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_STANDARD_REQUIRED=on \
-DABSL_ENABLE_INSTALL=off \
-DBUILD_SHARED_LIBS=on \
-DABSL_MSVC_STATIC_RUNTIME=off \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=$HOME/vstoolchain/cmake/platforms/WinMsvc.cmake \
-DHOST_ARCH=$WITH_CPU \
-DCMAKE_RC_COMPILER=$HOME/vstoolchain/llvm-rc \
-DCMAKE_MT=$HOME/vstoolchain/llvm-mt \
-DCMAKE_NM=$HOME/vstoolchain/llvm-nm \
-DLLVM_NATIVE_TOOLCHAIN=$LLVM_PATH \
"-DMSVC_BASE=$HOME/vstoolchain/VC/Tools/MSVC/14.50.35717" \
"-DWINSDK_BASE=$HOME/vstoolchain/Windows Kits/10" \
-DWINSDK_VER=10.0.26100.0 \
..
```

### Steps to reproduce the problem

1. generate zip tarball with depot_tools' [package_from_installed.py script](https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main/win_toolchain/package_from_installed.py), make sure you have visual studio 2026 installed.
2. cd $HOME && git clone https://github.com/hukeyue/vstoolchain
3. extract the zip from step1 into $HOME/vstoolchain
4. cd $HOME && git clone https://github.com/abseil/abseil-cpp
5. cd $HOME/vstoolchain && WITH_CPU=x86 ./build-abseil.sh
6. cd $HOME/abseil-cpp/build-msvc-x86-dynamic && ninja abseil_dll

### What version of Abseil are you using?

04f3bc01d12cf58c90a1bb68990f087fa3c3ed19

### What operating system and version are you using?

macOS `Darwin Kernel Version 25.4.0: Thu Mar 19 19:31:56 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T6030`

### What compiler and version are you using?

➜ ~ ~/clang+llvm-22.1.3-arm64-apple-darwin20.1.0/bin/clang -v
clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
Target: arm64-apple-darwin25.4.0
Thread model: posix
InstalledDir: /Users/keeyou/clang+llvm-22.1.3-arm64-apple-darwin20.1.0/bin

### What build system are you using?

➜ ~ cmake --version
cmake version 4.3.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

### Additional context

see https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main/win_toolchain/package_from_installed.py and https://github.com/hukeyue/vstoolchain/blob/master/build-abseil.sh

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.