Opened 12 years ago

Closed 12 years ago

#1072 closed defect (wontfix)

SpiderMonkey does not compile on Mac OS Lion - patch attached

Reported by: pbernery Owned by:
Priority: Should Have Milestone:
Component: Build & Packages Keywords:
Cc: Patch:

Description

While update_workspaces was running, I got this error while it was configuring build for SpiderMonkey:

configure: error: installation or configuration problem: C compiler cannot create executables.
ERROR: SpiderMonkey build failed

I was on the SpiderMonkey Mozilla build web page that it can be compiled on Mac OS with some tricks on the command line. I updated the build.sh file for that. It compiles.

You can find attached to this ticket the patch to apply on build.sh to make it work on Mac OS Lion.

Attachments (1)

fix_spidermonkey_build.patch (524 bytes ) - added by pbernery 12 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by historic_bruno, 12 years ago

But it does compile on Lion, I know because I've done it :) I think what you're doing is forcing a work around of some other problem on your system, forcing it to use gcc and g++ explicitly instead of gcc-4.2 and g++-4.2 or whatever configure has detected. From what I've seen this an Xcode install problem and/or a result of upgrading to Lion if applicable. Do /usr/bin/gcc-4.2 and /usr/bin/g++-4.2 exist on your system?

The instructions on your link are actually for building 64-bit libraries on a 32-bit system, in that case you do need some command line options. Generally, I think we should let the system detect 32- or 64-bit automatically as appropriate.

in reply to:  1 comment:2 by pbernery, 12 years ago

Replying to historic_bruno:

Do /usr/bin/gcc-4.2 and /usr/bin/g++-4.2 exist on your system?

No they don't. It may be the problem. My Mac OS is quite a fresh install: I reinstalled it 2 weeks ago and about developer tools I only installed Xcode and some ports with MacPorts.

The instructions on your link are actually for building 64-bit libraries on a 32-bit system, in that case you do need some command line options. Generally, I think we should let the system detect 32- or 64-bit automatically as appropriate.

I think you're right, I did not test without these options.

by pbernery, 12 years ago

comment:3 by pbernery, 12 years ago

I updated the patch file to only get useful change (the compiler choice force to 'gcc') but I understand the problem may more be in the configure script of SpiderMonkey.

comment:4 by historic_bruno, 12 years ago

Component: Non-game systemsBuild system

comment:5 by historic_bruno, 12 years ago

The question then is why gcc-4.2 is set up properly on my Lion test system, or at least the way configure expects, but not on yours. I don't remember doing anything to make it work. Maybe the Xcode 4 installer has changed since I used it?

comment:6 by historic_bruno, 12 years ago

Actually you say "reinstalled" so maybe it wasn't a clean reinstall, but left some fragments behind that confused the new installation. Mine is still the original first install of Xcode.

in reply to:  6 comment:7 by pbernery, 12 years ago

Replying to historic_bruno:

Actually you say "reinstalled" so maybe it wasn't a clean reinstall, but left some fragments behind that confused the new installation. Mine is still the original first install of Xcode.

I meant fresh reinstall, I erased everything on my HD before installing Mac OS X and tools. I also guess installer may have changed, especially since LLVM is used by default by Xcode.

comment:8 by historic_bruno, 12 years ago

By the way, just to update this ticket: the "problem" lies with Xcode 4.2. Apple in their infinite wisdom decided to stop installing GCC with Xcode 4.2, while it worked perfectly for Xcode 4.1 and earlier. I believe the files are still there in the SDKs, they simply aren't installed in the PATH where you can use them and you can't select them in Xcode either. Further, if you upgrade from 4.1 to 4.2, GCC will still be installed, so it's only fresh installs of 4.2+ that cause the problem. (FYI I'm using 4.1)

I guess we should play it safe and set the CC and CXX variables on OS X, since most developers will now be using Xcode 4.2 or later and we can't guarantee it's not a fresh install. (Here's what Mozilla has to say in their Mac OS X Build Prerequisites - I don't think their advice is quite correct, but haven't yet tested.)

Sometime I'll try a clean install of Xcode 4.2+ and try to get it working in a way that also works for Xcode 4.1 and earlier, unless someone else beats me to it :)

in reply to:  8 comment:9 by historic_bruno, 12 years ago

Replying to historic_bruno:

I guess we should play it safe and set the CC and CXX variables on OS X, since most developers will now be using Xcode 4.2 or later and we can't guarantee it's not a fresh install.

I do this in the latest version of the OS X build script (WIP), which works with every combination of Xcode+command line tools I've tested.

comment:10 by historic_bruno, 12 years ago

Milestone: Backlog
Resolution: wontfix
Status: newclosed

The workaround has been mentioned in the BuildInstructions and that's good enough for now, until #1112 is implemented. Really it's something that should be fixed in Spidermonkey's config script.

Note: See TracTickets for help on using tickets.