On Sat, Dec 02, 2023 at 08:46:11PM +0000, Brian Callahan wrote:
> Hi ports --
> 
> Attached is a new port for the Hare programming language. Support for
> OpenBSD was just announced.
> 
> This is good enough to compile the Hello world example on the main
> harelang.org. The port itself is a snapshot I just made of the mainline
> code, making sure to include some additional improvements from tobhe@
> that just hit their tree.
> 
> Specifically looking for arm64 and riscv64 testing. I've only been able
> to test it on amd64. I believe some tweaks will be needed for the other
> archs.
> 
> There are a small number of tests that fail, and one that segfaults, but
> as support is brand new, I don't think that's necessarily a showstopper.
> 
> OK?
> 
> ~Brian

arm64 needs a little more work

1. We need to fix the _start hook, I submitted a fix upstream at
https://lists.sr.ht/~sircmpwn/hare-dev/patches/47286

2. config.mk hardcodes amd64 and always treats arm and riscv as if
it was cross compiled. we need to change this to work for natively

This works on arm64:

diff -Nru hare/hare/Makefile hare2/hare/Makefile
--- hare/hare/Makefile  Sat Dec  2 21:34:50 2023
+++ hare2/hare/Makefile Sat Dec  2 22:53:42 2023
@@ -13,5 +13,8 @@
 
 do-gen:
        cp ${WRKSRC}/configs/openbsd.mk ${WRKSRC}/config.mk
+       sed -i "s/aarch64-//g" ${WRKSRC}/config.mk
+       sed -i "s/riscv64-//g" ${WRKSRC}/config.mk
+       echo "ARCH = $$(arch -s)" >> ${WRKSRC}/config.mk
 
 .include <bsd.port.mk>
diff -Nru hare/harec/patches/patch-rt_+openbsd_start+aarch64_s 
hare2/harec/patches/patch-rt_+openbsd_start+aarch64_s
--- hare/harec/patches/patch-rt_+openbsd_start+aarch64_s        Thu Jan  1 
01:00:00 1970
+++ hare2/harec/patches/patch-rt_+openbsd_start+aarch64_s       Sat Dec  2 
22:25:37 2023
@@ -0,0 +1,9 @@
+Index: rt/+openbsd/start+aarch64.s
+--- rt/+openbsd/start+aarch64.s.orig
++++ rt/+openbsd/start+aarch64.s
+@@ -5,5 +5,4 @@ _start:
+       mov x30, #0
+       mov x0, sp
+       add sp, x0, #-16
+-      and sp, sp, #-16
+       b rt.start_ha

Reply via email to