[Git][ghc/ghc][wip/angerman/aarch64-ncg] 4 commits: Revert "[AArch64] Aarch64 Always PIC"
Moritz Angermann
gitlab at gitlab.haskell.org
Tue Oct 27 02:52:52 UTC 2020
Moritz Angermann pushed to branch wip/angerman/aarch64-ncg at Glasgow Haskell Compiler / GHC
Commits:
a3b232d7 by Moritz Angermann at 2020-10-26T21:05:55+08:00
Revert "[AArch64] Aarch64 Always PIC"
This reverts commit 921276592218211f441fcf011fc52441e3a2f0a6.
- - - - -
e85f6825 by Moritz Angermann at 2020-10-26T21:07:26+08:00
Revert "[Storage/Adjustor] Drop size check in allocExec"
This reverts commit 37a62ae956a25e5832fbe125a4d8ee556fd11042.
- - - - -
a71ece1b by Moritz Angermann at 2020-10-26T21:10:43+08:00
[Storage] Reinstate check; add comment.
- - - - -
0f7df369 by Moritz Angermann at 2020-10-27T10:52:25+08:00
[AArch64] Aarch64 Always PIC
- - - - -
2 changed files:
- compiler/GHC/Driver/Session.hs
- rts/sm/Storage.c
Changes:
=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -3817,8 +3817,10 @@ validHoleFitsImpliedGFlags
default_PIC :: Platform -> [GeneralFlag]
default_PIC platform =
case (platformOS platform, platformArch platform) of
- (OSDarwin, ArchX86_64) -> [Opt_PIC]
- (OSOpenBSD, ArchX86_64) -> [Opt_PIC] -- Due to PIE support in
+ (OSDarwin, ArchX86_64) -> [Opt_PIC]
+ (OSDarwin, ArchAarch64) -> [Opt_PIC]
+ (OSLinux, ArchAarch64) -> [Opt_PIC, Opt_ExternalDynamicRefs]
+ (OSOpenBSD, ArchX86_64) -> [Opt_PIC] -- Due to PIE support in
-- OpenBSD since 5.3 release
-- (1 May 2013) we need to
-- always generate PIC. See
@@ -5111,4 +5113,3 @@ initSDocContext dflags style = SDC
-- | Initialize the pretty-printing options using the default user style
initDefaultSDocContext :: DynFlags -> SDocContext
initDefaultSDocContext dflags = initSDocContext dflags defaultUserStyle
-
=====================================
rts/sm/Storage.c
=====================================
@@ -1751,6 +1751,14 @@ AdjustorWritable allocateExec(W_ bytes, AdjustorExecutable *exec_ret)
{
AdjustorWritable writ;
ffi_closure* cl;
+ // This check is necessary as we can't use allocateExec for anything *but*
+ // ffi_closures on ios/darwin on arm. libffi does some heavy lifting to
+ // get around the X^W restrictions, and we can't just use this codepath
+ // to allocate generic executable space. For those cases we have to refer
+ // back to allocateWrite/markExec/freeWrite (see above.)
+ if (bytes != sizeof(ffi_closure)) {
+ barf("allocateExec: for ffi_closure only");
+ }
ACQUIRE_SM_LOCK;
cl = writ = ffi_closure_alloc((size_t)bytes, exec_ret);
if (cl != NULL) {
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5764bca329c18619598fbe99433f581a119a5898...0f7df369abfd5b17fcde67a4aea11d425baafb65
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5764bca329c18619598fbe99433f581a119a5898...0f7df369abfd5b17fcde67a4aea11d425baafb65
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201026/d59e7b3b/attachment-0001.html>
More information about the ghc-commits
mailing list