Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

--universal broken universally #14845

Closed
stuartcarnie opened this issue Sep 10, 2012 · 9 comments
Closed

--universal broken universally #14845

stuartcarnie opened this issue Sep 10, 2012 · 9 comments
Labels

Comments

@stuartcarnie
Copy link
Contributor

I've tested a number of forumlas and none are building universal binaries. Examples:

> brew install lame --universal
...
> file /usr/local/bin/lame
lame: Mach-O 64-bit executable x86_64

If I manually build:

> brew install -i lame
> CFLAGS="-arch i386 -arch x86_64" ./configure && make
...
> file frontend/lame
frontend/lame: Mach-O universal binary with 2 architectures
frontend/lame (for architecture i386):   Mach-O dynamically linked shared library i386
frontend/lame (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64

Another example of failing formula:

> brew install libtool --universal
...
> file /usr/local/lib/libltdl.dylib
libltdl.dylib: Mach-O 64-bit executable x86_64
@jacknagel
Copy link
Contributor

It looks to me like under superenv, the -arch flags are not being propagated to the linker.

Does it work if you build with --env=std?

@stuartcarnie
Copy link
Contributor Author

Appears to be a bug with superenv, as the following command resolves the issue

brew install --env=std lame --universal    

@adamv
Copy link
Contributor

adamv commented Sep 10, 2012

Works with --env=std for me

@stuartcarnie
Copy link
Contributor Author

@jacknagel yes sir – thought the same thing and tried it

@stuartcarnie
Copy link
Contributor Author

BTW: Don't really want to build lame as universal, but it served as a good example…

@jacknagel
Copy link
Contributor

From what I can tell, when the superenv wrapper script is in "ld" mode it doesn't pass any cflags to the real linker, but the arch flags never get added to the ldflags either, so...

I don't know the superenv code well enough to say what needs to be changed, though, so @mxcl will have to fix it.

@stuartcarnie
Copy link
Contributor Author

@jacknagel yes, I saw the same thing; the ENV object didn't have any CFLAGS

@jacknagel
Copy link
Contributor

Well, that's not exactly it; superenv doesn't set any of the standard environment variables, because it wraps all the tools. What I meant was that when the wrapper is invoked as "ld" it doesn't send its internal cflags to the real ld tool.

@mxcl
Copy link
Contributor

mxcl commented Sep 13, 2012

I did build universal support into superenv but (I hate to admit) I didn't test it.

I think the problem is simple enough, the -arch flags are added to the CFLAGS in supercc and when ld is explicitly called CFLAGS are not passed to ld.

@mxcl mxcl closed this as completed in 1b72783 Sep 13, 2012
Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 15, 2012
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants