Jump to page: 1 2
Thread overview
How to build a statically linked executable, before i loose my mind
Jul 13
ryuukk_
Jul 13
Sergey
Jul 13
ryuukk_
Jul 13
ryuukk_
Jul 13
ryuukk_
Jul 13
ryuukk_
Jul 14
ryuukk_
July 13

First of all, i build with ldmd2

Second of all, i do not use DUB

Lastly, it fails with:

ldmd2 -L-static  ...
/usr/bin/ld: cannot find -lphobos2-ldc-shared: No such file or directory
/usr/bin/ld: cannot find -ldruntime-ldc-shared: No such file or directory

Why does it complain about SHARED when passing STATIC?

July 13

On Saturday, 13 July 2024 at 14:53:41 UTC, ryuukk_ wrote:

>

Why does it complain about SHARED when passing STATIC?

It depends on the OS and if Linux - distribution.

July 14
On 14/07/2024 2:53 AM, ryuukk_ wrote:
> First of all, i build with `ldmd2`
> 
> Second of all, i do not use DUB
> 
> Lastly, it fails with:
> 
> 
> ```
> ldmd2 -L-staticĀ  ...
> ```
> 
> ```
> /usr/bin/ld: cannot find -lphobos2-ldc-shared: No such file or directory
> /usr/bin/ld: cannot find -ldruntime-ldc-shared: No such file or directory
> ```
> 
> 
> Why does it complain about SHARED when passing STATIC?

Doesn't look like the switch does what you are thinking it does.

```
-static
On systems that support dynamic linking, this overrides -pie and prevents linking with the shared libraries. On other systems, this option has no effect.
```

https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Preventing linking against, and swapping two different binaries to link against are different things.

Specifying to link against the shared libraries for druntime + phobos is done by the compiler, not the linker.

You might want to try ``--link-defaultlib-shared=false`` instead.
July 13

I'm loosing it

Even with dub it doesn't work

"lflags": [ "-static", "--link-defaultlib-shared=false" ],

