CLI equivalent for 'lib-dir' configuration file option

axricard axelrwiko at gmail.com
Tue May 21 07:10:23 UTC 2024


On Monday, 20 May 2024 at 15:58:04 UTC, kinke wrote:
> Hi! Yeah, there's no CLI equivalent for `lib-dirs`, which is 
> special. See e.g. the `libDirs` occurrences in 
> https://github.com/ldc-developers/ldc/blob/master/driver/linker-msvc.cpp. What you are missing in this specific case is linking `ldc_rt.builtins.lib`, which the compiler only does implicitly if found in `lib-dirs`, as for other libraries (not guaranteed to be bundled with the LDC installation) and object files.

Big thanks !! I totally missed that one. For the records, here is 
the final command to fully cross-compile and cross-link :

``` bash
>> LDC_WIN=$LDC_ROOT/lib-win64/ldc2-${LDC_VERSION}-windows-x64/
>> ldc2 -mtriple=x86_64-windows -L=-L$LDC_WIN/lib 
>> -L=-L$LDC_WIN/lib/mingw -defaultlib=phobos2-ldc,druntime-ldc 
>> -L=-lldc_rt.builtins foo.d
```


More information about the digitalmars-d-ldc mailing list