Skip to content

fix: x86_64 architecture detection for macOS in Bootstrap.sh#2640

Merged
nickclark2016 merged 1 commit intopremake:masterfrom
mercury233:patch-osx-x64
Mar 13, 2026
Merged

fix: x86_64 architecture detection for macOS in Bootstrap.sh#2640
nickclark2016 merged 1 commit intopremake:masterfrom
mercury233:patch-osx-x64

Conversation

@mercury233
Copy link
Contributor

What does this PR do?

The section in Bootstrap.sh that automatically detects the macOS architecture only checks for arm64 and does not check for x86_64. As a result, when PLATFORM is not specified on Intel-based Macs, the script falls back to the default x86 defined in Bootstrap.mak. However, with the toolchains commonly used on macOS today, x86 can no longer be compiled successfully.

How does this PR change Premake's behavior?

This change modifies the script’s behavior when PLATFORM is not specified so that it correctly recognizes x64.

Anything else we should know?

The error message reported when x86 compilation fails is not very intuitive.

warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: bin/Release/libluashim-lib.a will be fat and ar(1) will not be able to operate on it

ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)
ld: dynamic executables or dylibs must link with libSystem.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../bin/release/example.so] Error 1

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

@nickclark2016 nickclark2016 merged commit 9ca696c into premake:master Mar 13, 2026
53 checks passed
@mercury233 mercury233 deleted the patch-osx-x64 branch March 14, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants