Skip to content

Commit 83ec0d8

Browse files
committed
Don't use --sysroot flag by default
For Linux toolchains (except x86-64 where I previously commented it out), there were hard-coded sysroot flags referring to the paths of Chromium's bundled dependencies. Get rid of this. On my machine the cross toolchains work fine without it. But I added a a 'sysroot' command line argument, so if anyone needs it they can pass sysroot=... on the scons command line to configure a --sysroot flag.
1 parent 6869808 commit 83ec0d8

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

SConstruct

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ ACCEPTABLE_ARGUMENTS = set([
203203
# FEATURE_VERSION file. This is used for PNaCl ABI compatibility
204204
# testing.
205205
'toolchain_feature_version',
206+
'sysroot',
206207
])
207208

208209

@@ -495,6 +496,9 @@ if breakpad_tools_dir is not None:
495496
pre_base_env['BREAKPAD_TOOLS_DIR'] = pre_base_env.Dir(
496497
os.path.abspath(breakpad_tools_dir))
497498

499+
sysroot_flags = []
500+
if ARGUMENTS.get('sysroot') is not None:
501+
sysroot_flags.append('--sysroot=' + os.path.abspath(ARGUMENTS.get('sysroot')))
498502

499503
# CLANG
500504
DeclareBit('clang', 'Use clang to build trusted code')
@@ -2488,16 +2492,13 @@ def SetUpLinuxEnvArm(env):
24882492
env.Replace(CC='true', CXX='true', LD='true',
24892493
AR='true', RANLIB='true', INSTALL=FakeInstall)
24902494
else:
2491-
sysroot=os.path.join(
2492-
'${SOURCE_ROOT}/build/linux/debian_bullseye_arm-sysroot')
2493-
env.Prepend(CCFLAGS=['--sysroot='+sysroot],
2495+
env.Prepend(CCFLAGS=sysroot_flags,
24942496
ASFLAGS=[],
24952497
# The -rpath-link argument is needed on Ubuntu/Precise to
24962498
# avoid linker warnings about missing ld.linux.so.3.
24972499
# TODO(sbc): remove this once we stop supporting Precise
24982500
# as a build environment.
2499-
LINKFLAGS=['-fuse-ld=lld',
2500-
'--sysroot='+sysroot]
2501+
LINKFLAGS=['-fuse-ld=lld'] + sysroot_flags
25012502
)
25022503
# Note we let the compiler choose whether it's -marm or -mthumb by
25032504
# default. The hope is this will have the best chance of testing
@@ -2699,18 +2700,14 @@ def MakeGenericLinuxEnv(platform=None):
26992700
)
27002701

27012702
if linux_env.Bit('build_x86_32'):
2702-
sysroot=os.path.join(
2703-
'${SOURCE_ROOT}/build/linux/debian_bullseye_i386-sysroot')
27042703
linux_env.Prepend(
2705-
CCFLAGS = ['-m32', '--sysroot='+sysroot],
2706-
LINKFLAGS = ['-m32', '--sysroot='+sysroot],
2704+
CCFLAGS = ['-m32'] + sysroot_flags,
2705+
LINKFLAGS = ['-m32'] + sysroot_flags,
27072706
)
27082707
elif linux_env.Bit('build_x86_64'):
2709-
sysroot=os.path.join(
2710-
'${SOURCE_ROOT}/build/linux/debian_bullseye_amd64-sysroot')
27112708
linux_env.Prepend(
2712-
CCFLAGS = ['-m64'],#, '--sysroot='+sysroot],
2713-
LINKFLAGS = ['-m64']#, '--sysroot='+sysroot],
2709+
CCFLAGS = ['-m64'] + sysroot_flags,
2710+
LINKFLAGS = ['-m64'] + sysroot_flags,
27142711
)
27152712
elif linux_env.Bit('build_arm'):
27162713
SetUpLinuxEnvArm(linux_env)

0 commit comments

Comments
 (0)