Closed Bug 892339 Opened 7 years ago Closed 7 years ago

Fail the build when there are text relocations

Categories

(Firefox Build System :: General, defect)

All
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla25

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

While looking at the gold linker manual page for something else, I spotted the -z text option that barfs when the linker would need to add text relocations. GNU ld supports this too. Considering we've had problems in the past with things adding text relocations, ensuring the build fails in such case would be better than not noticing (on Linux) or failing at runtime (on Android)
While I was there, I added -z noexecstack to js/src/configure.in to be in line with configure.in.

https://tbpl.mozilla.org/?tree=Try&rev=04228cb2cb6b
Attachment #773766 - Flags: review?(ted)
Note this will require a clobber.
Comment on attachment 773766 [details] [diff] [review]
Fail the build when there are text relocations

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

::: js/src/configure.in
@@ +1165,5 @@
> +    LDFLAGS="$LDFLAGS -Wl,-z,text"
> +    AC_TRY_LINK(,,AC_MSG_RESULT([yes])
> +                  [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,text"],
> +                  AC_MSG_RESULT([no])
> +                  LDFLAGS=$_SAVE_LDFLAGS)

Creeping up on "wants to be in an m4 file" size.
Attachment #773766 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/178f3283557b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.