Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

4 participants

@samueljohn

Superenv normally filters out "-m32" flag, preventing 32bit builds.
Some software, however, still only work in 32bit mode. I am looking at you, smlnj.

With this change, If ENV.m32 is called, superenv does not filter out the "-m32" flag as it would usually.
Also note, superenv, does not explicitly add the -m32 flag, nor any "-arch" flags but
expects the build system of the software to know when and where to provide this flag.

I would need this behavior to ready my upcomping changes of smlnj. Superenv really shines there, because I don't need to patch smlnj in hundred ways to build with Xcode but it just works (except that smlnj is only 32bit).

@samueljohn

@mxcl, what do you think? Would this be acceptable?

@mikemcquaid
Owner

Seems relatively reasonable to me.

@samueljohn samueljohn referenced this pull request in Homebrew/homebrew-science
Closed

New Formula: rml-mmc #22

@samueljohn

friendly ping to @mxcl.

@Sharpie
Collaborator

Seems reasonable as well. However, I think the original intent was to catch misbehaving build systems that try to pass -m32 when they really shouldn't. So, we may need to find a way to allow -m32 if and only if the formula actually called ENV.m32.

@Sharpie
Collaborator

Oh, never mind. I see what is happening with HOMEBREW_CCCFG now. That variable really needs more commentary and documentation.

@samueljohn

It took me some time to understand the HOMEBREW_CCCFG logic. It's the way @mxcl passes the configuration to the wrapper scripts, so I thought adding the "allow m32" there is the way to go. The cccfg? checks that variable, if a certain letter/word is contained. I am not sure if "3" is the best naming here, but using the longer allow_m32 is bad because no word splitting is done and cccfg? 'w' would also return true.

@samueljohn samueljohn 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.
58780d9
@samueljohn

ping

@adamv

I don't get this line

Superenv is run in a separate process, so Max uses this ENV var to pass configuration settings.
The config is a string and single letters are used as flags (Please have a look at the cccfg? function in the Library/ENV/4.3/cc file.
I am open to suggestions. "3" stands for 32bit.

@adamv
Owner

Ok; would like to hear Max's input first, but probably going to pull this and "fix it later" if there are any negative consequences.

@samueljohn

I am also eager to hear Max's stance on the one-letter thing here.

@adamv adamv closed this pull request from a commit
@samueljohn samueljohn 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>
b5905e1
@adamv adamv closed this in b5905e1
@norioxkimura norioxkimura referenced this pull request from a commit in norioxkimura/homebrew
@samueljohn samueljohn 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>
4a24902
@fgeller fgeller referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@cooljeanius cooljeanius referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Sharpie Sharpie referenced this pull request from a commit in Sharpie/homebrew
@samueljohn samueljohn 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>
0c252c2
@rajeeja rajeeja referenced this pull request from a commit
@samueljohn samueljohn 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>
6f8f6e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 11, 2013
  1. @samueljohn

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

    samueljohn authored
    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.
This page is out of date. Refresh to see the latest.
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 }
Something went wrong with that request. Please try again.