diff --git a/SConstruct b/SConstruct index a151b446e9..18d24bcfd6 100755 --- a/SConstruct +++ b/SConstruct @@ -248,8 +248,8 @@ global_vars.AddVariables( ('CXX', 'C++ compiler', environ.get('CXX', main['CXX'])), ('CCFLAGS_EXTRA', 'Extra C and C++ compiler flags', ''), ('GEM5PY_CCFLAGS_EXTRA', 'Extra C and C++ gem5py compiler flags', ''), - ('GEM5PY_LDFLAGS_EXTRA', 'Extra marshal gem5py flags', ''), - ('LDFLAGS_EXTRA', 'Extra linker flags', ''), + ('GEM5PY_LINKFLAGS_EXTRA', 'Extra marshal gem5py flags', ''), + ('LINKFLAGS_EXTRA', 'Extra linker flags', ''), ('PYTHON_CONFIG', 'Python config binary to use', [ 'python3-config', 'python-config'] ), @@ -304,7 +304,7 @@ main.Prepend(CPPPATH=Dir('include')) # Initialize the Link-Time Optimization (LTO) flags main['LTO_CCFLAGS'] = [] -main['LTO_LDFLAGS'] = [] +main['LTO_LINKFLAGS'] = [] # According to the readme, tcmalloc works best if the compiler doesn't # assume that we're using the builtin malloc and friends. These flags @@ -386,7 +386,7 @@ if main['GCC']: warning('"make" not found, link time optimization will be ' 'single threaded.') - for var in 'LTO_CCFLAGS', 'LTO_LDFLAGS': + for var in 'LTO_CCFLAGS', 'LTO_LINKFLAGS': # Use the same amount of jobs for LTO as we are running scons with. main[var] = ['-flto%s' % parallelism] @@ -400,7 +400,7 @@ elif main['CLANG']: # Set the Link-Time Optimization (LTO) flags if enabled. if GetOption('with_lto'): - for var in 'LTO_CCFLAGS', 'LTO_LDFLAGS': + for var in 'LTO_CCFLAGS', 'LTO_LINKFLAGS': main[var] = ['-flto'] # clang has a few additional warnings that we disable. @@ -537,7 +537,7 @@ gem5py_env = main.Clone() # Bare minimum environment that only includes python gem5py_env.Append(CCFLAGS=['${GEM5PY_CCFLAGS_EXTRA}']) -gem5py_env.Append(LINKFLAGS=['${GEM5PY_LDFLAGS_EXTRA}']) +gem5py_env.Append(LINKFLAGS=['${GEM5PY_LINKFLAGS_EXTRA}']) main['HAVE_PKG_CONFIG'] = main.Detect('pkg-config') @@ -709,7 +709,7 @@ Build variables for {dir}: sticky_vars.Save(current_vars_file, env) env.Append(CCFLAGS='$CCFLAGS_EXTRA') - env.Append(LINKFLAGS='$LDFLAGS_EXTRA') + env.Append(LINKFLAGS='$LINKFLAGS_EXTRA') exports=['env', 'gem5py_env'] diff --git a/src/SConscript b/src/SConscript index 67f90c8288..25ac888cf1 100644 --- a/src/SConscript +++ b/src/SConscript @@ -830,10 +830,10 @@ envs = { envs['debug'].Append(CPPDEFINES=['DEBUG', 'TRACING_ON=1']) envs['opt'].Append(CCFLAGS=['-g'], CPPDEFINES=['TRACING_ON=1']) envs['fast'].Append(CPPDEFINES=['NDEBUG', 'TRACING_ON=0']) -envs['prof'].Append(CCFLAGS=['-g', '-pg'], LDFLAGS=['-pg'], +envs['prof'].Append(CCFLAGS=['-g', '-pg'], LINKFLAGS=['-pg'], CPPDEFINES=['NDEBUG', 'TRACING_ON=0']) envs['perf'].Append(CCFLAGS=['-g'], CPPDEFINES=['NDEBUG', 'TRACING_ON=0'], - LDFLAGS=['-Wl,--no-as-needed', '-lprofiler', '-Wl,--as-needed']) + LINKFLAGS=['-Wl,--no-as-needed', '-lprofiler', '-Wl,--as-needed']) # For Link Time Optimization, the optimisation flags used to compile # individual files are decoupled from those used at link time @@ -844,13 +844,13 @@ if env['GCC']: envs['debug'].Append(CCFLAGS=['-gstabs+']) else: envs['debug'].Append(CCFLAGS=['-ggdb3']) - envs['debug'].Append(LDFLAGS=['-O0']) + envs['debug'].Append(LINKFLAGS=['-O0']) # opt, fast, prof and perf all share the same cc flags, also add - # the optimization to the ldflags as LTO defers the optimization + # the optimization to the linkflags as LTO defers the optimization # to link time for target in ['opt', 'fast', 'prof', 'perf']: envs[target].Append(CCFLAGS=['-O3', '${LTO_CCFLAGS}']) - envs[target].Append(LDFLAGS=['-O3', '${LTO_LDFLAGS}']) + envs[target].Append(LINKFLAGS=['-O3', '${LTO_LINKFLAGS}']) elif env['CLANG']: envs['debug'].Append(CCFLAGS=['-g', '-O0'])