Mangle .subsections_via_symbols away.
authorMoritz Angermann <moritz.angermann@gmail.com>
Mon, 6 Mar 2017 22:31:04 +0000 (17:31 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 6 Mar 2017 23:51:03 +0000 (18:51 -0500)
commit1686f30951292e94bf3076ce8b3eafb0bcbba91d
tree72ef3e65e10c6d446c65e2988ab07b2f120c4e2e
parent2fa44217c1d9722227297eefb0d6c6aed7e128ca
Mangle .subsections_via_symbols away.

This is a rather stupid mangler hack. However, when using prefix data
with llvm, on systems that support -dead_strip (macOS, iOS), the prefix
data is stipped.

llvm generiously adds .subsections_via_symbols for macho in any case.

Thus we use our trusted mangler to drop the .subsections_via_symbols
line from the assembly.

This ultimately means that for (macOS, llvm), and (iOS, llvm) will not
benefit from -dead_strip. Yet, this patch will allow building ghc on
macOS again.

Test Plan: build ghc with llvm on macOS

Reviewers: rwbarton, bgamari, austin

Reviewed By: rwbarton, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3287
compiler/llvmGen/LlvmMangler.hs