summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-29 16:43:12 +0200
committerGitHub <noreply@github.com>2019-04-29 16:43:12 +0200
commite583b75f5e217e63bcf1df85232b2033b0ff8b07 (patch)
tree0744c1294205b290072fedfa50a7867c4bd10b72
parent0eaf32bb292c96171ff24e19c7f70ff84fed5d9b (diff)
parentc0fcd55f96a237941ac838fdd38b3ebf2630b107 (diff)
Merge pull request #28448 from Valentactive/fix-linux-recognition-ecutable-builds-clang
Fix builds made with Clang on some Linux distros (the equivalent of #23542 but for Clang)
-rw-r--r--platform/x11/detect.py8
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