If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Export IMPORT_LIB_SUFFIX to the NSS makefiles

RESOLVED INCOMPLETE

Status

()

Core
Security: PSM
RESOLVED INCOMPLETE
9 years ago
a year ago

People

(Reporter: Bo Yang, Unassigned, NeedInfo)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

9 years ago
Created attachment 326856 [details] [diff] [review]
A Proposed patch

In security/coreconf/WIN32.mk, IMPORT_LIB_SUFFIX is assigned to .a if it is not defined. But when cross compile, the IMPORT_LIB_SUFFIX is assigned to dll.a from the topmost config/autoconf.mk. 
And this difference incurs some errors when install the NSS related import libs. The makefile at security/manager/Makefile search libnss3.dll.a to install, but the security system only provide libnss3.a. 
This little patch export the IMPORT_LIB_SUFFIX from the top-level makefile to the NSS ones to fix the problem.
Attachment #326856 - Flags: review?(neil.williams)

Comment 1

9 years ago
Per bug 134113#301, we intentionally use the standard win32 naming convention for NSS mingw builds.

Comment 2

9 years ago
Created attachment 326978 [details] [diff] [review]
special case mingw

I haven't investigated the impact of the previous patch but this is what I was using in my test build from last week.

( bug 134113 comment 301 ? Maybe that will get hyperlinked correctly. )
(Reporter)

Comment 3

