[commit: ghc] master: Make GHC aware of OSAIX and AixLD (c5d8162)

git at git.haskell.org git at git.haskell.org
Thu Nov 19 12:24:42 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c5d8162d230c373b2b49ec94d3f9a027ff6e2dd6/ghc

>---------------------------------------------------------------

commit c5d8162d230c373b2b49ec94d3f9a027ff6e2dd6
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Thu Nov 19 12:55:35 2015 +0100

    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


>---------------------------------------------------------------

c5d8162d230c373b2b49ec94d3f9a027ff6e2dd6
 aclocal.m4                 | 8 +++++++-
 compiler/main/DynFlags.hs  | 1 +
 compiler/main/SysTools.hs  | 4 ++++
 compiler/utils/Platform.hs | 2 ++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 33f05e5..e816e09 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 014a11e..19df18e 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4369,6 +4369,7 @@ data LinkerInfo
   | GnuGold  [Option]
   | DarwinLD [Option]
   | SolarisLD [Option]
+  | AixLD    [Option]
   | UnknownLD
   deriving Eq
 
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index 303e8de..0e3acb6 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -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
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 5f1d97a..617237f 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -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



More information about the ghc-commits mailing list