On Sat, Dec 18 2021, Jeremie Courreges-Anglas <j...@wxcvbn.org> wrote: > On Sat, Dec 18 2021, Anil Madhavapeddy <a...@recoil.org> wrote: >> On 17 Dec 2021, at 17:48, Daniel Dickman <didick...@gmail.com> wrote: >>> >>> >>> >>>> On Dec 17, 2021, at 12:21 PM, Jeremie Courreges-Anglas <j...@wxcvbn.org> >>>> wrote: >>>> >>>> On Sat, Dec 04 2021, Daniel Dickman <didick...@gmail.com> wrote: >>>>> See below for a diff for ocaml to the 4.12.x series. Only a few changes >>>>> were needed for this update and they're already in the tree: >>>>> - mldonkey and unison 2.4.x needed a small diff >>>>> - dune needed to be updated to 2.7.0 >>>>> >>>>> All ocaml ports were built successfully on amd64 (except coccinelle which >>>>> is still broken). >>>> >>>> This update doesn't package on sparc64 and riscv64 - and likely all >>>> non-native archs. The diff below fixes this for me, and seems to be >>>> correct. IIUC the compilation of those two files is hooked from ASMCOMP >>>> in ./compilerlibs/Makefile.compilerlibs. >>>> >>>> ok? >>>> >>> >>> Ok daniel@ and thank you for testing this! >> >> This looks right to me. > > Thanks for confirming. > >> Although if you have RISC-V hardware, you could >> also try adding riscv64 to OCAML_NATIVE_ARCHS and >> OCAML_NATIVE_DYNLINK_ARCHS in arch-defines.mk and seeing how >> that gets along. Most things should just work with native riscv OCaml. > > I think I had already tried with 4.11 and it fails with assembly errors.
btw, the diff I used in my last attempt. For natdynlink support configure.ac would need another addition. Index: infrastructure/mk/arch-defines.mk =================================================================== RCS file: /cvs/ports/infrastructure/mk/arch-defines.mk,v retrieving revision 1.88 diff -u -p -r1.88 arch-defines.mk --- infrastructure/mk/arch-defines.mk 6 Dec 2021 12:47:51 -0000 1.88 +++ infrastructure/mk/arch-defines.mk 13 Dec 2021 00:33:13 -0000 @@ -24,8 +24,8 @@ GCC4_ARCHS = alpha hppa sh sparc64 GCC3_ARCHS = m88k # XXX easier for ports that depend on mono MONO_ARCHS = aarch64 amd64 i386 -OCAML_NATIVE_ARCHS = aarch64 amd64 i386 -OCAML_NATIVE_DYNLINK_ARCHS = aarch64 amd64 i386 +OCAML_NATIVE_ARCHS = aarch64 amd64 i386 riscv64 +OCAML_NATIVE_DYNLINK_ARCHS = aarch64 amd64 i386 riscv64 GO_ARCHS = aarch64 amd64 arm armv7 i386 mips64 RUST_ARCHS = aarch64 amd64 i386 sparc64 Index: lang/ocaml/patches/patch-configure_ac =================================================================== RCS file: /cvs/ports/lang/ocaml/patches/patch-configure_ac,v retrieving revision 1.6 diff -u -p -r1.6 patch-configure_ac --- lang/ocaml/patches/patch-configure_ac 10 Dec 2021 04:10:59 -0000 1.6 +++ lang/ocaml/patches/patch-configure_ac 18 Dec 2021 18:11:53 -0000 @@ -28,7 +28,7 @@ Index: configure.ac rpath="-Wl,-rpath," mksharedlibrpath="-Wl,-rpath," natdynlinkopts="-Wl,-E" -@@ -864,6 +869,7 @@ AS_IF([test x"$enable_shared" != "xno"], +@@ -912,6 +917,7 @@ AS_IF([test x"$enable_shared" != "xno"], [earm*-*-netbsd*], [natdynlink=true], [aarch64-*-linux*], [natdynlink=true], [aarch64-*-freebsd*], [natdynlink=true], @@ -36,7 +36,7 @@ Index: configure.ac [riscv*-*-linux*], [natdynlink=true])]) # Try to work around the Skylake/Kaby Lake processor bug. -@@ -956,6 +962,8 @@ AS_CASE([$host], +@@ -1013,10 +1019,14 @@ AS_CASE([$host], [arch=arm64; system=linux], [aarch64-*-freebsd*], [arch=arm64; system=freebsd], @@ -45,3 +45,9 @@ Index: configure.ac [x86_64-*-cygwin*], [arch=amd64; system=cygwin], [riscv64-*-linux*], + [arch=riscv; model=riscv64; system=linux] ++ [riscv64-*-openbsd*], ++ [arch=riscv; model=riscv64; system=openbsd] + ) + + AS_IF([test x"$enable_native_compiler" = "xno"], -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE