From 87abfad7e284c876435c9ef4d281c4f87476b2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 19 Feb 2018 12:49:31 +0100 Subject: [PATCH] OSX: Remove support for 32-bit and fat binaries Mac OS X is 64-bit only since 10.7 (Lion), which has reached End-Of-Life in October 2014. Therefore it no longer makes sense to support exporting 32-bit binaries for Mac OS X, and we can now default to 64-bit instead of bigger "fat" binaries. (cherry picked from commits f04958cd5d2259cc7b8ca1be75de78cc47e58df2, 42c5af5e48c1e74a53bb773d7068bf61953231a8, 3e6f2b7d9812b952f7af255a05bfb3fba1e1bf23, and 1602e0cdb9b4f41faba330537f97f8ed8f381b80) --- SConstruct | 4 +--- platform/osx/crash_handler_osx.mm | 11 +---------- platform/osx/detect.py | 26 ++++++-------------------- platform/osx/export/export.cpp | 15 --------------- 4 files changed, 8 insertions(+), 48 deletions(-) diff --git a/SConstruct b/SConstruct index da7b5464961..f336680a79b 100644 --- a/SConstruct +++ b/SConstruct @@ -139,7 +139,7 @@ opts = Variables(customs, ARGUMENTS) # Target build options opts.Add('arch', "Platform-dependent architecture (arm/arm64/x86/x64/mips/etc)", '') -opts.Add('bits', "Target platform bits (default/32/64/fat)", 'default') +opts.Add('bits', "Target platform bits (default/32/64)", 'default') opts.Add('p', "Platform (alias for 'platform')", '') opts.Add('platform', "Target platform: any in " + str(platform_list), '') opts.Add('target', "Compilation target (debug/release_debug/release)", 'debug') @@ -347,8 +347,6 @@ if selected_platform in platform_list: suffix += ".32" elif (env["bits"] == "64"): suffix += ".64" - elif (env["bits"] == "fat"): - suffix += ".fat" suffix += env.extra_suffix diff --git a/platform/osx/crash_handler_osx.mm b/platform/osx/crash_handler_osx.mm index 2a05b6a4f28..4a7df6a9116 100644 --- a/platform/osx/crash_handler_osx.mm +++ b/platform/osx/crash_handler_osx.mm @@ -34,7 +34,7 @@ #include #include -#if defined(DEBUG_ENABLED) && defined(__x86_64__) +#if defined(DEBUG_ENABLED) #define CRASH_HANDLER_ENABLED 1 #endif @@ -48,13 +48,8 @@ #include #include -#ifdef __x86_64__ static uint64_t load_address() { const struct segment_command_64 *cmd = getsegbyname("__TEXT"); -#else -static uint32_t load_address() { - const struct segment_command *cmd = getsegbyname("__TEXT"); -#endif char full_path[1024]; uint32_t size = sizeof(full_path); @@ -120,11 +115,7 @@ static void handle_crash(int sig) { args.push_back("-o"); args.push_back(_execpath); args.push_back("-arch"); -#ifdef __x86_64__ args.push_back("x86_64"); -#else - args.push_back("i386"); -#endif args.push_back("-l"); snprintf(str, 1024, "%p", load_addr); args.push_back(str); diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 6b443d89d99..20d313809e8 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -22,7 +22,6 @@ def can_build(): def get_opts(): return [ - ('force_64_bits', 'Force 64 bits binary', 'no'), ('osxcross_sdk', 'OSXCross SDK version', 'darwin14'), ] @@ -38,8 +37,9 @@ def configure(env): env.Append(CPPPATH=['#platform/osx']) - if (env["bits"] == "default"): - env["bits"] = "32" + # Mac OS X no longer runs on 32-bit since 10.7 which is unsupported since 2014 + # As such, we only support 64-bit + env["bits"] = "64" if (env["target"] == "release"): @@ -55,26 +55,12 @@ def configure(env): if ("OSXCROSS_ROOT" not in os.environ): # regular native build - if (env["bits"] == "64"): - env.Append(CCFLAGS=['-arch', 'x86_64']) - env.Append(LINKFLAGS=['-arch', 'x86_64']) - elif (env["bits"] == "32"): - env.Append(CCFLAGS=['-arch', 'i386']) - env.Append(LINKFLAGS=['-arch', 'i386']) - else: - env.Append(CCFLAGS=['-arch', 'i386', '-arch', 'x86_64']) - env.Append(LINKFLAGS=['-arch', 'i386', '-arch', 'x86_64']) + env.Append(CCFLAGS=['-arch', 'x86_64']) + env.Append(LINKFLAGS=['-arch', 'x86_64']) else: # osxcross build root = os.environ.get("OSXCROSS_ROOT", 0) - if env["bits"] == "fat": - basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-" - env.Append(CCFLAGS=['-arch', 'i386', '-arch', 'x86_64']) - env.Append(LINKFLAGS=['-arch', 'i386', '-arch', 'x86_64']) - elif env["bits"] == "32": - basecmd = root + "/target/bin/i386-apple-" + env["osxcross_sdk"] + "-" - else: # 64-bit, default - basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-" + basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-" ccache_path = os.environ.get("CCACHE") if ccache_path == None: diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 3e28a5859d4..808e5b9029b 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -49,12 +49,6 @@ class EditorExportPlatformOSX : public EditorExportPlatform { String custom_release_package; String custom_debug_package; - enum BitsMode { - BITS_FAT, - BITS_64, - BITS_32 - }; - int version_code; String app_name; @@ -67,7 +61,6 @@ class EditorExportPlatformOSX : public EditorExportPlatform { String copyright; String identity; String entitlements; - BitsMode bits_mode; bool high_resolution; Ref logo; @@ -136,8 +129,6 @@ bool EditorExportPlatformOSX::_set(const StringName &p_name, const Variant &p_va version = p_value; else if (n == "application/copyright") copyright = p_value; - else if (n == "application/bits_mode") - bits_mode = BitsMode(int(p_value)); else if (n == "display/high_res") high_resolution = p_value; else if (n == "codesign/identity") @@ -174,8 +165,6 @@ bool EditorExportPlatformOSX::_get(const StringName &p_name, Variant &r_ret) con r_ret = version; else if (n == "application/copyright") r_ret = copyright; - else if (n == "application/bits_mode") - r_ret = bits_mode; else if (n == "display/high_res") r_ret = high_resolution; else if (n == "codesign/identity") @@ -200,7 +189,6 @@ void EditorExportPlatformOSX::_get_property_list(List *p_list) con p_list->push_back(PropertyInfo(Variant::STRING, "application/short_version")); p_list->push_back(PropertyInfo(Variant::STRING, "application/version")); p_list->push_back(PropertyInfo(Variant::STRING, "application/copyright")); - p_list->push_back(PropertyInfo(Variant::INT, "application/bits_mode", PROPERTY_HINT_ENUM, "Fat (32 & 64 bits),64 bits,32 bits")); p_list->push_back(PropertyInfo(Variant::BOOL, "display/high_res")); p_list->push_back(PropertyInfo(Variant::STRING, "codesign/identity")); @@ -400,9 +388,7 @@ Error EditorExportPlatformOSX::export_project(const String &p_path, bool p_debug } String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + "."; - binary_to_use += String(bits_mode == BITS_FAT ? "fat" : bits_mode == BITS_64 ? "64" : "32"); - print_line("binary: " + binary_to_use); String pkg_name; if (app_name != "") pkg_name = app_name; @@ -661,7 +647,6 @@ EditorExportPlatformOSX::EditorExportPlatformOSX() { signature = "godotmacgame"; short_version = "1.0"; version = "1.0"; - bits_mode = BITS_FAT; high_resolution = false; identity = ""; entitlements = "";