From db3929fc58a503ea80605054fa1f6322f1b97393 Mon Sep 17 00:00:00 2001 From: slipher Date: Sun, 5 Jul 2026 01:03:30 -0500 Subject: [PATCH 1/3] scons: remove unused variable 'jail' --- SConstruct | 1 - 1 file changed, 1 deletion(-) diff --git a/SConstruct b/SConstruct index cf2aca4857..ed701169d6 100755 --- a/SConstruct +++ b/SConstruct @@ -2481,7 +2481,6 @@ def which(cmd, paths=os.environ.get('PATH', '').split(os.pathsep)): def SetUpLinuxEnvArm(env): - jail = env.GetToolchainDir(toolchain_name='arm_trusted') if not platform.machine().startswith('arm'): # Allow emulation on non-ARM hosts. env.Replace(EMULATOR='qemu-armhf -L /usr/arm-linux-gnueabihf/ -cpu cortex-a9') From 73bc513b6cd6878b752ffa135449d56adcf1182e Mon Sep 17 00:00:00 2001 From: slipher Date: Sun, 5 Jul 2026 01:06:56 -0500 Subject: [PATCH 2/3] Remove unneeded -ldl from ARM build --- SConstruct | 3 --- 1 file changed, 3 deletions(-) diff --git a/SConstruct b/SConstruct index ed701169d6..e9dd909699 100755 --- a/SConstruct +++ b/SConstruct @@ -2508,9 +2508,6 @@ def SetUpLinuxEnvArm(env): env.Prepend(CCFLAGS=['-march=armv7-a','-mfloat-abi=hard', '-mtune=generic-armv7-a', '-mfpu=neon']) - # get_plugin_dirname.cc has a dependency on dladdr - env.Append(LIBS=['dl']) - def SetUpAndroidEnv(env): env.FilterOut(CPPDEFINES=[['_LARGEFILE64_SOURCE', '1']]) android_ndk_root = os.path.join('${SOURCE_ROOT}', 'third_party', From 2af51fb4f55f06439c9b172b76f6bb85c33ef60e Mon Sep 17 00:00:00 2001 From: slipher Date: Sun, 5 Jul 2026 01:14:37 -0500 Subject: [PATCH 3/3] Use i686-linux-gnu-gcc, not gcc -m32 This (on Debian anyway) does a better job of including the headers for the target system, not the host system. --- SConstruct | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index e9dd909699..c672a25e5a 100755 --- a/SConstruct +++ b/SConstruct @@ -2479,6 +2479,27 @@ def which(cmd, paths=os.environ.get('PATH', '').split(os.pathsep)): return True return False +def SetUpLinuxEnvX86(env): + if env.Bit('built_elsewhere'): + def FakeInstall(dest, source, env): + print('Not installing', dest) + # Replace build commands with no-ops + env.Replace(CC='true', CXX='true', LD='true', + AR='true', RANLIB='true', INSTALL=FakeInstall) + else: + env.Prepend(CCFLAGS=sysroot_flags, + ASFLAGS=[], + ) + if env.Bit('clang'): + # TODO use --target=i386-linux-gnu or whetever? + env.Prepend( + CCFLAGS = ['-m32'] + sysroot_flags, + LINKFLAGS = ['-m32'] + sysroot_flags, + ) + else: + env.Replace(CC='i686-linux-gnu-gcc', + CXX='i686-linux-gnu-g++', + LD='i686-linux-gnu-ld') def SetUpLinuxEnvArm(env): if not platform.machine().startswith('arm'): @@ -2691,10 +2712,7 @@ def MakeGenericLinuxEnv(platform=None): ) if linux_env.Bit('build_x86_32'): - linux_env.Prepend( - CCFLAGS = ['-m32'] + sysroot_flags, - LINKFLAGS = ['-m32'] + sysroot_flags, - ) + SetUpLinuxEnvX86(linux_env) elif linux_env.Bit('build_x86_64'): linux_env.Prepend( CCFLAGS = ['-m64'] + sysroot_flags,