Skip to content

Commit db771cd

Browse files
committed
(maint) support building pdk and bolt runtimes on osx arm64
1 parent 20d6c03 commit db771cd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

configs/projects/bolt-runtime.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,17 @@
8585
end
8686

8787
if platform.is_macos?
88-
# For OS X, we should optimize for an older architecture than Apple
88+
proj.setting(:cppflags, "-I#{proj.includedir}")
89+
proj.setting(:cflags, proj.cppflags.to_s)
90+
91+
# For OS X, we should optimize for an older x86 architecture than Apple
8992
# currently ships for; there's a lot of older xeon chips based on
9093
# that architecture still in use throughout the Mac ecosystem.
9194
# Additionally, OS X doesn't use RPATH for linking. We shouldn't
9295
# define it or try to force it in the linker, because this might
9396
# break gcc or clang if they try to use the RPATH values we forced.
94-
proj.setting(:cppflags, "-I#{proj.includedir}")
95-
proj.setting(:cflags, "-march=core2 -msse4 #{proj.cppflags}")
97+
proj.setting(:cflags, "-march=core2 -msse4 #{proj.cflags}") unless platform.architecture == 'arm64'
98+
9699
proj.setting(:ldflags, "-L#{proj.libdir} ")
97100
end
98101

configs/projects/pdk-runtime.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,12 @@
128128
proj.setting(:ldflags, "-L#{proj.tools_root}/lib -L#{proj.gcc_root}/lib -L#{proj.libdir}")
129129
elsif platform.is_macos?
130130
proj.setting(:cppflags, "-I#{proj.includedir}")
131+
proj.setting(:cflags, "#{proj.cppflags}")
131132

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

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

0 commit comments

Comments
 (0)