devilutionX
devilutionX copied to clipboard
Haiku 64-bit Build Process Fails. "recompile with -fPIC"
Operating System
Other (please specify)
DevilutionX version
1.4.1 (latest release)
Describe
[ 89%] Linking CXX executable ../control_test
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//ccagzQFx.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol _ZZN7testing8internal11MatcherBaseIRKSsE9GetVTableINS4_11ValuePolicyIPKNS_16MatcherInterfaceIS3_EELb1EEEEEPKNS4_6VTableEvE7kVTable' can not be used when making a shared object; recompile with -fPIC /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status test/CMakeFiles/appfat_test.dir/build.make:112: recipe for target 'appfat_test' failed make[2]: *** [appfat_test] Error 1 CMakeFiles/Makefile2:1998: recipe for target 'test/CMakeFiles/appfat_test.dir/all' failed make[1]: *** [test/CMakeFiles/appfat_test.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//cclQIk7m.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol
_ZTV24AnimationInfo_Stand_Test' can not be used when making a shared object; recompile with -fPIC
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
test/CMakeFiles/animationinfo_test.dir/build.make:112: recipe for target 'animationinfo_test' failed
make[2]: *** [animationinfo_test] Error 1
CMakeFiles/Makefile2:1964: recipe for target 'test/CMakeFiles/animationinfo_test.dir/all' failed
make[1]: *** [test/CMakeFiles/animationinfo_test.dir/all] Error 2
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//ccGoJFTt.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol _ZTV23Control_ClearPanel_Test' can not be used when making a shared object; recompile with -fPIC /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status test/CMakeFiles/control_test.dir/build.make:112: recipe for target 'control_test' failed make[2]: *** [control_test] Error 1 CMakeFiles/Makefile2:2100: recipe for target 'test/CMakeFiles/control_test.dir/all' failed make[1]: *** [test/CMakeFiles/control_test.dir/all] Error 2 /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//ccHcNktz.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol
_ZTV35Codec_codec_get_encoded_len_eq_Test' can not be used when making a shared object; recompile with -fPIC
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
test/CMakeFiles/codec_test.dir/build.make:112: recipe for target 'codec_test' failed
make[2]: *** [codec_test] Error 1
CMakeFiles/Makefile2:2066: recipe for target 'test/CMakeFiles/codec_test.dir/all' failed
make[1]: *** [test/CMakeFiles/codec_test.dir/all] Error 2
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//ccU9rGeN.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol _ZTV29Automap_AutomapZoomReset_Test' can not be used when making a shared object; recompile with -fPIC /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status test/CMakeFiles/automap_test.dir/build.make:112: recipe for target 'automap_test' failed make[2]: *** [automap_test] Error 1 CMakeFiles/Makefile2:2032: recipe for target 'test/CMakeFiles/automap_test.dir/all' failed make[1]: *** [test/CMakeFiles/automap_test.dir/all] Error 2 /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//ccNV32Jq.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol
_ZN10devilution7dungeonE' can not be used when making a shared object; recompile with -fPIC
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
CMakeFiles/devilutionx.dir/build.make:417: recipe for target 'devilutionx' failed
make[2]: *** [devilutionx] Error 1
CMakeFiles/Makefile2:1139: recipe for target 'CMakeFiles/devilutionx.dir/all' failed
make[1]: *** [CMakeFiles/devilutionx.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
To Reproduce
- cmake -S. -Bbuild -DVERSION_NUM=1.4.1 -DVERSION_SUFFIX=FFFFFFF -DCMAKE_BUILD_TYPE=Release -DDISABLE_ZERO_TIER=ON
- cmake --build build -j $(getconf _NPROCESSORS_ONLN)
Note: I utilized "-DDISABLE_ZERO_TIER=ON" as recommended for now, being that libzt causes the build process to fail as well, as of the 1.4.1 Release source code.
Expected Behavior
No response
Additional context
No response
Could you try with -DBUILD_TESTING=OFF
Note that the libzt issue should be solved in latest master.
No dice. XP
[100%] Linking CXX executable devilutionx /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//cc3Ro59W.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol `_ZN10devilution7dungeonE' can not be used when making a shared object; recompile with -fPIC /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status CMakeFiles/devilutionx.dir/build.make:417: recipe for target 'devilutionx' failed make[2]: *** [devilutionx] Error 1 CMakeFiles/Makefile2:317: recipe for target 'CMakeFiles/devilutionx.dir/all' failed make[1]: *** [CMakeFiles/devilutionx.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2
Did you try -DSDL_STATIC_PIC=ON
?
Possibly -DPIE=ON
No dice.
cmake -S. -Bbuild -DVERSION_NUM=1.4.1 -DVERSION_SUFFIX=FFFFFFF -DCMAKE_BUILD_TYPE=Release -DDISABLE_ZERO_TIER=ON -DBUILD_TESTING=OFF -DSDL_STATIC_PIC=ON -DPIE=ON
cmake --build build -j $(getconf _NPROCESSORS_ONLN)
[100%] Linking CXX executable devilutionx /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: /tmp//ccZP6d9N.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol `_ZN10devilution7dungeonE' can not be used when making a shared object; recompile with -fPIC /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status CMakeFiles/devilutionx.dir/build.make:417: recipe for target 'devilutionx' failed make[2]: *** [devilutionx] Error 1 CMakeFiles/Makefile2:317: recipe for target 'CMakeFiles/devilutionx.dir/all' failed make[1]: *** [CMakeFiles/devilutionx.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2
Why is it making a shared object? DevilutionX does not build any shared libs by default (when -DBUILD_TESTING=OFF
).
Is there something special about the Haiku linking process?
So back in April, they made the following change to their port of GCC.
https://git.haiku-os.org/buildtools/commit/?h=btrev43193&id=493aaad4dc61224ff101425c283a36960fb6841b
- /* PIE does not work on Haiku, but PIC does the right thing for position
-
- independant executables. So if asked for PIE, do PIC instead.
- */
- if (flag_pie && !flag_pic)
- flag_pic = flag_pie;
- flag_pie = 0;
I've also tried with -DPIE=OFF and it still doesn't work correctly. Bear with me, while I certainly understand more than the average bear and have some practical programming experience, I've never really familiarized myself with the eccentricities of the various GNU build tools and their forks/variants. So I apologize if I'm not being super helpful. =]