linker: fix OpenBSD build failure, EM_PPC64 is not defined there
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 26 Mar 2017 14:40:40 +0000 (15:40 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 26 Mar 2017 14:48:14 +0000 (15:48 +0100)
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@adamsteen.com.au>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
rts/linker/Elf.c

index 604c3dc..e8f6aab 100644 (file)
@@ -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)