Compiles fine manually, fails to compile in RetroPie script
-
Hi, I'm currently attempting to write a port for xash3d-fwgs, a newer version of the engine for Half-Life. Unfortunately, I'm having a strange issue where running the steps manually results in a compiled build that functions, but running them through a RetroPie scriptmodule fails. I suspect that what is going on is RetroPie is adding its own CFLAGS and this is causing the script's detection to fail. Here's the in-progress version of the script module:
rp_module_id="xash3d-fwgs" rp_module_desc="xash3d-fwgs - Half-Life Engine Port" rp_module_help="Please add your full version xash3d-fwgs files to $romdir/ports/$md_id/ to play." rp_module_section="exp" rp_module_flags="!mali !x86" function depends_xash3d-fwgs() { getDepends libsdl2-dev libfontconfig1-dev libfreetype6-dev } function sources_xash3d-fwgs() { gitPullOrClone "$md_build" https://github.com/FWGS/xash3d-fwgs.git } function build_xash3d-fwgs() { ./waf configure -T release ./waf build md_ret_require=( "$md_build/build/game_launch/xash3d" "$md_build/build/engine/libxash.so" ) } function install_xash3d-fwgs() { ./waf install } function configure_xash3d-fwgs() { # Work not started on configure, ignore. }
Building with this script results in the following:
[ 3/258] Compiling public/xash3d_mathlib.c [ 4/258] Compiling public/crtlib.c In file included from ../public/crtlib.h:20, from ../public/crclib.c:17: ../public/build.h:188:4: error: #error "Unknown ARM" #error "Unknown ARM"
Instructions for building manually found here under Building: https://github.com/FWGS/xash3d-fwgs
Looking into build/compile_commands.json in my manual compile, I see the following:
"arguments": [ "/usr/bin/gcc", "-g", "-fvisibility=hidden", "-O3", "-fdiagnostics-color=always", "-Werror=return-type", "-Werror=parentheses", "-Werror=vla", ...
Looking at the build/compile_commands.json of the RetroPie build, I see the following:
{ "arguments": [ "/usr/bin/gcc", "-march=armv8-a+crc", "-mtune=cortex-a72", "-mfpu=neon-fp-armv8", "-mfloat-abi=hard", "-O2", "-g", "-fvisibility=hidden", "-O3", "-fdiagnostics-color=always", "-Werror=return-type", "-Werror=parentheses", "-Werror=vla", ...
Looking at the piece of code for figuring out the ARM stuff, from public/build.h:
#elif defined __arm__ || defined _M_ARM #if defined _M_ARM // msvc can only armv7 ? #define XASH_ARM 7 #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ #define XASH_ARM 7 #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ #define XASH_ARM 6 #elif __ARM_ARCH == 5 || __ARM_ARCH_5__ #define XASH_ARM 5 #elif __ARM_ARCH == 4 || __ARM_ARCH_4__ #define XASH_ARM 4 #else #error "Unknown ARM" #endif ... #if defined __SOFTFP__ || __ARM_PCS_VFP == 0 #define XASH_ARM_SOFTFP 1 #else // __SOFTFP__ #define XASH_ARM_HARDFP 1 ... #if XASH_ARM == 7 #define XASH_ARMv7 1 #elif XASH_ARM == 6 #define XASH_ARMv6 1 #elif XASH_ARM == 5 #define XASH_ARMv5 1 #elif XASH_ARM == 4 #define XASH_ARMv4 1 #endif
I'm not too sure how to continue here. I attempted to add CFLAGS="" before the ./waf calls in build and it did indeed remove the flags that RetroPie seems to be adding however you can see that it's only worked for a few files, not all of them.
Any ideas/advice would be most appreciated.
-
That's because
-march=armv8-a+crc
switches__ARM_ARCH
to8
, while the defaults for the compiler sets__ARM_ARCH
to6
. The header you referenced doesn't know about the newer__ARM_ARCH
variant.# RetroPie flags $ echo | gcc -march=armv8-a+crc -dM -E - | grep -i '__ARM_ARCH ' #define __ARM_ARCH 8 # no flags $ echo | gcc -dM -E - | grep -i '__ARM_ARCH ' #define __ARM_ARCH 6
-
@mitu Thank you, I've sent a pull request upstream with the fix.
-
@zerojay You pull was accepted
-
@kactius said in Compiles fine manually, fails to compile in RetroPie script:
@zerojay You pull was accepted
Yep, thanks.
-
Hi
I update extras script and test xash3d-fwgs
Could not successfully build xash3d-fwgs - xash3d-fwgs - Half-Life Engine Port (home/pi/RetroPie-Setup/rmp/build/xash3d-fwgs/xash3d-fwgs/build/game_launch/Xash3D not found)...Really the folder is empty sftp://retropie/home/pi/RetroPie-Setup/tmp/build/xash3d-fwgs/xash3d-fwgs/build/game_launch/ empty
If you need logs, please ask me
-
@kactius said in Compiles fine manually, fails to compile in RetroPie script:
Hi
I update extras script and test xash3d-fwgs
Could not successfully build xash3d-fwgs - xash3d-fwgs - Half-Life Engine Port (home/pi/RetroPie-Setup/rmp/build/xash3d-fwgs/xash3d-fwgs/build/game_launch/Xash3D not found)...Really the folder is empty sftp://retropie/home/pi/RetroPie-Setup/tmp/build/xash3d-fwgs/xash3d-fwgs/build/game_launch/ empty
If you need logs, please ask me
Yeah, post the logs please.
-
@zerojay
/home/pi/RetroPie-Setup/logs/rps_2020-10-14_123218.log.gz
https://pastebin.com/wAh1AfQrIf you need more logs, say me patch to other logs
-
@kactius said in Compiles fine manually, fails to compile in RetroPie script:
@zerojay
/home/pi/RetroPie-Setup/logs/rps_2020-10-14_123218.log.gz
https://pastebin.com/wAh1AfQrIf you need more logs, say me patch to other logs
Nothing I can do about that, you'll need to ask upstream.
-
-
@kactius yes it was fixed on Wednesday. I came across it not working so I was working with the dev over there on fwgs and we got it all straightened out. Just hope that it stays that way this time
-
@exarkuniv said in Compiles fine manually, fails to compile in RetroPie script:
@kactius yes it was fixed on Wednesday. I came across it not working so I was working with the dev over there on fwgs and we got it all straightened out. Just hope that it stays that way this time
Oh! Very thanks.
fwgs is working.
I paste the game files in this moment some ¿textures? don't look good in pi 3 b+ pi3.
Found rendener gl: OpenGL
Found renderer soft: Sofitware Loading renderer: gl -> libref_gl.so
Trying safe opengl mode O
bpp 32
Sys Warn Error: Can't initialize libref_gl.so renderer
Loading renderer: gl -> libref_gl.so -
@kactius i think that,s happening cuz the pi3 does not support opengl
i have the old halflife port on my pi3 so i cant test it on that since i have it working fine.and right now im working with my pi4
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.