mirror of
https://git.freebsd.org/ports.git
synced 2026-06-02 11:08:52 +00:00
lang/ghc{,96}: port to powerpc64
1. In the Makefile, switch ARCH == powerpc64le to ARCH:Mpowerpc64*, 2. Add some additional ARCH == powerpc64 for switching to ELFv2, since GHC assumes powerpc64 is ELFv1. 3. Add additional patch to disable ELFv1 code in StgCRun.c. Bootstrap is built against 14.3-RELEASE. PR: 295675 Approved by: arrowd@
This commit is contained in:
+16
-4
@@ -14,7 +14,7 @@ WWW= https://www.haskell.org/ghc/
|
||||
LICENSE= BSD3CLAUSE
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le
|
||||
ONLY_FOR_ARCHS= aarch64 amd64 powerpc64 powerpc64le
|
||||
|
||||
BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:math/gmp
|
||||
|
||||
@@ -131,7 +131,7 @@ DO_MAKE_BUILD= ${SETENVI} ${WRK_ENV} ${HADRIAN_CMD} ${_MAKE_JOBS}
|
||||
ALL_TARGET= binary-dist-dir
|
||||
INSTALL_WRKSRC= ${WRKSRC}/_build/bindist/ghc-${GHC_VERSION}-${CONFIGURE_TARGET}
|
||||
|
||||
GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/:S/powerpc64le/ppc64/}
|
||||
GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/:C/powerpc64.*/ppc64/}
|
||||
BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-${CONFIGURE_TARGET}
|
||||
BOOT_INSTALL_DIR= ${WRKDIR}/ghc-boot-install
|
||||
|
||||
@@ -152,12 +152,12 @@ DISTFILES+= ${HADRIAN_BOOT_TARBALL}:boot
|
||||
.if ${ARCH} == aarch64
|
||||
CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf}
|
||||
CONFIGURE_ARGS+= --host=${CONFIGURE_TARGET}
|
||||
.elif ${ARCH} == powerpc64le
|
||||
.elif ${ARCH:Mpowerpc64*}
|
||||
CONFIGURE_TARGET= ${ARCH}-unknown-freebsd
|
||||
CONFIGURE_ARGS+= --host=${CONFIGURE_TARGET}
|
||||
.endif
|
||||
|
||||
.if ${ARCH} == powerpc64le && ${GHC_VERSION} == 9.6.7
|
||||
.if ${ARCH:Mpowerpc64*} && ${GHC_VERSION} == 9.6.7
|
||||
BOOT_GHC_VERSION= 9.6.7
|
||||
HADRIAN_BOOT_TARBALL= hadrian-9.6.7-boot-powerpc64le.tar.gz
|
||||
.endif
|
||||
@@ -169,9 +169,21 @@ pre-configure:
|
||||
# If we are using bootstrap compiler, configure and install it into ${BOOT_DIR}
|
||||
cd ${BOOT_DIR} && ${SETENVI} ${CONFIGURE_ENV} ${CONFIGURE_CMD} --prefix=${BOOT_INSTALL_DIR}
|
||||
cd ${BOOT_DIR} && ${SETENVI} ${WRK_ENV} ${GMAKE} PACKAGES='' install
|
||||
.if ${ARCH} == powerpc64
|
||||
# Boot's settings are generated by configure which maps `powerpc64` to ELF_V1,
|
||||
# but FreeBSD ppc64 is ELFv2; flip so the boot's NCG dispatches correctly.
|
||||
${REINPLACE_CMD} -e 's|ArchPPC_64 ELF_V1|ArchPPC_64 ELF_V2|g' \
|
||||
${BOOT_INSTALL_DIR}/lib/ghc-${BOOT_GHC_VERSION}/lib/settings
|
||||
.endif
|
||||
.endif
|
||||
|
||||
pre-build:
|
||||
.if ${ARCH} == powerpc64
|
||||
# FreeBSD ppc64 BE is ELFv2, but GHC's configure hardcodes powerpc64 -> ELF_V1.
|
||||
${REINPLACE_CMD} -e 's|ArchPPC_64 ELF_V1|ArchPPC_64 ELF_V2|g' \
|
||||
${WRKSRC}/hadrian/cfg/default.target \
|
||||
${WRKSRC}/hadrian/cfg/default.host.target
|
||||
.endif
|
||||
.if ! ${PORT_OPTIONS:MBOOT}
|
||||
# Compile Hadrian using the bootstrap compiler and bootstrap Hadrian distfile
|
||||
cd ${WRKSRC}/hadrian/bootstrap && \
|
||||
|
||||
@@ -31,3 +31,5 @@ SHA256 (ghc-9.6.7-boot-powerpc64le-freebsd.tar.xz) = 0090b3a8d2420af339b94d8df14
|
||||
SIZE (ghc-9.6.7-boot-powerpc64le-freebsd.tar.xz) = 142326376
|
||||
SHA256 (hadrian-9.6.7-boot-powerpc64le.tar.gz) = 46b51e5929b3cd1f7c0a30ad5d4fd689d4d10fe555cb6350df80e1dcd78e2e19
|
||||
SIZE (hadrian-9.6.7-boot-powerpc64le.tar.gz) = 1500047
|
||||
SHA256 (ghc-9.6.7-boot-powerpc64-freebsd.tar.xz) = d2f09f4fbd06169891664d7598e51d4615003c2879eec92d0f022e25e99c5cc0
|
||||
SIZE (ghc-9.6.7-boot-powerpc64-freebsd.tar.xz) = 136217048
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- rts/StgCRun.c.orig
|
||||
+++ rts/StgCRun.c
|
||||
@@ -670,7 +670,7 @@
|
||||
Everything is in assembler, so we don't have to deal with GCC...
|
||||
-------------------------------------------------------------------------- */
|
||||
|
||||
-#if defined(powerpc64_HOST_ARCH)
|
||||
+#if defined(powerpc64_HOST_ARCH) && !defined(freebsd_HOST_OS)
|
||||
/* 64-bit PowerPC ELF ABI 1.9
|
||||
*
|
||||
* Stack frame organization (see Figure 3-17, ELF ABI 1.9, p 14)
|
||||
@@ -3,8 +3,9 @@
|
||||
@@ -6,7 +6,7 @@
|
||||
#if !defined(USE_MINIINTERPRETER)
|
||||
|
||||
#if defined(powerpc64le_HOST_ARCH)
|
||||
-#if defined(powerpc64le_HOST_ARCH)
|
||||
-# if defined(linux_HOST_OS)
|
||||
+#if defined(powerpc64le_HOST_ARCH) || defined(powerpc64_HOST_ARCH)
|
||||
+# if defined(linux_HOST_OS) || defined(freebsd_HOST_OS)
|
||||
/* 64-bit PowerPC ELF V2 ABI Revision 1.4
|
||||
*
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- rts/StgCRun.c.orig
|
||||
+++ rts/StgCRun.c
|
||||
@@ -670,7 +670,7 @@
|
||||
Everything is in assembler, so we don't have to deal with GCC...
|
||||
-------------------------------------------------------------------------- */
|
||||
|
||||
-#if defined(powerpc64_HOST_ARCH)
|
||||
+#if defined(powerpc64_HOST_ARCH) && !defined(freebsd_HOST_OS)
|
||||
/* 64-bit PowerPC ELF ABI 1.9
|
||||
*
|
||||
* Stack frame organization (see Figure 3-17, ELF ABI 1.9, p 14)
|
||||
@@ -3,8 +3,9 @@
|
||||
@@ -6,7 +6,7 @@
|
||||
#if !defined(USE_MINIINTERPRETER)
|
||||
|
||||
#if defined(powerpc64le_HOST_ARCH)
|
||||
-#if defined(powerpc64le_HOST_ARCH)
|
||||
-# if defined(linux_HOST_OS)
|
||||
+#if defined(powerpc64le_HOST_ARCH) || defined(powerpc64_HOST_ARCH)
|
||||
+# if defined(linux_HOST_OS) || defined(freebsd_HOST_OS)
|
||||
/* 64-bit PowerPC ELF V2 ABI Revision 1.4
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user