FWGS / hlsdk-portable

Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
https://xash.su
Other
272 stars 125 forks source link

Doesnt link hl.so on debian jessie #320

Open IsaacMvmv opened 2 years ago

IsaacMvmv commented 2 years ago

Waf: Entering directory `/root/.tmp/hl/build' [ 64/169] Linking build/cl_dll/client_mipsel.so [167/169] Linking build/dlls/hl_mipsel.so ../cl_dll/cl_util.h:169:15: warning: type of 'vec3_origin' does not match original declaration extern vec3_t vec3_origin; ^ ../cl_dll/cl_util.h:169:15: warning: type of 'vec3_origin' does not match original declaration ../pm_shared/pm_math.c:34:8: note: previously declared here vec3_t vec3_origin = { 0, 0, 0 }; ^ /usr/bin/ld: /tmp/ccyw0UHB.ltrans0.ltrans.o: relocation R_MIPS_HI16 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /tmp/ccyw0UHB.ltrans0.ltrans.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status

How can I add -fPIC?

IsaacMvmv commented 2 years ago

xash3d-fwgs as well


[404/404] Linking build/mainui/libmenu.so
/usr/bin/ld: /tmp/ccf3qi5r.ltrans0.ltrans.o: relocation R_MIPS_26 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/tmp/ccf3qi5r.ltrans0.ltrans.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status```
a1batross commented 2 years ago

Oh, how it's even missing -fPIC

IsaacMvmv commented 2 years ago

:confused:

a1batross commented 2 years ago

What's the target you're compiling for?

a1batross commented 2 years ago

Ah, I missed that. Debian Jessie, ok.

IsaacMvmv commented 2 years ago

I can't update debian because its on a TV box, and its internal c library can't chroot into stretch+

mittorn commented 2 years ago

just specify it in CFLAGS globally. Other way is force large code model (-mcmodel=large in CFLAGS) to make text relocations work (this will make library loading slower, binaries bigger, but may even improve performance in some cases)

IsaacMvmv commented 2 years ago

The variable? Like CFLAGS+=-fPIC?