wasm/baremetal lit tests failing on NixOS

Thomas Mader thomas.mader at gmail.com
Sat Dec 22 15:07:00 UTC 2018


Hello,

I try to update the ldc package on NixOS to 1.13.0 but get the 
following errors when running the wasm lit tests:

$ "/build/ldc-1.13.0-src/build/bin/ldc2" 
"-mtriple=wasm32-unknown-unknown-wasm" "-link-internally" 
"/build/ldc-1.13.0-src/tests/baremetal/wasm.d" "-conf=" 
"-I/build/ldc-1.13.0-src/tests/baremetal/inputs"
# command stderr:
ldc2: Unknown command line argument '-link-internally'.

and

$ "/build/ldc-1.13.0-src/build/bin/ldc2" 
"-mtriple=wasm32-unknown-unknown-wasm" "-betterC" 
"/build/ldc-1.13.0-src/tests/baremetal/wasm2.d"
# command stderr:
wasm2.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Error: 
/nix/store/klci955kxil7q32ggran6lnhpnkk8yjz-gcc-wrapper-7.3.0/bin/gcc failed with status: 1

I thought that the missing -link-internally argument is caused by 
the -DLDC_WITH_LLD=OFF option but removing it doesn't solve the 
problem.
I think the main problem is that gcc is the build compiler in the 
environment and I haven't found a way to change that to clang.
Could this be the problem? It seems that LLD is not used for 
linking and that's also the reason why -link-internally isn't 
available.

The baremetal directory didn't change since 1.11.0 and 1.11.0 was 
working on NixOS with llvm 5.
The strange thing is that gcc was used for building with 1.11.0 
too.
I build with llvm 6 now and wasm on NixOS seems to be enabled:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/llvm/6/llvm.nix#L15

Any ideas?

Thomas



More information about the digitalmars-d-ldc mailing list