Comments (4)
So IIUC, you are hitting build issues with libc++
, for the compiler/bundled tools itself. #3711 concerns user programs being able to use core.stdcpp.*
for libc++, with a prebuilt druntime expecting libstdc++ on Linux; this doesn't affect the compiler build itself (the compiler itself isn't using core.stdcpp
).
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).
from ldc.
What's your exact CMake command-line?
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 libstdc++
with glibc
. I do not know what the limitations of this libc are when cross compiling. Because there are custom llvm builds that don't use libstdc++
to cross compile (similar to the zig toolchain).
The biggest deadlock for me is this error in switching C++ABI. Also, the dependency on llvm-config
makes it difficult to redirect custom llvm root (libs & include only).
from ldc.
The biggest deadlock for me is this bug in switching C++ABI
What bug? AFAICT, you don't pass any -stdlib=libc++
when compiling the LDC C++ parts. From the various logs that you've added, I only see relevant failures when linking C++ executables (ldmd2 and vendored LLVM tools - no D involved anywhere), so if you thought -DD_COMPILER_FLAGS="-gcc=clang -Xcc=-stdlib=libc++
would somehow be enough to switch compiler and tools to libc++, then that's definitely not the case. You'll most likely need to set CMAKE_CXX_FLAGS
or so, as you would for any other C++ project.
from ldc.
What bug?
No, error build only!
AFAICT, you don't pass any
-stdlib=libc++
when compiling the LDC C++ parts.
Yeah! There's not much choice from what I've seen. Hopefully I can at least build it with musl static.
so if you thought
-DD_COMPILER_FLAGS="-gcc=clang -Xcc=-stdlib=libc++"
This flag was needed because the D Compiler failed to follow the default linker. This may be -DLDC_LINK_MANUALLY
related.
You'll most likely need to set
CMAKE_CXX_FLAGS
or so, as you would for any other C++ project.
Ok.
from ldc.
Related Issues (20)
- ldc ignore mtriple when use with --fsanitize=address HOT 1
- libLTO-ldc.dylib missing in 1.36 Release for osx-arm64 HOT 2
- DWARF for static members are wrong HOT 2
- ICE on `&(foo[])[0]`
- 'Instruction does not dominate all uses' wrt. ternary expressions using array literals HOT 1
- undefined reference to `llvm::SampleContextTracker::getContextString[abi:cxx11](llvm::sampleprof::FunctionSamples const&) const' HOT 2
- linkonce-templates bugs HOT 2
- llvm 18 HOT 6
- Tests fail on Gentoo HOT 1
- ASan regression on Windows with MSVC 14.38.33130 HOT 1
- uncaught exception reached top of stack HOT 4
- LDC 1.37.0 is missing FreeBSD binaries HOT 6
- Possible memory corruption in GarbageCollect2Stack pass HOT 6
- Re-enable frame pointers for optimized code
- undefined symbol on hidden function: LDC should detect usage of symbols in inline assembly for LTO builds and keep them HOT 4
- [Feature Request] Non-constant static initialized nested delegate literal expression better error message HOT 13
- Test failures on linux aarch64 HOT 3
- [x86] segmentation fault with aligned struct parameters HOT 5
- GC Memory leak HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ldc.