[commit: ghc] master: aclocal.m4: add OSHurd (debian patch) (0693b0b)

git at git.haskell.org git at git.haskell.org
Sat Mar 17 17:20:18 UTC 2018


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

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

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

commit 0693b0b0500236a3dec933350a13f1b0e8c1cb54
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Sat Mar 17 17:12:04 2018 +0000

    aclocal.m4: add OSHurd (debian patch)
    
    ghc treats OSUnknown (and GNU/Hurd) as non-ELF target.
    This causes panic in native codegenerator when trying
    to build PIC code:
    
    ```
      ...
      -- all other platforms
      howToAccessLabel dflags _ _ _ _ _
            | not (positionIndependent dflags)
            = AccessDirectly
            | otherwise
            = panic "howToAccessLabel: PIC not defined for this platform"
    ```
    
    This change declares new 'OSHurd' and marks it as an
    ELF target. Fixes building ghc-stage2 on i686-unknown-gnu0.9.
    
    Patch provided by "Pino" via Samuel Thibault and taken from
    debian.
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>


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

0693b0b0500236a3dec933350a13f1b0e8c1cb54
 aclocal.m4                 | 5 ++++-
 compiler/utils/Platform.hs | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 04a6bf5..58d43e1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -272,12 +272,15 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
         nto-qnx)
             test -z "[$]2" || eval "[$]2=OSQNXNTO"
             ;;
-        dragonfly|hpux|linuxaout|freebsd2|gnu|nextstep2|nextstep3|sunos4|ultrix)
+        dragonfly|hpux|linuxaout|freebsd2|nextstep2|nextstep3|sunos4|ultrix)
             test -z "[$]2" || eval "[$]2=OSUnknown"
             ;;
         aix)
             test -z "[$]2" || eval "[$]2=OSAIX"
             ;;
+        gnu)
+            test -z "[$]2" || eval "[$]2=OSHurd"
+            ;;
         *)
             echo "Unknown OS '[$]1'"
             exit 1
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index c313870..449a62a 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -87,6 +87,7 @@ data OS
         | OSHaiku
         | OSQNXNTO
         | OSAIX
+        | OSHurd
         deriving (Read, Show, Eq)
 
 -- | ARM Instruction Set Architecture, Extensions and ABI
@@ -136,6 +137,7 @@ osElfTarget OSKFreeBSD  = True
 osElfTarget OSHaiku     = True
 osElfTarget OSQNXNTO    = False
 osElfTarget OSAIX       = False
+osElfTarget OSHurd      = True
 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