Append a main LD script at the beginning

This commit is contained in:
Ivan Kravets
2018-06-09 14:50:54 +03:00
parent 46c904e67d
commit 00c0eaed8a

View File

@ -108,9 +108,10 @@ def BuildProgram(env):
# build project with dependencies
_build_project_deps(env)
# append specified LD_SCRIPT
if "LDSCRIPT_PATH" in env and not any("-T" in f for f in env['LINKFLAGS']):
env.Append(LINKFLAGS=["-T", "$LDSCRIPT_PATH"])
# append into the beginning a main LD script
if (env.get("LDSCRIPT_PATH")
and not any("-Wl,-T" in f for f in env['LINKFLAGS'])):
env.Prepend(LINKFLAGS=["-T", "$LDSCRIPT_PATH"])
# enable "cyclic reference" for linker
if env.get("LIBS") and env.GetCompilerType() == "gcc":