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)
This commit is contained in:
Rémi Verschelde 2019-04-29 16:43:12 +02:00 committed by GitHub
commit e583b75f5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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