Build NSS object files more like the rest of the tree

RESOLVED FIXED in mozilla15

Status

()

Core
Build Config
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

(Depends on: 1 bug, Blocks: 1 bug)

Trunk
mozilla15
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Bug 632954 gets easier if NSS object files are just in $objdir/$relative_srcdir instead of $objdir/nss/$library_name.
Created attachment 606197 [details] [diff] [review]
Build NSS object files more like the rest of the tree, and simplify security/manager/Makefile.in

I tested the hack on windows with both pymake and GNU make (which is why there is the $(shell cd $(topsrcdir);pwd)).

At the same time, I seriously simplified security/manager/Makefile.in

Pushed to try for more confidence:
https://tbpl.mozilla.org/?tree=Try&rev=01ef33e1d8a7
Attachment #606197 - Flags: review?(ted.mielczarek)
Comment on attachment 606197 [details] [diff] [review]
Build NSS object files more like the rest of the tree, and simplify security/manager/Makefile.in

Review of attachment 606197 [details] [diff] [review]:
-----------------------------------------------------------------

Despite being kind of crazy, this patch improves security/manager/Makefile.in an awful lot.

::: security/manager/Makefile.in
@@ +184,5 @@
>  DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
>  endif
>  ABS_topsrcdir   := $(call core_abspath,$(topsrcdir))
> +# Hack to force NSS build system to use "normal" object directories
> +DEFAULT_GMAKE_FLAGS += BUILD='$(MOZ_BUILD_ROOT)/security/$$(subst $(shell cd $(topsrcdir); pwd)/security/,,$$(CURDIR))'

I'm a little worried about adding a ton of shell invocations for this pwd. Can you do the pwd once in this Makefile and just use that variable in this assignment?
Attachment #606197 - Flags: review?(ted.mielczarek) → review+
Assignee: nobody → mh+mozilla
(In reply to Ted Mielczarek [:ted] from comment #2)
> Comment on attachment 606197 [details] [diff] [review]
> Build NSS object files more like the rest of the tree, and simplify
> security/manager/Makefile.in
> 
> Review of attachment 606197 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Despite being kind of crazy, this patch improves
> security/manager/Makefile.in an awful lot.
> 
> ::: security/manager/Makefile.in
> @@ +184,5 @@
> >  DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
> >  endif
> >  ABS_topsrcdir   := $(call core_abspath,$(topsrcdir))
> > +# Hack to force NSS build system to use "normal" object directories
> > +DEFAULT_GMAKE_FLAGS += BUILD='$(MOZ_BUILD_ROOT)/security/$$(subst $(shell cd $(topsrcdir); pwd)/security/,,$$(CURDIR))'
> 
> I'm a little worried about adding a ton of shell invocations for this pwd.
> Can you do the pwd once in this Makefile and just use that variable in this
> assignment?

The $(shell) is invoked once, when appending to DEFAULT_GMAKE_FLAGS. It's subst and CURDIR that are used when building NSS.
Aha, thanks.
https://hg.mozilla.org/integration/mozilla-inbound/rev/369ad04efa1f

Comment 6

5 years ago
Is it possible that this causes crashes if one doesn't do a clobber build?
Some in https://hg.mozilla.org/mozilla-central/pushloghtml?startID=22381&endID=22382 
seems to cause that, and I got crashes in pk11obj.c:633

Comment 7

5 years ago
https://hg.mozilla.org/mozilla-central/rev/369ad04efa1f
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14

Comment 8

5 years ago
Clobber build didn't help. I'm not at all sure whether this change caused the problem,
but something in the latest merge causes m-c to crash very soon on this 64bit linux.

Comment 9

5 years ago
Created attachment 611244 [details]
stack

Yes, this causes the crash.
Backed out of m-c:
https://hg.mozilla.org/mozilla-central/rev/4a8a5e8ef78b
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Updated

5 years ago
Attachment #611244 - Attachment is patch: false
Where is the crash occurring? I don't see anything on tbpl.
Crashes locally for smaug, backing out locally fixed it for him.
Then I'll need a build log...
I tried again with gcc, and no crash.
(The previous build was with clang.)
https://hg.mozilla.org/integration/mozilla-inbound/rev/5bc899138eb4
Target Milestone: mozilla14 → mozilla15
https://hg.mozilla.org/mozilla-central/rev/5bc899138eb4
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → FIXED
Depends on: 797508
You need to log in before you can comment on or make changes to this bug.