diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile index bf68f31f513d..7f99346e32db 100644 --- a/lang/ghc/Makefile +++ b/lang/ghc/Makefile @@ -1,253 +1,259 @@ PORTNAME= ghc PORTVERSION= ${GHC_VERSION} PORTREVISION?= 2 CATEGORIES= lang haskell MASTER_SITES= https://www.haskell.org/ghc/dist/${PORTVERSION}/:source \ - LOCAL/arrowd/:boot + LOCAL/arrowd/:boot \ + LOCAL/pkubaj:boot DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source MAINTAINER= haskell@FreeBSD.org COMMENT= Compiler for the functional language Haskell WWW= https://www.haskell.org/ghc/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE -ONLY_FOR_ARCHS= aarch64 amd64 +ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:math/gmp USES= autoreconf compiler:c11 gmake \ ncurses perl5 python:build shebangfix \ tar:xz GNU_CONFIGURE= yes CONFIGURE_ARGS+= --docdir=${DOCSDIR} CONFIGURE_ENV= CC=${CC} CXX=${CXX} CPP=${CPP} GHC=${BOOT_GHC} \ ALEX=/usr/bin/true HAPPY=/usr/bin/true CONFIGURE_TARGET= ${GHC_ARCH}-portbld-${OPSYS:tl} USE_LOCALE= en_US.UTF-8 NO_CCACHE= yes OPTIONS_SUB= yes SHEBANG_FILES= ${BOOT_SCRIPT} \ hadrian/bootstrap/bootstrap.py OPTIONS_DEFINE?= DYNAMIC GMP PROFILE DOCS PDFDOCS OPTIONS_DEFAULT= DYNAMIC PROFILE GMP OPTIONS_GROUP= BOOTSTRAP BOOTSTRAP_DESC= Bootsrap using installed ghc OPTIONS_GROUP_BOOTSTRAP=BOOT BOOT_DESC= Use installed GHC for bootstrapping DOCS_DESC= Build and install HTML documentation PDFDOCS_DESC= Build and install PDF documentation DYNAMIC_DESC= Add support for dynamic linking GMP_DESC= Use GNU Multi-precision Library from Ports PROFILE_DESC= Add support for performance profiling DOCS_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx DOCS_VARS= hadrian_docs_arg=--docs=no-sphinx-pdfs DOCS_VARS_OFF= hadrian_docs_arg=--docs=none PDFDOCS_IMPLIES= DOCS PDFDOCS_BUILD_DEPENDS= xelatex:print/tex-xetex \ ${LOCALBASE}/share/fonts/dejavu/DejaVuSans.ttf:x11-fonts/dejavu PDFDOCS_VARS= hadrian_docs_arg= DYNAMIC_CONFIGURE_WITH= system-libffi DYNAMIC_CONFIGURE_ON= --with-ffi-includes=${LOCALBASE}/include \ --with-ffi-libraries=${LOCALBASE}/lib DYNAMIC_LIB_DEPENDS= libffi.so:devel/libffi DYNAMIC_OFF_FLAVOUR?= +no_dynamic_ghc+fully_static # do not replace this with GMP_CONFIGURE_WITH # it adds "--without-gmp-*" when the option is OFF, which results in "no" value # to be used as directory name GMP_CONFIGURE_ON= --with-gmp-includes=${LOCALBASE}/include \ --with-gmp-libraries=${LOCALBASE}/lib GMP_LIB_DEPENDS= libgmp.so:math/gmp GMP_VARS_OFF= hadrian_gmp_arg=--bignum=native PROFILE_OFF_FLAVOUR= +no_profiled_libs GHC_VERSION?= 9.10.3 LLVM_VERSION?= 15 BOOT_GHC_VERSION?= 9.6.7 # LLVM version that bootstrap compiler uses BOOT_LLVM_VERSION?= 12 BASE_PACKAGES?= Cabal-3.12.1.0 array-0.5.8.0 base-4.20.2.0 binary-0.8.9.3 \ bytestring-0.12.2.0 containers-0.7 deepseq-1.5.0.0 \ directory-1.3.8.5 exceptions-0.10.9 filepath-1.5.4.0 \ ghc-${GHC_VERSION} ghc-bignum-1.3 ghc-compact-0.1.0.0 \ ghc-experimental-9.1003.0 ghc-internal-9.1003.0 \ ghc-platform-0.1.0.0 ghc-prim-0.12.0 ghc-toolchain-0.1.0.0 \ haskeline-0.8.2.1 hpc-0.7.0.2 integer-gmp-1.1 mtl-2.3.1 \ os-string-2.0.7 parsec-3.1.18.0 pretty-1.1.3.6 \ process-1.6.26.1 stm-2.5.3.1 semaphore-compat-1.0.0 \ template-haskell-2.22.0.0 terminfo-0.4.1.7 text-2.1.3 \ time-1.12.2 transformers-0.6.1.1 unix-2.8.7.0 \ xhtml-3000.2.2.1 .for pkg in ${BASE_PACKAGES} PLIST_SUB+= ${pkg:C/-([0-9.])+//:tu}_VERSION=${pkg:C/^([^\.]*-)+//} .endfor PLIST_SUB+= GHC_ARCH=${GHC_ARCH} .include .if ${OSVERSION} >= 1500000 BUILD_DEPENDS+= ${LOCALBASE}/lib/compat/libutil.so.9:misc/compat14x .endif # GHC 9.2 has a different name for this BOOT_SCRIPT?= ./boot.source .if ${SLAVE_PORT} != "yes" PORTDOCS= * .else HADRIAN_DOCS_ARG= --docs=none PLIST_SUB+= GMP= .endif HADRIAN_FLAVOUR_ARG= --flavour=default .if !${PORT_OPTIONS:MDYNAMIC} HADRIAN_FLAVOUR_ARG:= ${HADRIAN_FLAVOUR_ARG}${DYNAMIC_OFF_FLAVOUR} .endif .if !${PORT_OPTIONS:MPROFILE} HADRIAN_FLAVOUR_ARG:= ${HADRIAN_FLAVOUR_ARG}${PROFILE_OFF_FLAVOUR} .endif HADRIAN_PLAN= ${WRKSRC}/hadrian/bootstrap/plan-bootstrap-${BOOT_GHC_VERSION:C/\./_/g}.json HADRIAN_CMD= ${WRKSRC}/hadrian/bootstrap/_build/bin/hadrian \ ${HADRIAN_DOCS_ARG} \ ${HADRIAN_GMP_ARG} \ ${HADRIAN_FLAVOUR_ARG} 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/} +GHC_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/:S/powerpc64le/ppc64/} BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-${CONFIGURE_TARGET} BOOT_INSTALL_DIR= ${WRKDIR}/ghc-boot-install .if ! ${PORT_OPTIONS:MBOOT} DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot BOOT_GHC= ${BOOT_INSTALL_DIR}/bin/ghc-${BOOT_GHC_VERSION} .else # Allow to be overriden by user when using the BOOT option BOOT_GHC?= ${LOCALBASE}/bin/ghc .endif # MBOOT +HADRIAN_BOOT_TARBALL?= hadrian-${GHC_VERSION}-boot.tar.gz + .if !defined(IGNORE_MISSING_HADRIAN) -DISTFILES+= hadrian-${GHC_VERSION}-boot.tar.gz:boot +DISTFILES+= ${HADRIAN_BOOT_TARBALL}:boot .endif .if ${ARCH} == aarch64 CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf} CONFIGURE_ARGS+= --host=${CONFIGURE_TARGET} +.elif ${ARCH} == powerpc64le +CONFIGURE_TARGET= ${ARCH}-unknown-freebsd +CONFIGURE_ARGS+= --host=${CONFIGURE_TARGET} .endif pre-configure: # Call the bootstrap script cd ${WRKSRC} && ${BOOT_SCRIPT} .if ! ${PORT_OPTIONS:MBOOT} # 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 .endif pre-build: .if ! ${PORT_OPTIONS:MBOOT} # Compile Hadrian using the bootstrap compiler and bootstrap Hadrian distfile cd ${WRKSRC}/hadrian/bootstrap && \ - ./bootstrap.py -w ${BOOT_GHC} -s ${DISTDIR}/hadrian-${GHC_VERSION}-boot.tar.gz + ./bootstrap.py -w ${BOOT_GHC} -s ${DISTDIR}/${HADRIAN_BOOT_TARBALL} .else # Otherwise, use whatever GHC and Hadrian plan the user wants . if !exists(${BOOT_GHC}) @${ECHO_CMD} "===> BOOT_GHC ${BOOT_GHC} does not exist" @${ECHO_CMD} "Re-run make BOOT_GHC=/path/to/correct/ghc" @${FALSE} . endif . if !exists(${HADRIAN_PLAN}) @${ECHO_CMD} "===> HADRIAN_PLAN ${HADRIAN_PLAN} does not exist" @${ECHO_CMD} "Run ls ${WRKSRC}/hadrian/bootstrap to see available plans" @${ECHO_CMD} "Pick one closest to ${BOOT_GHC} ," @${ECHO_CMD} "hack if needed, run make HADRIAN_PLAN=/path/to/plan.json" @${FALSE} . endif cd ${WRKSRC}/hadrian/bootstrap && \ ./bootstrap.py -w ${BOOT_GHC} --deps ${HADRIAN_PLAN} .endif pre-install: cd ${INSTALL_WRKSRC} && ${CONFIGURE_CMD} ${CONFIGURE_ENV} --prefix=${PREFIX} post-install: # Hadrian doesn't have --docdir ${MV} ${STAGEDIR}${DOCSDIR}-${GHC_VERSION} ${STAGEDIR}${DOCSDIR} # These includes are duplicated in lib/ghc-X.Y.Z/lib//rts-X.Y.Z/include ${RM} -r ${STAGEDIR}${PREFIX}/include/* ${FIND} ${STAGEDIR}${DOCSDIR} -name .buildinfo -delete ${FIND} ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} -type f -perm +111 -not -name '*js' -exec ${STRIP_CMD} {} + .if ${SLAVE_PORT} == "yes" # Do not install docs for slave GHCs ${FIND} ${STAGEDIR}${PREFIX}/bin -not -type d -not -regex '.*-${GHC_VERSION}' -delete ${RM} -r ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION}/html ${RM} -r ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION}/latex .endif post-install-DOCS-off: ${RM} -r ${STAGEDIR}${DOCSDIR}/html # Create a bootstrap compiler tar ball: run this in an interactive poudriere jail # Set all OPTIONS to OFF when generating bootstraps .PHONY: create-bootstrap create-bootstrap: cd ${WRKSRC} \ && ${HADRIAN_CMD} binary-dist-xz \ && ${MV} ${WRKSRC}/_build/bindist/ghc-${GHC_VERSION}-${CONFIGURE_TARGET}.tar.xz /tmp/ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz @cd /tmp \ && sha256 ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz \ && ${ECHO_CMD} -n "SIZE (ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz) = " \ && ${STAT} -f %z ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz # Much like create-bootstrap, just different naming and output format # Set DYNAMIC, GMP and PROFILE to ON, and DOCS to OFF when generating Stack bindist .PHONY: create-stack-bindist create-stack-bindist: cd ${WRKSRC} \ && ${HADRIAN_CMD} binary-dist-xz \ && ${MV} ${WRKSRC}/_build/bindist/ghc-${GHC_VERSION}-${GHC_ARCH}-portbld-freebsd.tar.xz /tmp/ @cd /tmp \ && ${ECHO_CMD} "${GHC_VERSION}:" \ && ${ECHO_CMD} "url: \"http://distcache.FreeBSD.org/local-distfiles/arrowd/stack-bindists/ghc-${GHC_VERSION}-${GHC_ARCH}-portbld-freebsd.tar.xz\"" \ && ${ECHO_CMD} -n "content-length: " \ && ${STAT} -f %z ghc-${GHC_VERSION}-${GHC_ARCH}-portbld-freebsd.tar.xz \ && ${ECHO_CMD} -n "sha1: " \ && sha1 -q ghc-${GHC_VERSION}-${GHC_ARCH}-portbld-freebsd.tar.xz \ && ${ECHO_CMD} -n "sha256: " \ && sha256 -q ghc-${GHC_VERSION}-${GHC_ARCH}-portbld-freebsd.tar.xz .PHONY: create-hadrian-bootstrap create-hadrian-bootstrap: ${MAKE} -C ${.CURDIR} patch build-depends USE_PACKAGE_DEPENDS_ONLY=yes IGNORE_MISSING_HADRIAN=yes cd ${WRKSRC}/hadrian/bootstrap && \ ./bootstrap.py -w ${BOOT_GHC} --deps ${HADRIAN_PLAN} fetch -o /tmp/hadrian-${GHC_VERSION}-boot @cd /tmp \ && sha256 hadrian-${GHC_VERSION}-boot.tar.gz \ && ${ECHO_CMD} -n "SIZE (hadrian-${GHC_VERSION}-boot.tar.gz) = " \ && ${STAT} -f %z hadrian-${GHC_VERSION}-boot.tar.gz @${ECHO_CMD} @${ECHO_CMD} "Remember to check that hadrian bootstrap builds fine by running \"make check-hadrian-bootstrap\"" .PHONY: check-hadrian-bootstrap check-hadrian-bootstrap: cd ${WRKSRC}/hadrian/bootstrap && \ ./bootstrap.py -w ${BOOT_GHC} -s /tmp/hadrian-${GHC_VERSION}-boot.tar.gz .include diff --git a/lang/ghc/distinfo b/lang/ghc/distinfo index 762c0bfbaf24..b7888aa0468d 100644 --- a/lang/ghc/distinfo +++ b/lang/ghc/distinfo @@ -1,29 +1,33 @@ TIMESTAMP = 1760118652 SHA256 (ghc-9.10.3-src.tar.xz) = d266864b9e0b7b741abe8c9d6a790d7c01c21cf43a1419839119255878ebc59a SIZE (ghc-9.10.3-src.tar.xz) = 32959164 SHA256 (ghc-9.8.4-src.tar.xz) = 17e8188f3c8a5c2f73fb4e35d01032e8dc258835ec876d52c8ad8ee3d24b2fc5 SIZE (ghc-9.8.4-src.tar.xz) = 32615492 SHA256 (ghc-9.6.7-src.tar.xz) = d053bf6ce1d588a75cfe8c9316269486e9d8fb89dcdf6fd92836fa2e3df61305 SIZE (ghc-9.6.7-src.tar.xz) = 31770824 SHA256 (ghc-9.4.8-src.tar.xz) = 0bf407eb67fe3e3c24b0f4c8dea8cb63e07f63ca0f76cf2058565143507ab85e SIZE (ghc-9.4.8-src.tar.xz) = 28655220 SHA256 (ghc-9.2.8-src.tar.xz) = 5f13d1786bf4fd12f4b45faa37abedb5bb3f36d5e58f7da5307e8bfe88a567a1 SIZE (ghc-9.2.8-src.tar.xz) = 24661260 SHA256 (hadrian-9.10.3-boot.tar.gz) = a1faeba153b2a6d18882e750727284cbb560ee576413df98af3c0600d276c39a SIZE (hadrian-9.10.3-boot.tar.gz) = 1451082 SHA256 (hadrian-9.8.4-boot.tar.gz) = 2fb02cce43603552387a241ece60a656fb8f4c97a9001134fd1c43f37e20906e SIZE (hadrian-9.8.4-boot.tar.gz) = 1582315 SHA256 (hadrian-9.6.7-boot.tar.gz) = f81dc59b4aef59c62c645da7be0b1fb8720aba338c80004963a99bc1219d3a05 SIZE (hadrian-9.6.7-boot.tar.gz) = 1495514 SHA256 (hadrian-9.4.8-boot.tar.gz) = 5eb060655686921b086645dcbdd6268f09bc66baf8cc76fce74dea9b8b55ab5d SIZE (hadrian-9.4.8-boot.tar.gz) = 1495586 SHA256 (hadrian-9.2.8-boot.tar.gz) = 21a5154159dd89c09246646c82b5ccfc0c0963d45459cb0e59709a549272c8c7 SIZE (hadrian-9.2.8-boot.tar.gz) = 1495573 SHA256 (ghc-9.6.7-boot-amd64-freebsd.tar.xz) = d55285c5998f3f040f52e159bc3b381ddd969a64670bf6630838fde2a84eb7c6 SIZE (ghc-9.6.7-boot-amd64-freebsd.tar.xz) = 125512852 SHA256 (ghc-9.2.8-boot-amd64-freebsd.tar.xz) = 8b172a963e316a57906edb7914be765021337a685e578bc3303db072aee3eb16 SIZE (ghc-9.2.8-boot-amd64-freebsd.tar.xz) = 117864544 SHA256 (ghc-9.6.7-boot-aarch64-freebsd.tar.xz) = 0c5abc06413c081240ab471592c78e350d1e0fcaf81559c25f3030dfa287ceb6 SIZE (ghc-9.6.7-boot-aarch64-freebsd.tar.xz) = 132563424 SHA256 (ghc-9.2.8-boot-aarch64-freebsd.tar.xz) = 23da026e3a9f1a4569aa7a464be016fc39b05afc9209e0d7662e151260b4964c SIZE (ghc-9.2.8-boot-aarch64-freebsd.tar.xz) = 124830556 +SHA256 (ghc-9.6.7-boot-powerpc64le-freebsd.tar.xz) = 0090b3a8d2420af339b94d8df140ce5969da9bd1c664f8e906b796d324577434 +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 diff --git a/lang/ghc/files/patch-rts_StgCRunAsm.S b/lang/ghc/files/patch-rts_StgCRunAsm.S new file mode 100644 index 000000000000..838a8222eb42 --- /dev/null +++ b/lang/ghc/files/patch-rts_StgCRunAsm.S @@ -0,0 +1,106 @@ +--- rts/StgCRunAsm.S.orig ++++ rts/StgCRunAsm.S +@@ -6,7 +6,7 @@ + #if !defined(USE_MINIINTERPRETER) + + #if defined(powerpc64le_HOST_ARCH) +-# if defined(linux_HOST_OS) ++# if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) + /* 64-bit PowerPC ELF V2 ABI Revision 1.4 + * + * Stack frame organization (see Figure 2.18, ELF V2 ABI Revision 1.4, p 31) +@@ -66,6 +66,94 @@ + addi 12,1,-(8*18) + bl _restgpr1_14 + b _restfpr_14 ++# if defined(freebsd_HOST_OS) ++/* GNU ld synthesizes the ELFv2 out-of-line register save/restore ++ * routines that StgRun/StgReturn call above; clang/lld do not. Provide ++ * them here. Bodies match the GNU ld (binutils 2.44) synthesis. */ ++_savegpr1_14: ++ std 14,-144(12) ++ std 15,-136(12) ++ std 16,-128(12) ++ std 17,-120(12) ++ std 18,-112(12) ++ std 19,-104(12) ++ std 20,-96(12) ++ std 21,-88(12) ++ std 22,-80(12) ++ std 23,-72(12) ++ std 24,-64(12) ++ std 25,-56(12) ++ std 26,-48(12) ++ std 27,-40(12) ++ std 28,-32(12) ++ std 29,-24(12) ++ std 30,-16(12) ++ std 31,-8(12) ++ blr ++_savefpr_14: ++ stfd 14,-144(1) ++ stfd 15,-136(1) ++ stfd 16,-128(1) ++ stfd 17,-120(1) ++ stfd 18,-112(1) ++ stfd 19,-104(1) ++ stfd 20,-96(1) ++ stfd 21,-88(1) ++ stfd 22,-80(1) ++ stfd 23,-72(1) ++ stfd 24,-64(1) ++ stfd 25,-56(1) ++ stfd 26,-48(1) ++ stfd 27,-40(1) ++ stfd 28,-32(1) ++ stfd 29,-24(1) ++ stfd 30,-16(1) ++ stfd 31,-8(1) ++ std 0,16(1) ++ blr ++_restgpr1_14: ++ ld 14,-144(12) ++ ld 15,-136(12) ++ ld 16,-128(12) ++ ld 17,-120(12) ++ ld 18,-112(12) ++ ld 19,-104(12) ++ ld 20,-96(12) ++ ld 21,-88(12) ++ ld 22,-80(12) ++ ld 23,-72(12) ++ ld 24,-64(12) ++ ld 25,-56(12) ++ ld 26,-48(12) ++ ld 27,-40(12) ++ ld 28,-32(12) ++ ld 29,-24(12) ++ ld 30,-16(12) ++ ld 31,-8(12) ++ blr ++_restfpr_14: ++ lfd 14,-144(1) ++ lfd 15,-136(1) ++ lfd 16,-128(1) ++ lfd 17,-120(1) ++ lfd 18,-112(1) ++ lfd 19,-104(1) ++ lfd 20,-96(1) ++ lfd 21,-88(1) ++ lfd 22,-80(1) ++ lfd 23,-72(1) ++ lfd 24,-64(1) ++ lfd 25,-56(1) ++ lfd 26,-48(1) ++ lfd 27,-40(1) ++ lfd 28,-32(1) ++ ld 0,16(1) ++ lfd 29,-24(1) ++ mtlr 0 ++ lfd 30,-16(1) ++ lfd 31,-8(1) ++ blr ++# endif + # else // linux_HOST_OS + # error Only Linux support for power64 little endian right now. + # endif diff --git a/lang/ghc96/Makefile b/lang/ghc96/Makefile index 4bd0b9bddab9..5074beeb920b 100644 --- a/lang/ghc96/Makefile +++ b/lang/ghc96/Makefile @@ -1,24 +1,30 @@ PORTREVISION= 0 PKGNAMESUFFIX= 96 OPTIONS_DEFINE= DYNAMIC GMP PROFILE GHC_VERSION= 9.6.7 LLVM_VERSION= 15 BASE_PACKAGES= Cabal-3.10.3.0 array-0.5.8.0 base-4.18.3.0 binary-0.8.9.1 \ bytestring-0.11.5.4 containers-0.6.7 deepseq-1.4.8.1 \ directory-1.3.8.5 exceptions-0.10.7 filepath-1.4.301.0 \ ghc-${GHC_VERSION} ghc-bignum-1.3 ghc-compact-0.1.0.0 \ ghc-prim-0.10.0 haskeline-0.8.2.1 hpc-0.6.2.0 \ integer-gmp-1.1 mtl-2.3.1 parsec-3.1.16.1 pretty-1.1.3.6 \ process-1.6.19.0 stm-2.5.1.0 template-haskell-2.20.0.0 \ terminfo-0.4.1.6 text-2.0.2 time-1.12.2 \ transformers-0.6.1.0 unix-2.8.6.0 xhtml-3000.2.2.1 -BOOT_GHC_VERSION= 9.2.8 BOOT_LLVM_VERSION= 12 MASTERDIR= ${.CURDIR}/../ghc PATCHDIR= ${.CURDIR}/files PLIST= ${.CURDIR}/pkg-plist +.if ${ARCH} == powerpc64le +BOOT_GHC_VERSION= 9.6.7 +HADRIAN_BOOT_TARBALL= hadrian-9.6.7-boot-powerpc64le.tar.gz +.else +BOOT_GHC_VERSION= 9.2.8 +.endif + .include "${MASTERDIR}/Makefile" diff --git a/lang/ghc96/files/patch-rts_StgCRunAsm.S b/lang/ghc96/files/patch-rts_StgCRunAsm.S new file mode 100644 index 000000000000..838a8222eb42 --- /dev/null +++ b/lang/ghc96/files/patch-rts_StgCRunAsm.S @@ -0,0 +1,106 @@ +--- rts/StgCRunAsm.S.orig ++++ rts/StgCRunAsm.S +@@ -6,7 +6,7 @@ + #if !defined(USE_MINIINTERPRETER) + + #if defined(powerpc64le_HOST_ARCH) +-# if defined(linux_HOST_OS) ++# if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) + /* 64-bit PowerPC ELF V2 ABI Revision 1.4 + * + * Stack frame organization (see Figure 2.18, ELF V2 ABI Revision 1.4, p 31) +@@ -66,6 +66,94 @@ + addi 12,1,-(8*18) + bl _restgpr1_14 + b _restfpr_14 ++# if defined(freebsd_HOST_OS) ++/* GNU ld synthesizes the ELFv2 out-of-line register save/restore ++ * routines that StgRun/StgReturn call above; clang/lld do not. Provide ++ * them here. Bodies match the GNU ld (binutils 2.44) synthesis. */ ++_savegpr1_14: ++ std 14,-144(12) ++ std 15,-136(12) ++ std 16,-128(12) ++ std 17,-120(12) ++ std 18,-112(12) ++ std 19,-104(12) ++ std 20,-96(12) ++ std 21,-88(12) ++ std 22,-80(12) ++ std 23,-72(12) ++ std 24,-64(12) ++ std 25,-56(12) ++ std 26,-48(12) ++ std 27,-40(12) ++ std 28,-32(12) ++ std 29,-24(12) ++ std 30,-16(12) ++ std 31,-8(12) ++ blr ++_savefpr_14: ++ stfd 14,-144(1) ++ stfd 15,-136(1) ++ stfd 16,-128(1) ++ stfd 17,-120(1) ++ stfd 18,-112(1) ++ stfd 19,-104(1) ++ stfd 20,-96(1) ++ stfd 21,-88(1) ++ stfd 22,-80(1) ++ stfd 23,-72(1) ++ stfd 24,-64(1) ++ stfd 25,-56(1) ++ stfd 26,-48(1) ++ stfd 27,-40(1) ++ stfd 28,-32(1) ++ stfd 29,-24(1) ++ stfd 30,-16(1) ++ stfd 31,-8(1) ++ std 0,16(1) ++ blr ++_restgpr1_14: ++ ld 14,-144(12) ++ ld 15,-136(12) ++ ld 16,-128(12) ++ ld 17,-120(12) ++ ld 18,-112(12) ++ ld 19,-104(12) ++ ld 20,-96(12) ++ ld 21,-88(12) ++ ld 22,-80(12) ++ ld 23,-72(12) ++ ld 24,-64(12) ++ ld 25,-56(12) ++ ld 26,-48(12) ++ ld 27,-40(12) ++ ld 28,-32(12) ++ ld 29,-24(12) ++ ld 30,-16(12) ++ ld 31,-8(12) ++ blr ++_restfpr_14: ++ lfd 14,-144(1) ++ lfd 15,-136(1) ++ lfd 16,-128(1) ++ lfd 17,-120(1) ++ lfd 18,-112(1) ++ lfd 19,-104(1) ++ lfd 20,-96(1) ++ lfd 21,-88(1) ++ lfd 22,-80(1) ++ lfd 23,-72(1) ++ lfd 24,-64(1) ++ lfd 25,-56(1) ++ lfd 26,-48(1) ++ lfd 27,-40(1) ++ lfd 28,-32(1) ++ ld 0,16(1) ++ lfd 29,-24(1) ++ mtlr 0 ++ lfd 30,-16(1) ++ lfd 31,-8(1) ++ blr ++# endif + # else // linux_HOST_OS + # error Only Linux support for power64 little endian right now. + # endif