configure.in changes LDFLAGS before calling js/src/configure

RESOLVED FIXED in mozilla14

Status

()

Core
Build Config
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Jacek Caban, Assigned: Jacek Caban)

Tracking

Trunk
mozilla14
All
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

6 years ago
Created attachment 599088 [details] [diff] [review]
fix v1.0

Bug 720621 introduced a pair of export/unset calls on LDFLAGS, which clears its variable, so configure ran like:

LDFLAGS="..." make -f client.mk build

won't work for js/src/configure. While we could just fix this one case, I propose more radical solution which makes already existing variable preserving stronger.
Attachment #599088 - Flags: review?(mh+mozilla)
Comment on attachment 599088 [details] [diff] [review]
fix v1.0

I tend to agree, here, but I prefer to get some more eyes on this thing. (Ted or Kyle, whoever comes first)
Attachment #599088 - Flags: review?(ted.mielczarek)
Attachment #599088 - Flags: review?(mh+mozilla)
Attachment #599088 - Flags: review?(khuey)
Attachment #599088 - Flags: review+
Comment on attachment 599088 [details] [diff] [review]
fix v1.0

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

Seems reasonable enough to me.
Attachment #599088 - Flags: review?(khuey) → review+
(Assignee)

Comment 3

6 years ago
Thanks for reviews, pushed to m-i:

https://hg.mozilla.org/integration/mozilla-inbound/rev/e80c939cc639
Whiteboard: [inbound]

Comment 4

6 years ago
Backed out for failing to build on all platforms. It may have just needed a clobber, but without a green try run I was hesitant to just clobber/retrigger, since in the meantime we could have had 10 other csets land all burning.

https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=e80c939cc639

https://hg.mozilla.org/integration/mozilla-inbound/rev/7dda043db571
Whiteboard: [inbound]
(Assignee)

Comment 5

6 years ago
Thanks for taking care of the backout. It looks it needs a clobber, I've pushed the patch to try to make sure:

https://tbpl.mozilla.org/?tree=Try&rev=6c9bfdf51a1f
Attachment #599088 - Flags: review?(ted.mielczarek)
(Assignee)

Comment 6

6 years ago
Created attachment 602297 [details] [diff] [review]
fix v1.0

It came out that clobbering would not be enough. libffi's configure script is invoked in a bit hackish way for MSVC, so we need to make sure CFLAGS and LDFLAGS are cleared before its invocation. The attached patch is green on try:

https://tbpl.mozilla.org/?tree=Try&rev=832cada4b207
Attachment #602297 - Flags: review?(mh+mozilla)
Comment on attachment 602297 [details] [diff] [review]
fix v1.0

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

::: js/src/configure.in
@@ +5382,5 @@
>      # Use a wrapper script for cl and ml that looks more like gcc.
>      # autotools can't quite handle an MSVC build environment yet.
>      ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
> +    export LDFLAGS=
> +    export CFLAGS=

In practice, what were the flags before your patch, and what are they after? I can't tell if this is harmful without knowing that.
Attachment #602297 - Flags: review?(mh+mozilla)
(Assignee)

Comment 8

6 years ago
They are exactly the same before and after the patch for me and contain LDFLAGS and CFLAGS that are the result of running js's configure script. These are values I get on MSVC build:

LDFLAGS="-LARGEADDRESSAWARE -NXCOMPAT -DYNAMICBASE -SAFESEH"
CFLAGS="-TC -nologo -W3 -Gy -Fd$(COMPILE_PDBFILE) -we4553"

The difference is that with my patch, these values get exported by top level configure, so js/src/configure modifies exported values and thus they are visible to libffi's configure.

The more I think about it, the less I like the idea of exporting these values. Perhaps avoiding the export/unset calls in the first place is the right way to go after all... I will attach an alternative patch.
(Assignee)

Comment 9

6 years ago
Created attachment 602307 [details] [diff] [review]
alternative patch

The patch that avoids export/unset calls around nspr configure. Since it was introduced for Android as part of bug 720621, I can't test it locally. If we decided to go with this patch, is try build enough for testing?
Comment on attachment 602307 [details] [diff] [review]
alternative patch

Arguably, we should be doing that for all variables.

As for testing, NSPR_LDFLAGS is only set if using Android NDK >= r6b, and our build infrastructure uses r5c, so try won't tell you if that actually works.
(Assignee)

Comment 11

6 years ago
My last attempt didn't work, because nspr configure can't handle
./configure CFLAGS="..."
syntax. I think it's because of ancient autoconf-2.13 used, but I'm not sure (my experiments suggest that's the reason, it's hard to find any info about it).

Thus, I'm back to the solution from comment 6. I will attach a patch that follows the same pattern, but does not export variables on their own. So, if these variables are exported for some reason, we'd behave correctly, but don't export them unless needed.

The patch succeeded on try:
https://tbpl.mozilla.org/?tree=Try&rev=32ea1f054c62
(Assignee)

Comment 12

6 years ago
Created attachment 605716 [details] [diff] [review]
fix v2.1
Attachment #599088 - Attachment is obsolete: true
Attachment #602297 - Attachment is obsolete: true
Attachment #602307 - Attachment is obsolete: true
Attachment #605716 - Flags: review?(mh+mozilla)
Attachment #605716 - Flags: review?(mh+mozilla) → review+
(Assignee)

Comment 13

6 years ago
Thanks for the review.

https://hg.mozilla.org/integration/mozilla-inbound/rev/e1c3e2d27ffc
Whiteboard: [inbound]
https://hg.mozilla.org/mozilla-central/rev/e1c3e2d27ffc
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.