(cut due to forum's limit)
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd6__ctorMFNaNbNcNfAyaZSQCtQCp__TQClHTyaZQCt+0x1a9): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd6__ctorMFNaNbNcNfAyaZSQCtQCp__TQClHTyaZQCt+0x1c5): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd6__ctorMFNaNbNcNfAyaZSQCtQCp__TQClHTyaZQCt+0x1e3): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd6__ctorMFNaNbNcNfAyaZSQCtQCp__TQClHTyaZQCt+0x1fc): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd__T7processTS3std5array__T8AppenderTAyaZQoZQBoMFNaNbNfKQBrZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd__T7processTS3std5array__T8AppenderTAyaZQoZQBoMFNaNbNfKQBrZv+0xfe): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv+0x6c): undefined reference to `_D3std5ascii7isWhiteFNaNbNiNfwZb'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv+0x142): undefined reference to `_D3std5ascii7isWhiteFNaNbNiNfwZb'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv+0x17d): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv+0x196): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv+0x1b1): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv+0x1cd): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd11stripIndentMFNaNbNiNfZv+0x1ee): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0xff): undefined reference to `_d_array_slice_copy'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x13c): undefined reference to `_D3std5ascii7isWhiteFNaNbNiNfwZb'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x16d): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x186): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x1a1): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x1bc): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x1da): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x1f5): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd16processFirstLineMFNaNbNiNfZv+0x20b): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd15processLastLineMFNaNbNiNfZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd15processLastLineMFNaNbNiNfZv+0xc7): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd15processLastLineMFNaNbNiNfZv+0xe0): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd15processLastLineMFNaNbNiNfZv+0xfc): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv+0x1d4): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv+0x1f0): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv+0x209): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv+0x222): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv+0x240): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o):trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv+0x25b): more undefined references to `_d_arraybounds_index' follow
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10unDecorateMFNaNbNiNfZv+0x276): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x54): undefined reference to `_D3std5ascii7isWhiteFNaNbNiNfwZb'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0xf7): undefined reference to `_D3std5ascii7isWhiteFNaNbNiNfwZb'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x1fd): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x216): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x231): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x24c): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x267): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x282): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd9stripLeftMFNaNbNiNfZv+0x29e): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: server/dls/libdcd.a(dparse.trivia.o): in function `_D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10stripRightMFNaNbNiNfZv':
trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10stripRightMFNaNbNiNfZv+0x5f): undefined reference to `_D3std5ascii7isWhiteFNaNbNiNfwZb'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10stripRightMFNaNbNiNfZv+0x9e): undefined reference to `_D3std5ascii7isWhiteFNaNbNiNfwZb'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10stripRightMFNaNbNiNfZv+0xcd): undefined reference to `_d_arraybounds_slice'
/usr/bin/ld: trivia.d:(.text._D6dparse6trivia__T22MultiLineCommentHelperHTyaZQBd10stripRightMFNaNbNiNfZv+0xf8): undefined reference to `_d_arraybounds_index'
/usr/bin/ld: server/dls/libdcd.a(msgpack.streaming_unpacker.o):(.data._D11TypeInfo_xb6__initZ+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ'
/usr/bin/ld: server/dls/libdcd.a(msgpack.streaming_unpacker.o):(.data._D11TypeInfo_xb6__initZ+0x10): undefined reference to `_D10TypeInfo_b6__initZ'
/usr/bin/ld: server/dls/libdcd.a(dcd.server.autocomplete.symbols.o):(.data._D3dcd6server12autocomplete7symbols12__ModuleInfoZ+0x10): undefined reference to `_D3std12experimental6logger12__ModuleInfoZ'
/usr/bin/ld: server/dls/libdcd.a(dcd.server.server.o):(.data._D3dcd6serverQh12__ModuleInfoZ+0x10): undefined reference to `_D3std12experimental6logger12__ModuleInfoZ'
/usr/bin/ld: server/dls/libdcd.a(dcd.server.server.o):(.data._D3dcd6serverQh12__ModuleInfoZ+0x18): undefined reference to `_D3std7process12__ModuleInfoZ'
/usr/bin/ld: server/dls/libdcd.a(msgpack.common.o):(.data._D11TypeInfo_xh6__initZ+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ'
/usr/bin/ld: server/dls/libdcd.a(msgpack.common.o):(.data._D11TypeInfo_xh6__initZ+0x10): undefined reference to `_D10TypeInfo_h6__initZ'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x8): undefined reference to `_D6object9Throwable8toStringMFZAya'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x10): undefined reference to `_D6object6Object6toHashMFNbNeZm'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x18): undefined reference to `_D6object6Object5opCmpMFCQqZi'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x20): undefined reference to `_D6object6Object8opEqualsMFCQtZb'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x28): undefined reference to `_D6object9Throwable4nextMNgFNaNbNdNiNjNlNfZNgCQBsQBo'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x30): undefined reference to `_D6object9Throwable4nextMFNaNbNdNiNlNfCQBlQBhZv'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x38): undefined reference to `_D6object9Throwable7opApplyMFMDFCQBfQBbZiZi'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x40): undefined reference to `_D6object9Throwable8toStringMxFMDFIAaZvZv'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception20MessagePackException6__vtblZ+0x48): undefined reference to `_D6object9Throwable7messageMxFNbNfZAxa'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data._D7msgpack9exception20MessagePackException7__ClassZ+0x0): undefined reference to `_D14TypeInfo_Class6__vtblZ'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data._D7msgpack9exception20MessagePackException7__ClassZ+0x50): undefined reference to `_D9Exception7__ClassZ'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x8): undefined reference to `_D6object9Throwable8toStringMFZAya'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x10): undefined reference to `_D6object6Object6toHashMFNbNeZm'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x18): undefined reference to `_D6object6Object5opCmpMFCQqZi'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x20): undefined reference to `_D6object6Object8opEqualsMFCQtZb'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x28): undefined reference to `_D6object9Throwable4nextMNgFNaNbNdNiNjNlNfZNgCQBsQBo'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x30): undefined reference to `_D6object9Throwable4nextMFNaNbNdNiNlNfCQBlQBhZv'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x38): undefined reference to `_D6object9Throwable7opApplyMFMDFCQBfQBbZiZi'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x40): undefined reference to `_D6object9Throwable8toStringMxFMDFIAaZvZv'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data.rel.ro._D7msgpack9exception15UnpackException6__vtblZ+0x48): undefined reference to `_D6object9Throwable7messageMxFNbNfZAxa'
/usr/bin/ld: server/dls/libdcd.a(msgpack.exception.o):(.data._D7msgpack9exception15UnpackException7__ClassZ+0x0): undefined reference to `_D14TypeInfo_Class6__vtblZ'
/usr/bin/ld: server/dls/libdcd.a(dcd.server.autocomplete.doc.o):(.data._D3dcd6server12autocomplete3doc12__ModuleInfoZ+0x10): undefined reference to `_D3std12experimental6logger12__ModuleInfoZ'
/usr/bin/ld: server/dls/libdcd.a(dcd.server.autocomplete.inlayhints.o):(.data._D3dcd6server12autocomplete10inlayhints12__ModuleInfoZ+0x10): undefined reference to `_D3std12experimental6logger12__ModuleInfoZ'
/usr/bin/ld: server/dls/libdcd.a(dcd.server.autocomplete.localuse.o):(.data._D3dcd6server12autocomplete8localuse12__ModuleInfoZ+0x10): undefined reference to `_D3std12experimental6logger12__ModuleInfoZ'
collect2: error: ld returned 1 exit status
Error: /usr/bin/cc failed with status: 1
make: *** [makefile:42: build-dls-release] Error 1
ryuukk@ark:~/dev/dls (master)
$
July 13

For anyone curious:

https://github.com/ryuukk/dls/tree/master

make build-dcd-release && make build-dls-release

i'm giving up for now, i'll never touch druntime/phobos/dub never again

July 14
Seeing ``_d_arraybounds_slice`` missing sounds like druntime isn't being linked against.

It is possible that your distribution of ldc doesn't include a static build of druntime/phobos. You need to verify that ld is trying to link against a static build and that static build exists.
July 13

On Saturday, 13 July 2024 at 16:16:20 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

Seeing _d_arraybounds_slice missing sounds like druntime isn't being linked against.

It is possible that your distribution of ldc doesn't include a static build of druntime/phobos. You need to verify that ld is trying to link against a static build and that static build exists.

curl -fsS https://dlang.org/install.sh | bash -s ldc

July 14
On 14/07/2024 4:37 AM, ryuukk_ wrote:
> On Saturday, 13 July 2024 at 16:16:20 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> Seeing ``_d_arraybounds_slice`` missing sounds like druntime isn't being linked against.
>>
>> It is possible that your distribution of ldc doesn't include a static build of druntime/phobos. You need to verify that ld is trying to link against a static build and that static build exists.
> 
> `curl -fsS https://dlang.org/install.sh | bash -s ldc`

