--enable-pie doesn't work properly in some cases

RESOLVED FIXED in Firefox -esr52

Status

RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified
mozilla55

Firefox Tracking Flags

(firefox-esr52 fixed, firefox54 fixed, firefox55 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
So there's this weird thing where in some cases, --enable-pie fails with something like:

checking for PIE support... no
configure: error: --enable-pie requires PIE support from the linker.

and config.log contains:
/usr/bin/ld: /tmp/cc1JnNAS.o: relocation R_X86_64_32 against `.text.main' can
not be used when making a shared object; recompile with -fPIC
/tmp/cc1JnNAS.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status

And we indeed don't pass -fPIC to the compiler during the -pie test (while we do when actually building Firefox), but we actually should be, and I'm actually surprised this hasn't broken my builds on Debian in the past.
Comment hidden (mozreview-request)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8870632 [details]
Bug 1367267 - Pass -fPIC when compiling the -pie configure test.

https://reviewboard.mozilla.org/r/142086/#review146118
Attachment #8870632 - Flags: review?(gps) → review+

Comment 3

2 years ago
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/fdb4db210119
Pass -fPIC when compiling the -pie configure test. r=gps
(Assignee)

Comment 4

2 years ago
Comment on attachment 8870632 [details]
Bug 1367267 - Pass -fPIC when compiling the -pie configure test.

Approval Request Comment
[Feature/Bug causing the regression]: bug 857628
[User impact if declined]: build failure in some cases when using --enable-pie (likely related to compiler/linker versions)
[Is this code covered by automated tests?]: N/A
[Has the fix been verified in Nightly?]: N/a
[Needs manual test from QE? If yes, steps to reproduce]: N/A
[List of other uplifts needed for the feature/fix]: N/A
[Is the change risky?]: No
[Why is the change risky/not risky?]: It's a trivial `configure` change.
[String changes made/needed]: N/A
Attachment #8870632 - Flags: approval-mozilla-esr52?
Attachment #8870632 - Flags: approval-mozilla-beta?

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/fdb4db210119
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
status-firefox54: --- → affected
Comment on attachment 8870632 [details]
Bug 1367267 - Pass -fPIC when compiling the -pie configure test.

Fix a build issue. Beta54+. Should be in 54 beta 11.
Attachment #8870632 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment 7

2 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-beta/rev/2b2e0bc442c7
status-firefox54: affected → fixed
Comment on attachment 8870632 [details]
Bug 1367267 - Pass -fPIC when compiling the -pie configure test.

Fixes a build config setting, let's uplift to ESR52.
Attachment #8870632 - Flags: approval-mozilla-esr52? → approval-mozilla-esr52+
status-firefox-esr52: --- → affected

Comment 9

2 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-esr52/rev/4c2f4d8b693e
status-firefox-esr52: affected → fixed

Updated

a year ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.