diff options
author | Michele Valente <valentactive@gmail.com> | 2019-04-26 15:48:10 +0200 |
---|---|---|
committer | Michele Valente <valentactive@gmail.com> | 2019-04-26 15:50:06 +0200 |
commit | c0fcd55f96a237941ac838fdd38b3ebf2630b107 (patch) | |
tree | 4859c5158a64de0048836dc2feba15dc1ba31e61 | |
parent | 260530f01caa8ea3e2fb7bfda04f4bd718ae14f5 (diff) |
fix builds made with Clang on some Linux distros
This is the same as #23542 (Fix binaries incorrectly detected as shared
libraries on some linux distros) but for Clang. It should be fine with
Clang 4 or higher.
-rw-r--r-- | platform/x11/detect.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 91639a0db2..f8ae5e9acb 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -1,7 +1,7 @@ import os import platform import sys -from methods import get_compiler_version, using_gcc +from methods import get_compiler_version, using_gcc, using_clang def is_active(): @@ -184,6 +184,12 @@ def configure(env): if version != None and version[0] >= '6': env.Append(CCFLAGS=['-fpie']) env.Append(LINKFLAGS=['-no-pie']) + # Do the same for clang should be fine with Clang 4 and higher + if using_clang(env): + version = get_compiler_version(env) + if version != None and version[0] >= '4': + env.Append(CCFLAGS=['-fpie']) + env.Append(LINKFLAGS=['-no-pie']) ## Dependencies |