Okay yup, looks like its all there in latest release.

Have to dump out what ld is getting passed to it, and what it thinks it is doing next.
July 13

On Saturday, 13 July 2024 at 16:44:22 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

On 14/07/2024 4:37 AM, ryuukk_ wrote:

>

On Saturday, 13 July 2024 at 16:16:20 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

Seeing _d_arraybounds_slice missing sounds like druntime isn't being linked against.

It is possible that your distribution of ldc doesn't include a static build of druntime/phobos. You need to verify that ld is trying to link against a static build and that static build exists.

curl -fsS https://dlang.org/install.sh | bash -s ldc

Okay yup, looks like its all there in latest release.

Have to dump out what ld is getting passed to it, and what it thinks it is doing next.

/usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/tmp/ccBV7TjM.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o bin/dls /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/home/runner/dlang/ldc-1.39.0/bin/../lib -L/home/runner/dlang/ldc-1.39.0/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/home/runner/dlang/ldc-1.39.0/lib -L/usr/lib/gcc/x

https://github.com/ryuukk/dls/actions/runs/9921536908/job/27409615370

It works locally, but not their machine, ubuntu apparently

July 14
On 14/07/2024 5:06 AM, ryuukk_ wrote:
> On Saturday, 13 July 2024 at 16:44:22 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 14/07/2024 4:37 AM, ryuukk_ wrote:
>>> On Saturday, 13 July 2024 at 16:16:20 UTC, Richard (Rikki) Andrew Cattermole wrote:
>>>> Seeing ``_d_arraybounds_slice`` missing sounds like druntime isn't being linked against.
>>>>
>>>> It is possible that your distribution of ldc doesn't include a static build of druntime/phobos. You need to verify that ld is trying to link against a static build and that static build exists.
>>>
>>> `curl -fsS https://dlang.org/install.sh | bash -s ldc`
>>
>> Okay yup, looks like its all there in latest release.
>>
>> Have to dump out what ld is getting passed to it, and what it thinks it is doing next.
> 
> 
> ```
> /usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/tmp/ccBV7TjM.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o bin/dls /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/home/runner/dlang/ldc-1.39.0/bin/../lib -L/home/runner/dlang/ldc-1.39.0/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/home/runner/dlang/ldc-1.39.0/lib -L/usr/lib/gcc/x
> ```
> 
> 
> https://github.com/ryuukk/dls/actions/runs/9921536908/job/27409615370
> 
> 
> It works locally, but not their machine, ubuntu apparently

Boom, got it working!

https://github.com/rikkimax/dls/blob/master/makefile#L39

It's a link order issue.

```
ldc2 -of=bin/dlsobj.o -c --output-o $(OPTIMIZE) $(PREVIEWS) -Iserver/ -i server/cjson/cJSON.c server/dls/main.d

ldc2 -of=bin/dls$(exe) bin/dlsobj.o server/dls/libdcd.a
```


« First   ‹ Prev
1 2