Skip to content

Commit

Permalink
BUILD: Restrict -force_cpusubtype_ALL flag to MacOS X PPC
Browse files Browse the repository at this point in the history
This flag isonly needed for PPC build. Furthermore it is no longer
recognized when building with recent Xcode on macOS ARM and causes
a link error.
  • Loading branch information
criezy committed Dec 3, 2024
1 parent faf7437 commit a537445
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3075,9 +3075,14 @@ EOF
add_line_to_config_mk 'MACOSX_64_BITS_ONLY = 1'
fi
fi
if test "$_host_cpu" = "aarch64" ; then
case $_host_cpu in
powerpc*)
add_line_to_config_mk 'MACOSX_PPC = 1'
;;
aarch64)
add_line_to_config_mk 'MACOSX_ARM64 = 1'
fi
;;
esac

# Avoid "file has no symbols" noise from ranlib, if it's new enough
ranlib_version=`$_ranlib -V 2>/dev/null`
Expand Down
6 changes: 5 additions & 1 deletion ports.mk
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,12 @@ endif
# Special target to create a static linked binary for macOS.
# We use -force_cpusubtype_ALL to ensure the binary runs on every
# PowerPC machine.
ifdef MACOSX_PPC
OSX_STATIC_LD_FLAGS = -force_cpusubtype_ALL
endif

scummvm-static: $(DETECT_OBJS) $(OBJS)
+$(LD) $(LDFLAGS) -force_cpusubtype_ALL -o scummvm-static $(PRE_OBJS_FLAGS) $(DETECT_OBJS) $(OBJS) $(POST_OBJS_FLAGS) \
+$(LD) $(LDFLAGS) $(OSX_STATIC_LD_FLAGS) -o scummvm-static $(PRE_OBJS_FLAGS) $(DETECT_OBJS) $(OBJS) $(POST_OBJS_FLAGS) \
-framework CoreMIDI \
$(OSX_STATIC_LIBS) \
$(OSX_ZLIB)
Expand Down

0 comments on commit a537445

Please sign in to comment.