From 0f7df369abfd5b17fcde67a4aea11d425baafb65 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Tue, 27 Oct 2020 10:52:25 +0800 Subject: [AArch64] Aarch64 Always PIC --- compiler/GHC/Driver/Session.hs | 7 ++++--- includes/rts/Flags.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 97b1afe9ba..0801ed52c2 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/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 - diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h index 1787124fe1..9455892cdb 100644 --- a/includes/rts/Flags.h +++ b/includes/rts/Flags.h @@ -202,7 +202,7 @@ typedef struct _CONCURRENT_FLAGS { * Note that there is no 32bit darwin system we can realistically expect to * run on or compile for. */ -#if defined(darwin_HOST_OS) +#if defined(darwin_HOST_OS) || defined(aarch64_HOST_ARCH) #define DEFAULT_LINKER_ALWAYS_PIC true #else #define DEFAULT_LINKER_ALWAYS_PIC false -- cgit v1.2.1