Closed Bug 298532 Opened 19 years ago Closed 19 years ago

NSS support for Mac 10.4u ("universal") SDK

Categories

(NSS :: Build, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
3.10.2

People

(Reporter: mark, Assigned: mark)

References

Details

Attachments

(2 files, 1 obsolete file)

NSS companion to bug 298529.  Need to properly interpret SDK version number now
that Apple's broken with tradition and stuck letters in it.

NSS doesn't have the fallback code I wrote of, so the build currently fails in
pathsub.c.
Depends on: 298529
Attached patch Repair Darwin.mk (obsolete) — Splinter Review
This makes nss able to figure out what MacOSX10.4u.sdk is all about by
replacing some of the logic with the same perl used in mozilla's and nspr's
configure.  It also removes the reliance on the hard-coded powerpc word for
obvious reasons.

wtc, not that I'm interested in cross-compiling at the moment, but it seems to
me that nss is already incapable of cross-compilation on Darwin, if only
because of the reliance on OS_TEST.  The introduction of CPU_ARCH_LONG
continues this trend.  If cross is supposed to work, let's figure out something
better now.
Attachment #187095 - Flags: review?(wtchang)
Attachment #187095 - Flags: approval1.8b3?
Attachment #187095 - Flags: review?(cls)
Attachment #187095 - Flags: approval1.8b3?
Comment on attachment 187095 [details] [diff] [review]
Repair Darwin.mk

r=wtc.	A suggestion:

>+CPU_ARCH_LONG	= $(shell uname -p)

It is better to use := instead of = here.  The difference is that
:= only invokes the shell function at the time of definition, but
= invokes the shell function at the time of variable substitution.
If there are multiple instances of $(CPU_ARCH_LONG), we will win by
using := .

I would also move the definition of CPU_ARCH_LONG right above the
following line, to make it clear that it is only used in that line.

>+        DARWIN_TARGET_ARCH_LIB := $(CPU_ARCH_LONG)-apple-darwin$(shell echo $NEXT_ROOT | perl -pe 's/MacOSX10\.([\d]*)//;if ($$1) {$$_=$$1+4;} else {$$_="'${OS_RELEASE}'";s/(\d+)//;$$_=$$1;}')
Attachment #187095 - Flags: review?(wtchang) → review+
OK, we'll go with the suggestion from your comments.  Could you also shed some
light on the cross-compiling question from comment 4?  Thanks.
Status: NEW → ASSIGNED
Attachment #187095 - Flags: review?(cls) → approval1.8b3?
Attachment #187095 - Flags: approval1.8b3?
NSS's coreconf build system supports cross compiling for a different
OS, but it doesn't support cross compiling for a different CPU
architecture.

Mozilla currently cross compiles NSS for a different CPU
architecture using this hack inside mozilla/security/manager/Makefile.in.
http://lxr.mozilla.org/security/source/security/manager/Makefile.in#126

126 ifdef CROSS_COMPILE
127 DEFAULT_GMAKE_FLAGS += \
128         NSINSTALL="$(NSINSTALL)" \
129         NATIVE_CC="$(HOST_CC)" \
130         CC="$(CC)" \
131         CCC="$(CXX)" \
132         LINK="$(LD)" \
133         AS="$(AS)" \
134         AR='$(AR) $(AR_FLAGS:$@=$$@)' \
135         RANLIB="$(RANLIB)" \
136         RC="$(RC) $(RCFLAGS)" \
137         OS_ARCH="$(OS_ARCH)" \
138         CPU_ARCH="$(TARGET_CPU)" \
139         $(NULL)
140 SKIP_CHK=1
141 endif

This hack currently only works for cross compiling for
Linux/ARM on an Linux system.  To extend this hack to Mac OS X,
I believe you need to override CPU_ARCH_LONG or
DARWIN_TARGET_ARCH_LIB.  Alternatively, we can redefine
the existing CPU_ARCH and replace CPU_ARCH_LONG with
CPU_ARCH.
Attachment #187095 - Attachment is obsolete: true
Attachment #187541 - Flags: review?(mark)
Attachment #187541 - Flags: review?(mark)
Attachment #187541 - Flags: review?(cls)
Attachment #187541 - Flags: review+
Attachment #187541 - Flags: review?(cls)
Checked in on trunk and NSS_3_10_BRANCH ~14:20 PDT.  Thanks, wtc.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Mark, we still need to get this patch into the NSS_CLIENT_TAG,
which is used by the Mozilla trunk.  Getting the patch into
the NSS trunk and NSS_3_10_BRANCH is just a prerequisite.
Whoops, forgot - nss.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Mark, NSS should also use -fPIC and export MACOSX_DEPLOYMENT_TARGET.

When building Mozilla, MACOSX_DEPLOYMENT_TARGET is inherited from
Mozilla's environment.  But NSS itself should also export it, at
least for standalone NSS builds.
OK, will implement that here too.
Patch checked into the NSS_CLIENT_TAG for mozilla1.8b3 and aviary1.1a2.
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.10.1
MACOSX_DEPLOYMENT_TARGET needs no special treatment.  Just setting that
variable before making NSS is the only knob the builder needs.

This patch introduces -fPIC to DSO_CFLAGS for Darwin in NSS.
Attachment #187745 - Flags: review?(wtchang)
Attachment #187745 - Flags: review?(wtchang) → review+
Comment on attachment 187745 [details] [diff] [review]
-fPIC for NSS/Darwin

I checked in this patch on the NSS trunk for NSS 3.11.

Checking in Darwin.mk;
/cvsroot/mozilla/security/coreconf/Darwin.mk,v	<--  Darwin.mk
new revision: 1.12; previous revision: 1.11
done

Since -fPIC is the default, there is no hurry to get this into
any release branch or NSS_CLIENT_TAG.
Target Milestone: 3.10.1 → 3.10.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: