[commit: ghc] ghc-8.2: linker: fix OpenBSD build failure, EM_PPC64 is not defined there (d4694b8)

git at git.haskell.org git at git.haskell.org
Mon Mar 27 03:00:28 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/d4694b85be23c8a014225271060765c062502ed2/ghc

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

commit d4694b85be23c8a014225271060765c062502ed2
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Sun Mar 26 15:40:40 2017 +0100

    linker: fix OpenBSD build failure, EM_PPC64 is not defined there
    
    Adam Steen reported build failure on OpenBSD:
      rts/linker/Elf.c:402:0: error:
        error: 'EM_PPC64' undeclared (first use in this function)
          case EM_PPC64: IF_DEBUG(linker,debugBelch( "powerpc64" ));
    
    OpenBSD-6.0 does not define EM_PPC64:
      /usr/include/sys/exec_elf.h:#define EM_PPC 20 /* PowerPC */
    
    Reported-by: Adam Steen <adam at adamsteen.com.au>
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
    (cherry picked from commit 6c73504ac5f4e951062d5e868fa2b69b028b6e79)


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

d4694b85be23c8a014225271060765c062502ed2
 rts/linker/Elf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c
index 604c3dc..e8f6aab 100644
--- a/rts/linker/Elf.c
+++ b/rts/linker/Elf.c
@@ -399,10 +399,12 @@ ocVerifyImage_ELF ( ObjectCode* oc )
       case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;
 #endif
       case EM_PPC:   IF_DEBUG(linker,debugBelch( "powerpc32" )); break;
+#ifdef EM_PPC64
       case EM_PPC64: IF_DEBUG(linker,debugBelch( "powerpc64" ));
           errorBelch("%s: RTS linker not implemented on PowerPC 64-bit",
                      oc->fileName);
           return 0;
+#endif
 #ifdef EM_X86_64
       case EM_X86_64: IF_DEBUG(linker,debugBelch( "x86_64" )); break;
 #elif defined(EM_AMD64)



More information about the ghc-commits mailing list