mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Fixed issue with invalid LD script if path contains space
This commit is contained in:
@ -9,6 +9,7 @@ PlatformIO 3.0
|
||||
|
||||
* Don't export ``CPPPATH`` of project dependent libraries to frameworks
|
||||
(`issue #1665 <https://github.com/platformio/platformio-core/issues/1665>`_)
|
||||
* Fixed issue with invalid LD script if path contains space
|
||||
|
||||
3.5.3 (2018-06-01)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
@ -231,14 +231,25 @@ def GetActualLDScript(env):
|
||||
return None
|
||||
|
||||
script = None
|
||||
script_in_next = False
|
||||
for f in env.get("LINKFLAGS", []):
|
||||
if f.startswith("-Wl,-T"):
|
||||
script = env.subst(f[6:].replace('"', "").strip())
|
||||
if isfile(script):
|
||||
return script
|
||||
path = _lookup_in_ldpath(script)
|
||||
if path:
|
||||
return path
|
||||
raw_script = None
|
||||
if f == "-T":
|
||||
script_in_next = True
|
||||
continue
|
||||
elif script_in_next:
|
||||
script_in_next = False
|
||||
raw_script = f
|
||||
elif f.startswith("-Wl,-T"):
|
||||
raw_script = f[6:]
|
||||
else:
|
||||
continue
|
||||
script = env.subst(raw_script.replace('"', "").strip())
|
||||
if isfile(script):
|
||||
return script
|
||||
path = _lookup_in_ldpath(script)
|
||||
if path:
|
||||
return path
|
||||
|
||||
if script:
|
||||
sys.stderr.write(
|
||||
|
@ -109,9 +109,8 @@ def BuildProgram(env):
|
||||
_build_project_deps(env)
|
||||
|
||||
# append specified LD_SCRIPT
|
||||
if ("LDSCRIPT_PATH" in env
|
||||
and not any("-Wl,-T" in f for f in env['LINKFLAGS'])):
|
||||
env.Append(LINKFLAGS=['-Wl,-T"$LDSCRIPT_PATH"'])
|
||||
if "LDSCRIPT_PATH" in env and not any("-T" in f for f in env['LINKFLAGS']):
|
||||
env.Append(LINKFLAGS=["-T", "$LDSCRIPT_PATH"])
|
||||
|
||||
# enable "cyclic reference" for linker
|
||||
if env.get("LIBS") and env.GetCompilerType() == "gcc":
|
||||
|
Reference in New Issue
Block a user