Relocation error

SealabJaster sealabjaster at gmail.com
Wed Aug 4 18:52:40 UTC 2021


I'm currently working on a libc-less standard library for myself, 
and was working on Posix support recently.

However, I'm now running into the following linker error that I 
really don't know what to do with:

```
/usr/bin/ld: 
.dub/build/test-debug-linux.posix-x86_64-dmd_v2.097.1-6FDCEE655D96859081886B42E500F838/libd.o: relocation R_X86_64_32 against symbol `_D7runtime10entrypoint13g_programArgsS4libd14datastructures5array__T5ArrayTAxaSQBp6memory9allocator15systemallocator15SystemAllocatorSQDsQDq6growth__T6GrowthVii0S_DQEwQEuQBe__T6GrowToVmi8ZQmFNaNbNiNfZSQGhQGfQCp__T6GrowBySQHbQGzQDj__TQCfVmi8ZQCnFNbNiZ9__lambda1ZQBwVii8S_DQIzQIxQFh__T11GrowByScaleVmi2ZQsFNaNbNiNfZSQKqQKoQGy__TQEjSQLgQLeQHo__TQChVmi2ZQCpFNbNiZQEfZQFuZQIjZQLr' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
```

I've uploaded the current state of the code [1] in case anyone 
has the free time to check it out, because I have 0 clue on how 
to solve this as I'm mostly a windows dev, and this is only 
happening on linux.

Using DMD 2.097, Ubuntu 20.24 on WSL2, ld 2.34.

p.s. I thought I'd end up saying the opposite, but the win32 API 
is much nicer so far.

[1] https://github.com/BradleyChatha/bcstd


More information about the Digitalmars-d-learn mailing list