diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-01-23 07:57:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-23 07:57:02 +0100 |
commit | 05fc26de1cd4b11f9f3351b42fb4c5b7c626856d (patch) | |
tree | c57d0999d9caf33ba4aa42bbb2838d9c28efb8a8 /platform | |
parent | 94d3bcbc9b523a8aae4cc0dd1f1e522c2171900e (diff) | |
parent | 35dd36ca35b87d2931980e837060cc39ec4c32f2 (diff) |
Merge pull request #35444 from RandomShaper/fix_link_bsd
Fix error with linkers other than GNU ld
Diffstat (limited to 'platform')
-rw-r--r-- | platform/x11/detect.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 957779ee83..bd5e5e0812 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -333,11 +333,15 @@ def configure(env): if not env['tools']: import subprocess import re - binutils_version = re.search('\s(\d+\.\d+)', str(subprocess.check_output(['ld', '-v']))).group(1) - if float(binutils_version) >= 2.30: - env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.ld']) + linker_version_str = subprocess.check_output([env.subst(env["LINK"]), '-Wl,--version']).decode("utf-8") + gnu_ld_version = re.search('^GNU ld [^$]*(\d+\.\d+)$', linker_version_str, re.MULTILINE) + if not gnu_ld_version: + print("Warning: Creating template binaries enabled for PCK embedding is currently only supported with GNU ld") else: - env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.legacy.ld']) + if float(gnu_ld_version.group(1)) >= 2.30: + env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.ld']) + else: + env.Append(LINKFLAGS=['-T', 'platform/x11/pck_embed.legacy.ld']) ## Cross-compilation |