From 3d82857b79d301f784bd2896112616a765521193 Mon Sep 17 00:00:00 2001 From: Donovan Watteau Date: Fri, 6 May 2022 20:26:25 +0200 Subject: [PATCH] MACOS: Drop PowerPC static builds workarounds, and suggest dynamic plugins -mlongcall -Os would work until ScummVM 2.2.0, but now the engines are too big to fit in a single static binary on Mac PowerPC. (On ELF platforms, some flags like -Wl,--relax or -Wl,--gc-sections can be used as well, but macOS uses Mach-O, and its old linker doesn't have as many workarounds. -Wl,-dead_strip helped a bit but that's not enough and you start hitting ld internal errors.) So, recommend dynamic plugins on Mac PPC, now, and drop -Os -mlongcall since working around the linker limits is not possible anymore. Using compiler defaults probably means less bugs when using such an obscure toolchain, anyway. (Making a static release it still possible, but only with a very small set of engines.) --- configure | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/configure b/configure index facacd5ae58..ac2706b819a 100755 --- a/configure +++ b/configure @@ -2655,17 +2655,11 @@ case $_host_os in exit 1 ;; darwin*) - # Pass -mlongcall to gcc so that it emits long calls - # which will allow for calls larger than 32MB. The linker - # will discard the calls if they are not needed, but we - # need to ensure the compiler emits them in the first place. - # Also the executable has grown to a size where using -Os is necessary to avoid a - # 'virtual memory exhausted' error when running the executable. case $_host_cpu in powerpc*) - append_var CFLAGS "-mlongcall" - append_var CXXFLAGS "-mlongcall" - _optimization_level=-Os + if test "$_dynamic_modules" = no ; then + echo "WARNING: Building static engines will probably fail at link time on Mac PowerPC" + fi ;; esac