aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde2017-08-27 11:10:37 +0200
committerRémi Verschelde2017-08-27 11:11:35 +0200
commita6805f37d30a9ad008bdcd1a3d41ad4be4082ae3 (patch)
tree8be10b519305e6634332e10766fcca3c8af6b689
parentcf80fbc95c47ce023bb85837808fe7f05aaefb31 (diff)
downloadgodot-a6805f37d30a9ad008bdcd1a3d41ad4be4082ae3.tar.gz
godot-a6805f37d30a9ad008bdcd1a3d41ad4be4082ae3.tar.zst
godot-a6805f37d30a9ad008bdcd1a3d41ad4be4082ae3.zip
-rw-r--r--platform/server/detect.py10
-rw-r--r--platform/x11/detect.py10
2 files changed, 20 insertions, 0 deletions
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 28f095674..d95aeb95e 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -40,6 +40,16 @@ def configure(env):
env["CC"] = "clang"
env["CXX"] = "clang++"
env["LD"] = "clang++"
+ elif (os.system("gcc --version > /dev/null 2>&1") == 0): # GCC
+ # Hack to prevent building this branch with GCC 6+, which trigger segfaults due to UB when dereferencing pointers in Object::cast_to
+ # This is fixed in the master branch, for 2.1 we just prevent using too recent GCC versions.
+ import subprocess
+ gcc_major = subprocess.check_output(['gcc', '-dumpversion'])[0].split()[0]
+ if (int(gcc_major) > 5):
+ print("Your configured compiler appears to be GCC %s, which triggers issues in release builds for this version of Godot (fixed in Godot 3.0+)." % gcc_major)
+ print("You can use the Clang compiler instead with the `use_llvm=yes` option, or configure another compiler such as GCC 5 using the CC, CXX and LD flags.")
+ print("Aborting..")
+ sys.exit(255)
is64 = sys.maxsize > 2**32
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index b80819f0f..9e2c9f6e9 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -90,6 +90,16 @@ def configure(env):
env["LD"] = "clang++"
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env.extra_suffix = ".llvm"
+ elif (os.system("gcc --version > /dev/null 2>&1") == 0): # GCC
+ # Hack to prevent building this branch with GCC 6+, which trigger segfaults due to UB when dereferencing pointers in Object::cast_to
+ # This is fixed in the master branch, for 2.1 we just prevent using too recent GCC versions.
+ import subprocess
+ gcc_major = subprocess.check_output(['gcc', '-dumpversion'])[0].split()[0]
+ if (int(gcc_major) > 5):
+ print("Your configured compiler appears to be GCC %s, which triggers issues in release builds for this version of Godot (fixed in Godot 3.0+)." % gcc_major)
+ print("You can use the Clang compiler instead with the `use_llvm=yes` option, or configure another compiler such as GCC 5 using the CC, CXX and LD flags.")
+ print("Aborting..")
+ sys.exit(255)
if (env["use_sanitizer"] == "yes"):
env.Append(CCFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer'])