From owner-svn-ports-all@freebsd.org Sun Jul 7 15:45:48 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4070C15E6E03; Sun, 7 Jul 2019 15:45:48 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAAF18B53E; Sun, 7 Jul 2019 15:45:47 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF5A22FF5; Sun, 7 Jul 2019 15:45:47 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x67Fjlar081006; Sun, 7 Jul 2019 15:45:47 GMT (envelope-from arrowd@FreeBSD.org) Received: (from arrowd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x67Fjkmw081000; Sun, 7 Jul 2019 15:45:46 GMT (envelope-from arrowd@FreeBSD.org) Message-Id: <201907071545.x67Fjkmw081000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arrowd set sender to arrowd@FreeBSD.org using -f From: Gleb Popov Date: Sun, 7 Jul 2019 15:45:46 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r506142 - in head/lang/ghc: . files files862 files863 files864 X-SVN-Group: ports-head X-SVN-Commit-Author: arrowd X-SVN-Commit-Paths: in head/lang/ghc: . files files862 files863 files864 X-SVN-Commit-Revision: 506142 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAAF18B53E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:12874, ipnet:2000::/3, country:IT]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2019 15:45:48 -0000 Author: arrowd Date: Sun Jul 7 15:45:46 2019 New Revision: 506142 URL: https://svnweb.freebsd.org/changeset/ports/506142 Log: lang/ghc: Add support for ELFv2 on powerpc64. Submitted by: Mikael Urankar Differential Revision: https://reviews.freebsd.org/D20872 Modified: head/lang/ghc/Makefile head/lang/ghc/distinfo head/lang/ghc/files/patch-ppc64 head/lang/ghc/files862/patch-ppc64 head/lang/ghc/files863/patch-ppc64 head/lang/ghc/files864/patch-ppc64 Modified: head/lang/ghc/Makefile ============================================================================== --- head/lang/ghc/Makefile Sun Jul 7 15:17:18 2019 (r506141) +++ head/lang/ghc/Makefile Sun Jul 7 15:45:46 2019 (r506142) @@ -139,8 +139,10 @@ _EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-dyn .include .if empty(PORT_OPTIONS:MBOOT) - -DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot +. if ${ARCH} == powerpc64 && ${OSVERSION} < 1300036 +ELF_V= -elfv1 +. endif +DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${ELF_V}${EXTRACT_SUFX}:boot .endif # MBOOT .if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 @@ -243,6 +245,12 @@ post-patch: @${REINPLACE_CMD} -e '/^infodir/d' ${BOOT_DIR}/mk/build.mk @${REINPLACE_CMD} -e '/^docdir/d' ${BOOT_DIR}/mk/build.mk @${REINPLACE_CMD} -e '/^htmldir/d' ${BOOT_DIR}/mk/build.mk +.endif + +# XXX osversion powerpc64 elfv2 +.if ${OSVERSION} >= 1300036 + @${REINPLACE_CMD} -e 's/ELF_V1/ELF_V2/' \ + ${WRKSRC}/configure ${WRKSRC}/aclocal.m4 .endif pre-configure: apply-slist Modified: head/lang/ghc/distinfo ============================================================================== --- head/lang/ghc/distinfo Sun Jul 7 15:17:18 2019 (r506141) +++ head/lang/ghc/distinfo Sun Jul 7 15:45:46 2019 (r506142) @@ -21,7 +21,9 @@ SHA256 (ghc-8.6.3-boot-armv6-freebsd.tar.xz) = 5260987 SIZE (ghc-8.6.3-boot-armv6-freebsd.tar.xz) = 113748008 SHA256 (ghc-8.6.3-boot-armv7-freebsd.tar.xz) = 765d01199ceb0dfa5c84de692cec427e67ae1cf1ba6e1fc20e7ca854c6ceb556 SIZE (ghc-8.6.3-boot-armv7-freebsd.tar.xz) = 114046668 -SHA256 (ghc-8.6.3-boot-powerpc64-freebsd.tar.xz) = fb9bd4bad3a54722b7012c0a531cbdfe71b3b20a0b92cbd52195a526dc5ccde4 -SIZE (ghc-8.6.3-boot-powerpc64-freebsd.tar.xz) = 112652192 +SHA256 (ghc-8.6.3-boot-powerpc64-freebsd.tar.xz) = d05431053aeabe9a284439e1ebb4e0a58587cc14f9e5f6250b1b1e4476c4ec83 +SIZE (ghc-8.6.3-boot-powerpc64-freebsd.tar.xz) = 107059040 +SHA256 (ghc-8.6.3-boot-powerpc64-freebsd-elfv1.tar.xz) = fb9bd4bad3a54722b7012c0a531cbdfe71b3b20a0b92cbd52195a526dc5ccde4 +SIZE (ghc-8.6.3-boot-powerpc64-freebsd-elfv1.tar.xz) = 112652192 SHA256 (hscolour-1.24.4.tar.gz) = 243332b082294117f37b2c2c68079fa61af68b36223b3fc07594f245e0e5321d SIZE (hscolour-1.24.4.tar.gz) = 28729 Modified: head/lang/ghc/files/patch-ppc64 ============================================================================== --- head/lang/ghc/files/patch-ppc64 Sun Jul 7 15:17:18 2019 (r506141) +++ head/lang/ghc/files/patch-ppc64 Sun Jul 7 15:45:46 2019 (r506142) @@ -9,42 +9,6 @@ #endif -From cbdb2dcf8ff0702d0a52f8fc3ee0288c9dde0e92 Mon Sep 17 00:00:00 2001 -From: Peter Trommler -Date: Fri, 28 Dec 2018 22:30:34 +0100 -Subject: [PATCH] RTS: Use ELF v1 convention on all powerpc64 systems - ---- - rts/StgCRun.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/rts/StgCRun.c b/rts/StgCRun.c -index 92b0696c2b..4480198564 100644 ---- rts/StgCRun.c -+++ rts/StgCRun.c -@@ -749,7 +749,6 @@ StgRunIsImplementedInAssembler(void) - - #if defined(powerpc64_HOST_ARCH) - --#if defined(linux_HOST_OS) - static void GNUC3_ATTRIBUTE(used) - StgRunIsImplementedInAssembler(void) - { -@@ -871,10 +870,6 @@ StgRunIsImplementedInAssembler(void) - : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); - } - --#else // linux_HOST_OS --#error Only Linux support for power64 right now. --#endif -- - #endif - - #if defined(powerpc64le_HOST_ARCH) - - - - From f4399ce96514ab58d766de999896780e93c886c6 Mon Sep 17 00:00:00 2001 From: Peter Trommler Date: Fri, 28 Dec 2018 23:52:31 +0100 @@ -409,3 +373,93 @@ index 2f64d82ee5..82726d90d9 100644 II8 -> (1, 0, 8, gprs) II16 -> (1, 0, 8, gprs) --- CodeGen.hs.orig 2018-09-16 22:53:54.000000000 +0200 +--- libraries/ghci/GHCi/InfoTable.hsc.orig 2019-07-06 09:00:10.880579000 +0200 ++++ libraries/ghci/GHCi/InfoTable.hsc 2019-07-06 08:59:23.613439000 +0200 +@@ -77,7 +77,7 @@ data Arch = ArchSPARC + | ArchARM + | ArchARM64 + | ArchPPC64 +- | ArchPPC64LE ++ | ArchPPC64_ELFv2 + | ArchUnknown + deriving Show + +@@ -99,8 +99,8 @@ platform = + ArchARM64 + #elif defined(powerpc64_HOST_ARCH) + ArchPPC64 +-#elif defined(powerpc64le_HOST_ARCH) +- ArchPPC64LE ++#elif defined(_CALL_ELF) && (_CALL_ELF == 2) ++ ArchPPC64_ELFv2 + #else + # if defined(TABLES_NEXT_TO_CODE) + # error Unimplemented architecture +@@ -252,7 +252,7 @@ mkJumpToAddr a = case platform of + 0xE96C0010, + 0x4E800420] + +- ArchPPC64LE -> ++ ArchPPC64_ELFv2 -> + -- The ABI requires r12 to point to the function's entry point. + -- We use the medium code model where code resides in the first + -- two gigabytes, so loading a non-negative32 bit address +--- rts/StgCRun.c.orig 2019-04-07 21:39:58.000000000 +0200 ++++ rts/StgCRun.c 2019-07-06 08:57:54.735161000 +0200 +@@ -747,9 +747,8 @@ StgRunIsImplementedInAssembler(void) + Everything is in assembler, so we don't have to deal with GCC... + -------------------------------------------------------------------------- */ + +-#if defined(powerpc64_HOST_ARCH) ++#if defined(ELF_V1) + +-#if defined(linux_HOST_OS) + static void GNUC3_ATTRIBUTE(used) + StgRunIsImplementedInAssembler(void) + { +@@ -871,13 +870,9 @@ StgRunIsImplementedInAssembler(void) + : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); + } + +-#else // linux_HOST_OS +-#error Only Linux support for power64 right now. + #endif + +-#endif +- +-#if defined(powerpc64le_HOST_ARCH) ++#if defined(ELF_V2) + /* ----------------------------------------------------------------------------- + PowerPC 64 little endian architecture + +--- rts/StgCRunAsm.S.orig 2018-06-12 22:33:31.000000000 +0200 ++++ rts/StgCRunAsm.S 2019-07-06 13:29:26.837367000 +0200 +@@ -1,8 +1,7 @@ + #include "ghcconfig.h" + #include "rts/Constants.h" + +-#if defined(powerpc64le_HOST_ARCH) +-# ifdef linux_HOST_OS ++#if defined(_CALL_ELF) && (_CALL_ELF == 2) + # define STACK_FRAME_SIZE RESERVED_C_STACK_BYTES+304 + .file "StgCRun.c" + .abiversion 2 +@@ -13,6 +12,8 @@ + .hidden StgRun + .type StgRun,@function + StgRun: ++ addis %r2, %r12, .TOC.-StgRun@ha ++ addi %r2, %r2, .TOC.-StgRun@l + .localentry StgRun,.-StgRun + mflr 0 + mr 5, 1 +@@ -108,9 +109,6 @@ StgReturn: + blr + + .section .note.GNU-stack,"",@progbits +-# else // linux_HOST_OS +-# error Only Linux support for power64 little endian right now. +-# endif + + #elif defined(powerpc_HOST_ARCH) + # if defined(aix_HOST_OS) Modified: head/lang/ghc/files862/patch-ppc64 ============================================================================== --- head/lang/ghc/files862/patch-ppc64 Sun Jul 7 15:17:18 2019 (r506141) +++ head/lang/ghc/files862/patch-ppc64 Sun Jul 7 15:45:46 2019 (r506142) @@ -9,42 +9,6 @@ #endif -From cbdb2dcf8ff0702d0a52f8fc3ee0288c9dde0e92 Mon Sep 17 00:00:00 2001 -From: Peter Trommler -Date: Fri, 28 Dec 2018 22:30:34 +0100 -Subject: [PATCH] RTS: Use ELF v1 convention on all powerpc64 systems - ---- - rts/StgCRun.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/rts/StgCRun.c b/rts/StgCRun.c -index 92b0696c2b..4480198564 100644 ---- rts/StgCRun.c -+++ rts/StgCRun.c -@@ -749,7 +749,6 @@ StgRunIsImplementedInAssembler(void) - - #if defined(powerpc64_HOST_ARCH) - --#if defined(linux_HOST_OS) - static void GNUC3_ATTRIBUTE(used) - StgRunIsImplementedInAssembler(void) - { -@@ -871,10 +870,6 @@ StgRunIsImplementedInAssembler(void) - : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); - } - --#else // linux_HOST_OS --#error Only Linux support for power64 right now. --#endif -- - #endif - - #if defined(powerpc64le_HOST_ARCH) - - - - From f4399ce96514ab58d766de999896780e93c886c6 Mon Sep 17 00:00:00 2001 From: Peter Trommler Date: Fri, 28 Dec 2018 23:52:31 +0100 @@ -409,3 +373,93 @@ index 2f64d82ee5..82726d90d9 100644 II8 -> (1, 0, 8, gprs) II16 -> (1, 0, 8, gprs) --- CodeGen.hs.orig 2018-09-16 22:53:54.000000000 +0200 +--- libraries/ghci/GHCi/InfoTable.hsc.orig 2019-07-06 09:00:10.880579000 +0200 ++++ libraries/ghci/GHCi/InfoTable.hsc 2019-07-06 08:59:23.613439000 +0200 +@@ -77,7 +77,7 @@ data Arch = ArchSPARC + | ArchARM + | ArchARM64 + | ArchPPC64 +- | ArchPPC64LE ++ | ArchPPC64_ELFv2 + | ArchUnknown + deriving Show + +@@ -99,8 +99,8 @@ platform = + ArchARM64 + #elif defined(powerpc64_HOST_ARCH) + ArchPPC64 +-#elif defined(powerpc64le_HOST_ARCH) +- ArchPPC64LE ++#elif defined(_CALL_ELF) && (_CALL_ELF == 2) ++ ArchPPC64_ELFv2 + #else + # if defined(TABLES_NEXT_TO_CODE) + # error Unimplemented architecture +@@ -252,7 +252,7 @@ mkJumpToAddr a = case platform of + 0xE96C0010, + 0x4E800420] + +- ArchPPC64LE -> ++ ArchPPC64_ELFv2 -> + -- The ABI requires r12 to point to the function's entry point. + -- We use the medium code model where code resides in the first + -- two gigabytes, so loading a non-negative32 bit address +--- rts/StgCRun.c.orig 2019-04-07 21:39:58.000000000 +0200 ++++ rts/StgCRun.c 2019-07-06 08:57:54.735161000 +0200 +@@ -747,9 +747,8 @@ StgRunIsImplementedInAssembler(void) + Everything is in assembler, so we don't have to deal with GCC... + -------------------------------------------------------------------------- */ + +-#if defined(powerpc64_HOST_ARCH) ++#if defined(ELF_V1) + +-#if defined(linux_HOST_OS) + static void GNUC3_ATTRIBUTE(used) + StgRunIsImplementedInAssembler(void) + { +@@ -871,13 +870,9 @@ StgRunIsImplementedInAssembler(void) + : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); + } + +-#else // linux_HOST_OS +-#error Only Linux support for power64 right now. + #endif + +-#endif +- +-#if defined(powerpc64le_HOST_ARCH) ++#if defined(ELF_V2) + /* ----------------------------------------------------------------------------- + PowerPC 64 little endian architecture + +--- rts/StgCRunAsm.S.orig 2018-06-12 22:33:31.000000000 +0200 ++++ rts/StgCRunAsm.S 2019-07-06 13:29:26.837367000 +0200 +@@ -1,8 +1,7 @@ + #include "ghcconfig.h" + #include "rts/Constants.h" + +-#if defined(powerpc64le_HOST_ARCH) +-# ifdef linux_HOST_OS ++#if defined(_CALL_ELF) && (_CALL_ELF == 2) + # define STACK_FRAME_SIZE RESERVED_C_STACK_BYTES+304 + .file "StgCRun.c" + .abiversion 2 +@@ -13,6 +12,8 @@ + .hidden StgRun + .type StgRun,@function + StgRun: ++ addis %r2, %r12, .TOC.-StgRun@ha ++ addi %r2, %r2, .TOC.-StgRun@l + .localentry StgRun,.-StgRun + mflr 0 + mr 5, 1 +@@ -108,9 +109,6 @@ StgReturn: + blr + + .section .note.GNU-stack,"",@progbits +-# else // linux_HOST_OS +-# error Only Linux support for power64 little endian right now. +-# endif + + #elif defined(powerpc_HOST_ARCH) + # if defined(aix_HOST_OS) Modified: head/lang/ghc/files863/patch-ppc64 ============================================================================== --- head/lang/ghc/files863/patch-ppc64 Sun Jul 7 15:17:18 2019 (r506141) +++ head/lang/ghc/files863/patch-ppc64 Sun Jul 7 15:45:46 2019 (r506142) @@ -9,42 +9,6 @@ #endif -From cbdb2dcf8ff0702d0a52f8fc3ee0288c9dde0e92 Mon Sep 17 00:00:00 2001 -From: Peter Trommler -Date: Fri, 28 Dec 2018 22:30:34 +0100 -Subject: [PATCH] RTS: Use ELF v1 convention on all powerpc64 systems - ---- - rts/StgCRun.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/rts/StgCRun.c b/rts/StgCRun.c -index 92b0696c2b..4480198564 100644 ---- rts/StgCRun.c -+++ rts/StgCRun.c -@@ -749,7 +749,6 @@ StgRunIsImplementedInAssembler(void) - - #if defined(powerpc64_HOST_ARCH) - --#if defined(linux_HOST_OS) - static void GNUC3_ATTRIBUTE(used) - StgRunIsImplementedInAssembler(void) - { -@@ -871,10 +870,6 @@ StgRunIsImplementedInAssembler(void) - : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); - } - --#else // linux_HOST_OS --#error Only Linux support for power64 right now. --#endif -- - #endif - - #if defined(powerpc64le_HOST_ARCH) - - - - From f4399ce96514ab58d766de999896780e93c886c6 Mon Sep 17 00:00:00 2001 From: Peter Trommler Date: Fri, 28 Dec 2018 23:52:31 +0100 @@ -409,3 +373,93 @@ index 2f64d82ee5..82726d90d9 100644 II8 -> (1, 0, 8, gprs) II16 -> (1, 0, 8, gprs) --- CodeGen.hs.orig 2018-09-16 22:53:54.000000000 +0200 +--- libraries/ghci/GHCi/InfoTable.hsc.orig 2019-07-06 09:00:10.880579000 +0200 ++++ libraries/ghci/GHCi/InfoTable.hsc 2019-07-06 08:59:23.613439000 +0200 +@@ -77,7 +77,7 @@ data Arch = ArchSPARC + | ArchARM + | ArchARM64 + | ArchPPC64 +- | ArchPPC64LE ++ | ArchPPC64_ELFv2 + | ArchUnknown + deriving Show + +@@ -99,8 +99,8 @@ platform = + ArchARM64 + #elif defined(powerpc64_HOST_ARCH) + ArchPPC64 +-#elif defined(powerpc64le_HOST_ARCH) +- ArchPPC64LE ++#elif defined(_CALL_ELF) && (_CALL_ELF == 2) ++ ArchPPC64_ELFv2 + #else + # if defined(TABLES_NEXT_TO_CODE) + # error Unimplemented architecture +@@ -252,7 +252,7 @@ mkJumpToAddr a = case platform of + 0xE96C0010, + 0x4E800420] + +- ArchPPC64LE -> ++ ArchPPC64_ELFv2 -> + -- The ABI requires r12 to point to the function's entry point. + -- We use the medium code model where code resides in the first + -- two gigabytes, so loading a non-negative32 bit address +--- rts/StgCRun.c.orig 2019-04-07 21:39:58.000000000 +0200 ++++ rts/StgCRun.c 2019-07-06 08:57:54.735161000 +0200 +@@ -747,9 +747,8 @@ StgRunIsImplementedInAssembler(void) + Everything is in assembler, so we don't have to deal with GCC... + -------------------------------------------------------------------------- */ + +-#if defined(powerpc64_HOST_ARCH) ++#if defined(ELF_V1) + +-#if defined(linux_HOST_OS) + static void GNUC3_ATTRIBUTE(used) + StgRunIsImplementedInAssembler(void) + { +@@ -871,13 +870,9 @@ StgRunIsImplementedInAssembler(void) + : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); + } + +-#else // linux_HOST_OS +-#error Only Linux support for power64 right now. + #endif + +-#endif +- +-#if defined(powerpc64le_HOST_ARCH) ++#if defined(ELF_V2) + /* ----------------------------------------------------------------------------- + PowerPC 64 little endian architecture + +--- rts/StgCRunAsm.S.orig 2018-06-12 22:33:31.000000000 +0200 ++++ rts/StgCRunAsm.S 2019-07-06 13:29:26.837367000 +0200 +@@ -1,8 +1,7 @@ + #include "ghcconfig.h" + #include "rts/Constants.h" + +-#if defined(powerpc64le_HOST_ARCH) +-# ifdef linux_HOST_OS ++#if defined(_CALL_ELF) && (_CALL_ELF == 2) + # define STACK_FRAME_SIZE RESERVED_C_STACK_BYTES+304 + .file "StgCRun.c" + .abiversion 2 +@@ -13,6 +12,8 @@ + .hidden StgRun + .type StgRun,@function + StgRun: ++ addis %r2, %r12, .TOC.-StgRun@ha ++ addi %r2, %r2, .TOC.-StgRun@l + .localentry StgRun,.-StgRun + mflr 0 + mr 5, 1 +@@ -108,9 +109,6 @@ StgReturn: + blr + + .section .note.GNU-stack,"",@progbits +-# else // linux_HOST_OS +-# error Only Linux support for power64 little endian right now. +-# endif + + #elif defined(powerpc_HOST_ARCH) + # if defined(aix_HOST_OS) Modified: head/lang/ghc/files864/patch-ppc64 ============================================================================== --- head/lang/ghc/files864/patch-ppc64 Sun Jul 7 15:17:18 2019 (r506141) +++ head/lang/ghc/files864/patch-ppc64 Sun Jul 7 15:45:46 2019 (r506142) @@ -9,42 +9,6 @@ #endif -From cbdb2dcf8ff0702d0a52f8fc3ee0288c9dde0e92 Mon Sep 17 00:00:00 2001 -From: Peter Trommler -Date: Fri, 28 Dec 2018 22:30:34 +0100 -Subject: [PATCH] RTS: Use ELF v1 convention on all powerpc64 systems - ---- - rts/StgCRun.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/rts/StgCRun.c b/rts/StgCRun.c -index 92b0696c2b..4480198564 100644 ---- rts/StgCRun.c -+++ rts/StgCRun.c -@@ -749,7 +749,6 @@ StgRunIsImplementedInAssembler(void) - - #if defined(powerpc64_HOST_ARCH) - --#if defined(linux_HOST_OS) - static void GNUC3_ATTRIBUTE(used) - StgRunIsImplementedInAssembler(void) - { -@@ -871,10 +870,6 @@ StgRunIsImplementedInAssembler(void) - : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); - } - --#else // linux_HOST_OS --#error Only Linux support for power64 right now. --#endif -- - #endif - - #if defined(powerpc64le_HOST_ARCH) - - - - From f4399ce96514ab58d766de999896780e93c886c6 Mon Sep 17 00:00:00 2001 From: Peter Trommler Date: Fri, 28 Dec 2018 23:52:31 +0100 @@ -409,3 +373,93 @@ index 2f64d82ee5..82726d90d9 100644 II8 -> (1, 0, 8, gprs) II16 -> (1, 0, 8, gprs) --- CodeGen.hs.orig 2018-09-16 22:53:54.000000000 +0200 +--- libraries/ghci/GHCi/InfoTable.hsc.orig 2019-07-06 09:00:10.880579000 +0200 ++++ libraries/ghci/GHCi/InfoTable.hsc 2019-07-06 08:59:23.613439000 +0200 +@@ -77,7 +77,7 @@ data Arch = ArchSPARC + | ArchARM + | ArchARM64 + | ArchPPC64 +- | ArchPPC64LE ++ | ArchPPC64_ELFv2 + | ArchUnknown + deriving Show + +@@ -99,8 +99,8 @@ platform = + ArchARM64 + #elif defined(powerpc64_HOST_ARCH) + ArchPPC64 +-#elif defined(powerpc64le_HOST_ARCH) +- ArchPPC64LE ++#elif defined(_CALL_ELF) && (_CALL_ELF == 2) ++ ArchPPC64_ELFv2 + #else + # if defined(TABLES_NEXT_TO_CODE) + # error Unimplemented architecture +@@ -252,7 +252,7 @@ mkJumpToAddr a = case platform of + 0xE96C0010, + 0x4E800420] + +- ArchPPC64LE -> ++ ArchPPC64_ELFv2 -> + -- The ABI requires r12 to point to the function's entry point. + -- We use the medium code model where code resides in the first + -- two gigabytes, so loading a non-negative32 bit address +--- rts/StgCRun.c.orig 2019-04-07 21:39:58.000000000 +0200 ++++ rts/StgCRun.c 2019-07-06 08:57:54.735161000 +0200 +@@ -747,9 +747,8 @@ StgRunIsImplementedInAssembler(void) + Everything is in assembler, so we don't have to deal with GCC... + -------------------------------------------------------------------------- */ + +-#if defined(powerpc64_HOST_ARCH) ++#if defined(ELF_V1) + +-#if defined(linux_HOST_OS) + static void GNUC3_ATTRIBUTE(used) + StgRunIsImplementedInAssembler(void) + { +@@ -871,13 +870,9 @@ StgRunIsImplementedInAssembler(void) + : : "i"(RESERVED_C_STACK_BYTES+304 /*stack frame size*/)); + } + +-#else // linux_HOST_OS +-#error Only Linux support for power64 right now. + #endif + +-#endif +- +-#if defined(powerpc64le_HOST_ARCH) ++#if defined(ELF_V2) + /* ----------------------------------------------------------------------------- + PowerPC 64 little endian architecture + +--- rts/StgCRunAsm.S.orig 2018-06-12 22:33:31.000000000 +0200 ++++ rts/StgCRunAsm.S 2019-07-06 13:29:26.837367000 +0200 +@@ -1,8 +1,7 @@ + #include "ghcconfig.h" + #include "rts/Constants.h" + +-#if defined(powerpc64le_HOST_ARCH) +-# ifdef linux_HOST_OS ++#if defined(_CALL_ELF) && (_CALL_ELF == 2) + # define STACK_FRAME_SIZE RESERVED_C_STACK_BYTES+304 + .file "StgCRun.c" + .abiversion 2 +@@ -13,6 +12,8 @@ + .hidden StgRun + .type StgRun,@function + StgRun: ++ addis %r2, %r12, .TOC.-StgRun@ha ++ addi %r2, %r2, .TOC.-StgRun@l + .localentry StgRun,.-StgRun + mflr 0 + mr 5, 1 +@@ -108,9 +109,6 @@ StgReturn: + blr + + .section .note.GNU-stack,"",@progbits +-# else // linux_HOST_OS +-# error Only Linux support for power64 little endian right now. +-# endif + + #elif defined(powerpc_HOST_ARCH) + # if defined(aix_HOST_OS)