Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Name mangling problems with LDC 1.13.0 when building DMD 2.083.1 backend #2954
On NixOS building dmd 2.083.1 with LDC 1.13.0 doesn't work.
../generated/linux/release/64/backend.a(evalu8.o):dmd/backend/evalu8.d:function evalu8(elem*, unsigned int): error: undefined reference to 'Z7_moduloeS'
The created symbol Z7_moduloeS is not a valid name mangled symbol and the corresponding correctly mangled name created by the g++ or clang compilers is _Z7_moduloee .
To reproduce the problem it's sufficient to just compile evalu8.d and check for the generated "modulo" symbol name:
ldmd2 -c -of../generated/linux/release/64/evalu8.o -version=MARS -fPIC -J../generated/linux/release/64 -w -de -O -release -inline -m64 -mv=dmd.backend=dmd/backend -betterC dmd/backend/evalu8.d
I also tried with LLVM 7 but the unittests failed:
Test project /build/ldc-1.13.0-src/build
It must be a bug in LDC 1.13.0 but what I don't understand is that Archlinux also uses LDC 1.13.0 to build DMD 2.083.1 at least according to their package repository. (https://www.archlinux.org/packages/community/x86_64/ldc/)
LDC - the LLVM D compiler (1.13.0):
See also the forum discussion at https://firstname.lastname@example.org