Fix universal builds on 32-bit CPUs.
This commit is contained in:
parent
54b5a7afbb
commit
7c158e2350
@ -179,6 +179,9 @@ module HomebrewEnvExtension
|
|||||||
append_to_cflags '-arch i386 -arch x86_64'
|
append_to_cflags '-arch i386 -arch x86_64'
|
||||||
ENV.O3 if self['CFLAGS'].include? '-O4' # O4 seems to cause the build to fail
|
ENV.O3 if self['CFLAGS'].include? '-O4' # O4 seems to cause the build to fail
|
||||||
ENV.append 'LDFLAGS', '-arch i386 -arch x86_64'
|
ENV.append 'LDFLAGS', '-arch i386 -arch x86_64'
|
||||||
|
|
||||||
|
# Can't mix "-march" for a 32-bit CPU with "-arch x86_64"
|
||||||
|
remove_from_cflags(/-march=\S*/) if Hardware.is_32_bit?
|
||||||
end
|
end
|
||||||
|
|
||||||
def prepend key, value, separator = ' '
|
def prepend key, value, separator = ' '
|
||||||
|
|||||||
@ -46,6 +46,10 @@ class Hardware
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.is_32_bit?
|
||||||
|
not self.is_64_bit?
|
||||||
|
end
|
||||||
|
|
||||||
def self.is_64_bit?
|
def self.is_64_bit?
|
||||||
self.sysctl_bool("hw.cpu64bit_capable")
|
self.sysctl_bool("hw.cpu64bit_capable")
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user