summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbenjamin reed <bcr33d@gmail.com>2019-07-26 05:36:16 (GMT)
committerbenjamin reed <bcr33d@gmail.com>2019-07-26 05:43:36 (GMT)
commitb4b861514b5a3c431e81d926333d6984499d0b20 (patch)
tree76343f97d053f23e0416034ed5eba1ba8173e478 /src
parent1d146c46d99cd8f0acad622e3b0665d184aea976 (diff)
downloadSCons-b4b861514b5a3c431e81d926333d6984499d0b20.zip
SCons-b4b861514b5a3c431e81d926333d6984499d0b20.tar.gz
SCons-b4b861514b5a3c431e81d926333d6984499d0b20.tar.bz2
add -fmerge-all-constants flag to LINKFLAGS
-fmerge-all-constants doesn't fully work if it isn't also included as part of the link step. This change will add -fmerge-all-constants to both CCFLAGS and LINKFLAGS if it is specified as a build flag.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/CHANGES.txt3
-rw-r--r--src/engine/SCons/Environment.py1
-rw-r--r--src/engine/SCons/EnvironmentTests.py6
3 files changed, 8 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index b5b6652..85eb872 100755
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -10,6 +10,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Whatever John Doe did.
+ From Ben Reed:
+ - Added -fmerge-all-constants to flags that get included in both CCFLAGS and LINKFLAGS.
+
RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 8d06af7..5faa2d0 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -783,6 +783,7 @@ class SubstitutionEnvironment(object):
elif arg in ['-mno-cygwin',
'-pthread',
'-openmp',
+ '-fmerge-all-constants',
'-fopenmp']:
dict['CCFLAGS'].append(arg)
dict['LINKFLAGS'].append(arg)
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index 834cfd1..2e5f02a 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -797,6 +797,7 @@ sys.exit(0)
"-F fwd3 " + \
"-dylib_file foo-dylib " + \
"-pthread " + \
+ "-fmerge-all-constants " +\
"-fopenmp " + \
"-mno-cygwin -mwindows " + \
"-arch i386 -isysroot /tmp " + \
@@ -811,7 +812,8 @@ sys.exit(0)
assert d['ASFLAGS'] == ['-as'], d['ASFLAGS']
assert d['CFLAGS'] == ['-std=c99']
assert d['CCFLAGS'] == ['-X', '-Wa,-as',
- '-pthread', '-fopenmp', '-mno-cygwin',
+ '-pthread', '-fmerge-all-constants',
+ '-fopenmp', '-mno-cygwin',
('-arch', 'i386'), ('-isysroot', '/tmp'),
('-iquote', '/usr/include/foo1'),
('-isystem', '/usr/include/foo2'),
@@ -832,7 +834,7 @@ sys.exit(0)
assert LIBS == ['xxx', 'yyy', 'ascend'], (d['LIBS'], LIBS)
assert d['LINKFLAGS'] == ['-Wl,-link',
'-dylib_file', 'foo-dylib',
- '-pthread', '-fopenmp',
+ '-pthread', '-fmerge-all-constants', '-fopenmp',
'-mno-cygwin', '-mwindows',
('-arch', 'i386'),
('-isysroot', '/tmp'),