Closed Bug 1485503 Opened 6 years ago Closed 6 years ago

[LTO][mac] ld64 thin-lto wrongfully merges static data with non-static data

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

When different translation units contain the same symbol name, all static, but one of them non-static, ld64 wrongfully link the references to the static data with the non-static data, or vice versa. With libaom and libvpx sharing data structures with the same name but different contents, that leads to interesting failures/crashes at runtime. This was apparently fixed in Apple ld64 from Xcode 9, but the last open sourced version is the one from Xcode 8, so I ended up digging in the ld64 source code and fixed the issue. This work was merged to cctools-port upstream in https://github.com/tpoechtrager/cctools-port/pull/59. For the same reason as invoked in bug 1478917, though, updating to cctools-port master is more involved than just changing a commit sha1 (as it requires building apple-libtapi, which in turn builds parts of LLVM, which should probably be avoided), so just cherry-pick the fix.
Attachment #9003305 - Flags: review?(core-build-config-reviews)
Blocks: macOS-LTO
No longer blocks: macOS-PGO
Attachment #9003305 - Flags: review?(core-build-config-reviews) → review+
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/4017bcbb799d Avoid ld64 merging static and non-static data with the same name during ThinLTO. r=dmajor
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/4c27db2b3d66 Avoid ld64 merging static and non-static data with the same name during ThinLTO. r=dmajor
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: