Closed mihails-strasuns closed 8 years ago
hmm, for me it works, at least for the static PKGBUILD i have and also for ldc-git, @Dicebot checkout a possible fix in: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ldc-git
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ldc-git
Perhaps with -DCMAKE_EXE_LINKER_FLAGS='-static-libstdc++ -Wl,-rpath,\$ORIGIN' \
you override the default linker flags that contain stuff that our build script / the D compiler doesn't like?
Problem is with Archlinux /etc/makepkg.conf it defines:
LDFLAGS="-Wl,O1,--sort-common,--as-needed,-z,relro"
which does not work with ldmd.
One workaround is to use this in PKGBUILD before cmake
export LDFLAGS="-L-O1 -L--sort-common -L--as-needed -L-z -Lrelro"
But you still need to uninstall ldc first and use dmd to build ldc 1.0.0. Because there is a some ABI(different mangling symbol) issue with ldc 0.17.1. And after thatr you can use ldc 1.0.0 tu rebuild itself
Related to #1530
We could of course add another special case to the CMake script that properly splits up such flags, but what we should really do is to add something like a -linker-driver-arg=…
command line switch similar to -L
that does not prepend -Xlinker
. We can just forward the flags from llvm-config, pkg-config, CMAKE_EXE_LINKER_FLAGS (which is the issue here) and so on then. Everything else seems very brittle.
Thanks for hints/explanation. I will go with export
workaround for now, updated package should propagate to mirrors in few hours.
@Dicebot: It would be great if you could give master a quick try on Arch without the LDFLAGS workaround to see whether there are any remaining issues. The fix should be part of 1.1.0-beta2
otherwise.
I assume this is fixed by now. Feel free to reopen if it still doesn't work.
Correct, works for me on master.
Trying to use my usual build script which looks like this:
LDC does build bunch of files just fine but whenever it gets to linking, this error shows up:
Arch Linux x86_64 (ld 2.26.0 , cmake 3.5.2)