9 years ago
(In reply to comment #2)
> Created an attachment (id=326978) [details]
> special case mingw
> 
> I haven't investigated the impact of the previous patch but this is what I was
> using in my test build from last week.
> 
> ( bug 134113 comment 301 ? Maybe that will get hyperlinked correctly. )

IMPORT_LIB_SUFFIX is determined by the configure, and I think export it from the top-level config/autoconf.mk to the NSS makefiles is correct. 
And I find there is no IMPORT_LIB_SUFFIX except WINDOWS build, so I think there should be no side-impact. 
(Reporter)

Comment 4

9 years ago
Comment on attachment 326856 [details] [diff] [review]
A Proposed patch

Maybe neil is not here...
Attachment #326856 - Flags: review?(neil.williams) → review?(nelson)
Assignee: nobody → kaie
Component: Security → Security: PSM
Product: Firefox → Core
QA Contact: firefox → psm
Comment on attachment 326856 [details] [diff] [review]
A Proposed patch

Since this is not a patch to any NSS source code, no NSS review is 
required.  This is a change to PSM.  The owner of PSM should review it.
He will have to maintain it, and possibly change it again when NSS
makefiles are changed.
Attachment #326856 - Flags: review?(nelson) → review?(kaie)

Comment 6

9 years ago
I agree with cls's proposal.  An NSS-based application
should respect the import library suffix that NSS uses,
rather than imposing its own import library suffix on NSS.
It is the job of mozilla/security/manager/Makefile.in
to record such knowledge of NSS build system internals.
(Reporter)

Comment 7

9 years ago
(In reply to comment #6)
> I agree with cls's proposal.  An NSS-based application
> should respect the import library suffix that NSS uses,
> rather than imposing its own import library suffix on NSS.
> It is the job of mozilla/security/manager/Makefile.in
> to record such knowledge of NSS build system internals.

I think the NSS indeed wants the NSS-based application to tell it which suffix to use. Please see:
http://mxr.mozilla.org/mozilla-central/source/security/coreconf/WIN32.mk#270

Exporting the IMPORT_LIB_SUFFIX to the NSS code is better, I think. 
(Reporter)

Comment 8

9 years ago
Ok, Wan-Teh, could you please say something about my comment? If you still feel cls's patch is better, then I will try to use that patch. 

Comment 9

9 years ago
I don't understand the problem fully.  Several people
build Firefox with MinGW regularly, so there must be
something different in your build environment.  In
comment 0 you mentioned "cross compile".  What is
your host platform, and what is your target platform?

I suspect that the people who build Firefox with
MinGW successfully do not cross compile, or they
cross compile on a different host platform.  So
that might be the key difference.

For cross compilation, we override a lot of make
variables here:
http://lxr.mozilla.org/security/source/security/manager/Makefile.in#230

230 ifdef CROSS_COMPILE
231 DEFAULT_GMAKE_FLAGS += \
232         NSINSTALL="$(NSINSTALL)" \
233         NATIVE_CC="$(HOST_CC)" \
234         CC="$(CC)" \
235         CCC="$(CXX)" \
236         LINK="$(LD)" \
237         AS="$(AS)" \
238         AR='$(AR) $(AR_FLAGS:$@=$$@)' \
239         RANLIB="$(RANLIB)" \
240         RC="$(RC) $(RCFLAGS)" \
241         OS_ARCH="$(OS_ARCH)" \
242         CPU_ARCH="$(TARGET_CPU)" \
243         $(NULL)
244 SKIP_CHK=1
245 endif

So if we should override IMPORT_LIB_SUFFIX, we should
override it there.

Regarding the code snippet that you pointed out in comment 7:
http://mxr.mozilla.org/mozilla-central/source/security/coreconf/WIN32.mk#270

That code was added by Nelson's patch in bug 104541.  The
"ifndef IMPORT_LIB_SUFFIX" (and the ifndef for other variables)
wasn't necessary.  I think Nelson added the ifndef mechanically,
and didn't mean that those variables can be overridden by
the applications.  My point is that NSS should use the same
suffix for import libraries whether NSS is built stand-alone
or as part of Firefox.  If necessary I'm willing to change
NSS to use the same import library suffix (.dll.a) in the
MinGW build.  But let's figure out why others can do the
MinGW build successfully without running into this bug.
(Reporter)

Comment 10

9 years ago
(In reply to comment #9)
> I don't understand the problem fully.  Several people
> build Firefox with MinGW regularly, so there must be
> something different in your build environment.  In
> comment 0 you mentioned "cross compile".  What is
> your host platform, and what is your target platform?

The host platform is Linux and the target platform is Windows XP.

> I suspect that the people who build Firefox with
> MinGW successfully do not cross compile, or they
> cross compile on a different host platform.  So
> that might be the key difference.

I guess "cross compile" is the real reason. Abviously, cls has come across the same problem too.


> That code was added by Nelson's patch in bug 104541.  The
> "ifndef IMPORT_LIB_SUFFIX" (and the ifndef for other variables)
> wasn't necessary.  I think Nelson added the ifndef mechanically,
> and didn't mean that those variables can be overridden by
> the applications.  My point is that NSS should use the same
> suffix for import libraries whether NSS is built stand-alone
> or as part of Firefox.  If necessary I'm willing to change
> NSS to use the same import library suffix (.dll.a) in the
> MinGW build.  But let's figure out why others can do the
> MinGW build successfully without running into this bug.

Mingw use dll.a by default . http://mxr.mozilla.org/mozilla-central/source/configure.in#1968 this line code set the suffix. There should be no difference between cross compile and native mingw compile. I don't understand why Mingw compiling is successful and cross compile fails. I guess both will failed here. 
Are you sure Mingw build is workable? 

Updated

9 years ago
Duplicate of this bug: 431995

Updated

9 years ago
Attachment #326856 - Flags: review?(kaie) → review+

Comment 12

9 years ago
Comment on attachment 326856 [details] [diff] [review]
A Proposed patch

I don't have a problem with forwarding environment variables down to the NSS build, r=kaie

But I advice to listen to Nelson's and Wan-Teh's comments.

Comment 13

9 years ago
I don't understand the problem fully.  If I have to choose,
I'll choose cls's patch.
(Reporter)

Comment 14

9 years ago
(In reply to comment #13)
> I don't understand the problem fully.  If I have to choose,
> I'll choose cls's patch.

So, just choose the cls's patch. I think it is OK, too.
(Reporter)

Comment 15

9 years ago
Comment on attachment 326978 [details] [diff] [review]
special case mingw

Can I ask you to review the cls's patch?
Attachment #326978 - Flags: review?(wtc)

Comment 16

5 years ago
reassign bug owner.
mass-update-kaie-20120918
Assignee: kaie → nobody
Is this still an issue?
Flags: needinfo?(Techrazy.Yang)
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.