New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDC-src Build: C++ ABI broken #4576
Comments
So IIUC, you are hitting build issues with I've never tried libc++ on Linux; but if both LLVM and the compiler are built against it, I'd expect it to work. As you're getting linker errors for C++-only tools like ldmd2, it looks like there's a mismatch between LLVM and the C++ parts of LDC. What's your exact CMake command-line? Btw, why libc++? The official LDC binaries link libstdc++ fully statically: ldc/.github/workflows/main.yml Line 33 in 6ede9a4
And libstdc++ is apparently an option with musl, as Alpine's ldc package uses it (https://pkgs.alpinelinux.org/package/edge/community/x86_64/ldc). |
cmake "$ROOTDIR/ldc" \
-DLLVM_ROOT_DIR="$ROOTDIR/out/llvm-cross-$TARGET-$MCPU" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CROSSCOMPILING=True \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX="$ROOTDIR/out/$TARGET-$MCPU" \
-DCMAKE_PREFIX_PATH="$ROOTDIR/out/$TARGET-$MCPU" \
-DCMAKE_SYSTEM_NAME="$TARGET_OS_CMAKE" \
-DLLVM_IS_SHARED=OFF \
-DD_COMPILER_FLAGS="-gcc=clang -Xcc=-static -Xcc=-stdlib=libc++ -linker=lld"
cmake --build . --target install --parallel 5 I have had problems building using ldc for musl-abi target (mainly cross-compiling) since issue #4520. However, I use this libc for embedded devices and software portability. Usually I get into the bad habit of linking |
What bug? AFAICT, you don't pass any |
No, error build only!
Yeah! There's not much choice from what I've seen. Hopefully I can at least build it with musl static.
This flag was needed because the D Compiler failed to follow the default linker. This may be
Ok. |
Environment Build Test
OS: Alpine latest (docker)
Tools: ldc 1.33 + llvm/clang/libc++ 17 (alpine-pkgs)
Compiler: ldc-master (1.37.0) building
Arch: x86_64
During a few tests to build the musl-toolchain, I got errors when trying to (static) build it with another C++ ABI (non-gnu)
libc++
. However, when building on Linux systems, only the C++ ABI (GNU)libstdc++
works correctly.I believe the issue is not related to the Musl target, but just the C++ ABI conflict.
Briefly, I have attempted build a portable ldc-toolchain for use in a legacy distro without interference from glibc version.
I also have questions about the
-DLLVM_IS_SHARED=OFF
flag and about the parameters passed by llvm-config.Can you make LLVM-rootdir completely independent of llvm-config ( fulfilling all necessary LLVM dependencies)?
Note: I think in this case the mistake is also because the LLVM available in package is built by
libstdc++
notlibc++
.Some errors
Full log:
ldc2_build_clanglibcxx.log
ldc2_build_ziglibcxx.log
Reference
The text was updated successfully, but these errors were encountered: