Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) support building pdk and bolt runtimes on osx arm64 #768

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions configs/projects/bolt-runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,17 @@
end

if platform.is_macos?
# For OS X, we should optimize for an older architecture than Apple
proj.setting(:cppflags, "-I#{proj.includedir}")
proj.setting(:cflags, proj.cppflags.to_s)

# For OS X, we should optimize for an older x86 architecture than Apple
# currently ships for; there's a lot of older xeon chips based on
# that architecture still in use throughout the Mac ecosystem.
# Additionally, OS X doesn't use RPATH for linking. We shouldn't
# define it or try to force it in the linker, because this might
# break gcc or clang if they try to use the RPATH values we forced.
proj.setting(:cppflags, "-I#{proj.includedir}")
proj.setting(:cflags, "-march=core2 -msse4 #{proj.cppflags}")
proj.setting(:cflags, "-march=core2 -msse4 #{proj.cflags}") unless platform.architecture == 'arm64'

proj.setting(:ldflags, "-L#{proj.libdir} ")
end

Expand Down
3 changes: 2 additions & 1 deletion configs/projects/pdk-runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@
proj.setting(:ldflags, "-L#{proj.tools_root}/lib -L#{proj.gcc_root}/lib -L#{proj.libdir}")
elsif platform.is_macos?
proj.setting(:cppflags, "-I#{proj.includedir}")
proj.setting(:cflags, "#{proj.cppflags}")

# Since we are cross-compiling for later use, we can only optimize for
# the oldest supported platform and even up to macOS 10.13 there are
# a few Core 2 hardware platforms supported. (4 May 2018)
proj.setting(:cflags, "-march=core2 -msse4 #{proj.cppflags}")
proj.setting(:cflags, "-march=core2 -msse4 #{proj.cflags}") unless platform.architecture == 'arm64'

# OS X doesn't use RPATH for linking. We shouldn't
# define it or try to force it in the linker, because this might
Expand Down
Loading