Last Comment Bug 403258 - [10.5] When using an SDK, many configure checks fail
: [10.5] When using an SDK, many configure checks fail
Status: RESOLVED FIXED
: verified1.8.1.12
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: All Mac OS X
: -- normal (vote)
: ---
Assigned To: Mark Mentovai
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-09 14:44 PST by Mark Mentovai
Modified: 2008-01-29 17:34 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Set MACOSX_DEPLOYMENT_TARGET before SDK CFLAGS (3.17 KB, patch)
2007-11-09 14:55 PST, Mark Mentovai
ted: review+
dsicore: approval1.9+
Details | Diff | Splinter Review
1.8 branch version (3.75 KB, patch)
2007-11-09 14:56 PST, Mark Mentovai
ted: review+
dveditz: approval1.8.1.12+
Details | Diff | Splinter Review

Description Mark Mentovai 2007-11-09 14:44:36 PST
Found during bug 403250 investigation:

When building on Mac OS X 10.5 ("Leopard"), many configure checks that should succeed are failing.  We don't use the results of many of these checks, and the build is still able to proceed and succeed, but in some cases, the build behavior winds up being changed on Leopard.

One thing I noticed was this:

checking for -dead_strip option to ld... no

That's not true, ld -dead_strip works on Leopard as well as it did on Tiger.  What's up here?

I took a simple test program, x.c:

int main(int argc, char **argv) {
  return 0;
}

and tried building it with an SDK on Leopard:

mark@leopard bash$ gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk /tmp/x.c -o /tmp/x
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status

/usr/lib/crt1.10.5.o is a new crt1 for Leopard, and exists in /usr/lib and the 10.5 SDK, but does not exist in earlier SDKs.  The compiler now needs to be informed of the deployment target in order to select the proper version of crt1 to include.  Earlier deployment targets use crt1.o.  Setting MACOSX_DEPLOYMENT_TARGET results in a proper compilation:

mark@Crack bash$ MACOSX_DEPLOYMENT_TARGET=10.4 gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk /tmp/x.c -o /tmp/x
(no errors)

We currently set MACOSX_DEPLOYMENT_TARGET for all phases of the build, but there's a window in the configure script between where we set the SDK CFLAGS and where we set (and export) MACOSX_DEPLOYMENT_TARGET.  We need to close this window in the configure script.

This problem does not exist in NSPR's configure script, which exports MACOSX_DEPLOYMENT_TARGET immediately prior to setting the SDK CFLAGS.
Comment 1 Mark Mentovai 2007-11-09 14:55:42 PST
Created attachment 288057 [details] [diff] [review]
Set MACOSX_DEPLOYMENT_TARGET before SDK CFLAGS
Comment 2 Mark Mentovai 2007-11-09 14:56:23 PST
Created attachment 288058 [details] [diff] [review]
1.8 branch version

We'd like to take this patch on the 1.8 branch because that branch is still used for active Camino development, and our developers are moving to Leopard.
Comment 3 Mark Mentovai 2007-11-29 11:11:29 PST
Comment on attachment 288057 [details] [diff] [review]
Set MACOSX_DEPLOYMENT_TARGET before SDK CFLAGS

Needed for Leopard build compatibility.
Comment 4 Mark Mentovai 2007-11-30 12:36:30 PST
Checked in on the trunk.
Comment 5 Daniel Veditz [:dveditz] 2007-12-17 15:59:07 PST
Comment on attachment 288058 [details] [diff] [review]
1.8 branch version

approved for 1.8.1.12, a=dveditz for release-drivers
Comment 6 Mark Mentovai 2007-12-18 13:34:32 PST
Checked in on MOZILLA_1_8_BRANCH for 1.8.1.12.
Comment 7 Smokey Ardisson (offline for a while; not following bugs - do not email) 2008-01-29 17:34:44 PST
Verified on the MOZILLA_1_8_BRANCH by my ability to build 1_8 branch builds on Mac OS X 10.5 without these configure checks failing ;)

Note You need to log in before you can comment on or make changes to this bug.