[10.5] When using an SDK, many configure checks fail

RESOLVED FIXED

Status

()

Core
Build Config
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: Mark Mentovai, Assigned: Mark Mentovai)

Tracking

({verified1.8.1.12})

Trunk
All
Mac OS X
verified1.8.1.12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

10 years ago
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.
(Assignee)

Comment 1

10 years ago
Created attachment 288057 [details] [diff] [review]
Set MACOSX_DEPLOYMENT_TARGET before SDK CFLAGS
Assignee: nobody → mark
Status: NEW → ASSIGNED
Attachment #288057 - Flags: review?(ted.mielczarek)
(Assignee)

Comment 2

10 years ago
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.
Attachment #288058 - Flags: review?(ted.mielczarek)
Attachment #288058 - Flags: approval1.8.1.10?
Attachment #288058 - Flags: approval1.8.1.10? → approval1.8.1.11?
Attachment #288057 - Flags: review?(ted.mielczarek) → review+
Attachment #288058 - Flags: review?(ted.mielczarek) → review+
(Assignee)

Comment 3

10 years ago
Comment on attachment 288057 [details] [diff] [review]
Set MACOSX_DEPLOYMENT_TARGET before SDK CFLAGS

Needed for Leopard build compatibility.
Attachment #288057 - Flags: approval1.9?

Updated

10 years ago
Attachment #288057 - Flags: approval1.9? → approval1.9+
(Assignee)

Comment 4

10 years ago
Checked in on the trunk.
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Comment on attachment 288058 [details] [diff] [review]
1.8 branch version

approved for 1.8.1.12, a=dveditz for release-drivers
Attachment #288058 - Flags: approval1.8.1.12? → approval1.8.1.12+
(Assignee)

Comment 6

10 years ago
Checked in on MOZILLA_1_8_BRANCH for 1.8.1.12.
Keywords: fixed1.8.1.12
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 ;)
Keywords: fixed1.8.1.12 → verified1.8.1.12
You need to log in before you can comment on or make changes to this bug.