Commit c5d8162d authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by Ben Gamari

Make GHC aware of OSAIX and AixLD

GHC needs to be aware of targetting AIX because
AIX requires some special handling for the toolchain
(similiar to Solaris)

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie, erikd

Differential Revision: https://phabricator.haskell.org/D1501
parent 7dfde0e8
......@@ -277,6 +277,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
dragonfly|osf1|hpux|linuxaout|freebsd2|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix)
test -z "[$]2" || eval "[$]2=OSUnknown"
;;
aix)
test -z "[$]2" || eval "[$]2=OSAIX"
;;
linux-android)
test -z "[$]2" || eval "[$]2=OSAndroid"
;;
......@@ -1862,9 +1865,12 @@ case "$1-$2" in
$3="linux"
;;
# As far as I'm aware, none of these have relevant variants
freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|haiku)
$3="$1"
;;
aix*) # e.g. powerpc-ibm-aix7.1.3.0
$3="aix"
;;
freebsd*) # like i686-gentoo-freebsd7
# i686-gentoo-freebsd8
# i686-gentoo-freebsd8.2
......
......@@ -4369,6 +4369,7 @@ data LinkerInfo
| GnuGold [Option]
| DarwinLD [Option]
| SolarisLD [Option]
| AixLD [Option]
| UnknownLD
deriving Eq
......
......@@ -762,6 +762,7 @@ neededLinkArgs (GnuLD o) = o
neededLinkArgs (GnuGold o) = o
neededLinkArgs (DarwinLD o) = o
neededLinkArgs (SolarisLD o) = o
neededLinkArgs (AixLD o) = o
neededLinkArgs UnknownLD = []
-- Grab linker info and cache it in DynFlags.
......@@ -817,6 +818,9 @@ getLinkerInfo' dflags = do
-- precisely so we assume here, the Solaris linker is
-- used.
return $ SolarisLD []
OSAIX ->
-- IBM AIX uses its own non-binutils linker as well
return $ AixLD []
OSDarwin ->
-- Darwin has neither GNU Gold or GNU LD, but a strange linker
-- that doesn't support --version. We can just assume that's
......
......@@ -86,6 +86,7 @@ data OS
| OSOsf3
| OSQNXNTO
| OSAndroid
| OSAIX
deriving (Read, Show, Eq)
-- | ARM Instruction Set Architecture, Extensions and ABI
......@@ -138,6 +139,7 @@ osElfTarget OSOsf3 = False -- I don't know if this is right, but as
-- per comment below it's safe
osElfTarget OSQNXNTO = False
osElfTarget OSAndroid = True
osElfTarget OSAIX = False
osElfTarget OSUnknown = False
-- Defaulting to False is safe; it means don't rely on any
-- ELF-specific functionality. It is important to have a default for
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment