Browse files

superenv: Allow ENV.m32 (for 32bit builds)

Superenv normally filters out "-m32" flag, preventing 32bit builds.
Some software, however, still only work in 32bit mode.

If ENV.m32 is called, superenv does not filter out the "-m32" flag.
Also note, superenv, does not explicitly add the -m32 flag and
expects the build system of the software to know when and where to
provide this flag.

Closes #16350.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
1 parent bebd439 commit 4a24902cfd53ea2feaf135303b2350629c0b16c6 @samueljohn samueljohn committed with Dec 1, 2012
Showing with 10 additions and 2 deletions.
  1. +4 −1 Library/ENV/4.3/cc
  2. +6 −1 Library/Homebrew/superenv.rb
View
5 Library/ENV/4.3/cc
@@ -101,8 +101,11 @@ class Cmd
case arg = whittler.next
when '-arch', /^-Xarch_/
whittler.next
+ when '-m32'
+ # If ENV.m32 was set, we allow the "-m32" flag, but we don't add anything
+ args << '-m32' if cccfg? '3'
when /^-g\d?/, /^-gstabs\d+/, '-gstabs+', /^-ggdb\d?/, '-gdwarf-2',
- /^-march=.+/, /^-mtune=.+/, '-m64', '-m32',
+ /^-march=.+/, /^-mtune=.+/, '-m64',
/^-O[0-9zs]?$/, '-fast',
'-pedantic', '-pedantic-errors'
when '-fopenmp', '-lgomp'
View
7 Library/Homebrew/superenv.rb
@@ -68,6 +68,11 @@ def universal_binary
append 'HOMEBREW_CCCFG', "u", ''
end
+ # m32 on superenv does not add any flags. It prevents "-m32" from being erased.
+ def m32
+ append 'HOMEBREW_CCCFG', "3", ''
+ end
+
private
def determine_cc
@@ -205,7 +210,7 @@ def brewed_python?
### NO LONGER NECESSARY OR NO LONGER SUPPORTED
def noop(*args); end
- %w[m64 m32 gcc_4_0_1 fast O4 O3 O2 Os Og O1 libxml2 minimal_optimization
+ %w[m64 gcc_4_0_1 fast O4 O3 O2 Os Og O1 libxml2 minimal_optimization
no_optimization enable_warnings x11
set_cpu_flags
macosxsdk remove_macosxsdk].each{|s| alias_method s, :noop }

0 comments on commit 4a24902

Please sign in to comment.