diff --git a/patches/5.2.0~beta1/0001-Add-missing-defined-in-preprocessor-test.patch b/patches/5.2.0~beta1/0001-Add-missing-defined-in-preprocessor-test.patch new file mode 100644 index 00000000..8d60475e --- /dev/null +++ b/patches/5.2.0~beta1/0001-Add-missing-defined-in-preprocessor-test.patch @@ -0,0 +1,27 @@ +From 8c8ac05b2631d5a876a2dda38530f632bfd3429d Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Tue, 27 Feb 2024 16:14:38 +0100 +Subject: [PATCH 01/14] Add missing `defined` in preprocessor test + +When `HAS_CLOCK_GETTIME_NSEC_NP` is not defined, +`#elif HAS_CLOCK_GETTIME_NSEC_NP` triggers a warning +--- + runtime/unix.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/runtime/unix.c b/runtime/unix.c +index b5fd4de17b..b397fd2c9c 100644 +--- a/runtime/unix.c ++++ b/runtime/unix.c +@@ -47,7 +47,7 @@ + #endif + #ifdef HAS_POSIX_MONOTONIC_CLOCK + #include +-#elif HAS_CLOCK_GETTIME_NSEC_NP ++#elif defined(HAS_CLOCK_GETTIME_NSEC_NP) + #include + #endif + #ifdef HAS_DIRENT +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0002-Include-config.h-before-HAS_GETTIMEOFDAY-is-tested.patch b/patches/5.2.0~beta1/0002-Include-config.h-before-HAS_GETTIMEOFDAY-is-tested.patch new file mode 100644 index 00000000..bbd830ac --- /dev/null +++ b/patches/5.2.0~beta1/0002-Include-config.h-before-HAS_GETTIMEOFDAY-is-tested.patch @@ -0,0 +1,34 @@ +From ebd40ef5f42f22be63fe2507e7ba5ceacc4eb0de Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Tue, 27 Feb 2024 16:22:58 +0100 +Subject: [PATCH 02/14] Include `config.h` before `HAS_GETTIMEOFDAY` is tested + +Also remove a duplicate `errno.h` +--- + runtime/unix.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/runtime/unix.c b/runtime/unix.c +index b397fd2c9c..abdc8cd630 100644 +--- a/runtime/unix.c ++++ b/runtime/unix.c +@@ -21,6 +21,7 @@ + /* Helps finding RTLD_DEFAULT in glibc */ + /* also secure_getenv */ + ++#include "caml/config.h" + #include + #include + #include +@@ -32,8 +33,6 @@ + #endif + #include + #include +-#include +-#include "caml/config.h" + #if defined(SUPPORT_DYNAMIC_LINKING) && !defined(BUILDING_LIBCAMLRUNS) + #define WITH_DYNAMIC_LINKING + #ifdef __CYGWIN__ +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0003-Fix-a-pattern-in-configure.patch b/patches/5.2.0~beta1/0003-Fix-a-pattern-in-configure.patch new file mode 100644 index 00000000..3632e788 --- /dev/null +++ b/patches/5.2.0~beta1/0003-Fix-a-pattern-in-configure.patch @@ -0,0 +1,38 @@ +From 9e9992f0a192a1476b09277e365faf7a7bb3b6f0 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Mon, 26 Feb 2024 17:48:50 +0100 +Subject: [PATCH 03/14] Fix a pattern in configure + +In a sh `case` pattern matching, each `|`-separated alternative must +match the complete expression +--- + configure | Bin 644933 -> 644935 bytes + configure.ac | 2 +- + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 3b3ffdaa12dd8767ed900fcd4152c63fc0cb796d..aa9a21ffdca342513b957d4aa6a10daf55fc2f41 100755 +GIT binary patch +delta 42 +vcmX@QPW|{g^@bM47N!>F7M2#)Eo|1VOjF7M2#)Eo|1V%!x(0(>Ly56PbR?i_M{ZiYprsvjZ{5_9?EM +Hn +Date: Wed, 21 Feb 2024 18:47:12 +0100 +Subject: [PATCH 04/14] Detect and use {CC,...}_FOR_BUILD to build sak + +--- + Makefile | 9 +- + Makefile.config.in | 4 + + aclocal.m4 | 1 + + build-aux/ax_prog_cc_for_build.m4 | 155 ++++++++++++++++++++++++++++++ + configure | Bin 644935 -> 680002 bytes + configure.ac | 10 +- + 6 files changed, 172 insertions(+), 7 deletions(-) + create mode 100644 build-aux/ax_prog_cc_for_build.m4 + +diff --git a/Makefile b/Makefile +index 71d41cd2d6..df191af79c 100644 +--- a/Makefile ++++ b/Makefile +@@ -1284,11 +1284,10 @@ runtime/caml/jumptbl.h : runtime/caml/instruct.h + sed -n -e '/^ /s/ \([A-Z]\)/ \&\&lbl_\1/gp' \ + -e '/^}/q' > $@ + +-# These are provided as a temporary shim to allow cross-compilation systems +-# to supply a host C compiler and different flags and a linking macro. +-SAK_CC ?= $(CC) +-SAK_CFLAGS ?= $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS) +-SAK_LINK ?= $(MKEXE_VIA_CC) ++SAK_CC ?= $(CC_FOR_BUILD) ++SAK_CFLAGS ?=\ ++ $(OC_CFLAGS) $(CFLAGS_FOR_BUILD) $(OC_CPPFLAGS) $(CPPFLAGS_FOR_BUILD) ++SAK_LINK ?= $(SAK_CC) $(SAK_CFLAGS) $(OC_EXE_LDFLAGS) $(OUTPUTEXE)$(1) $(2) + + $(SAK): runtime/sak.$(O) + $(V_MKEXE)$(call SAK_LINK,$@,$^) +diff --git a/Makefile.config.in b/Makefile.config.in +index 559738f6ed..4243bebad9 100644 +--- a/Makefile.config.in ++++ b/Makefile.config.in +@@ -65,11 +65,13 @@ LIBTOOL = $(TOP_BUILDDIR)/libtool + ### Which C compiler to use + TOOLPREF=@ac_tool_prefix@ + CC=@CC@ ++CC_FOR_BUILD=@CC_FOR_BUILD@ + + CC_HAS_DEBUG_PREFIX_MAP=@cc_has_debug_prefix_map@ + AS_HAS_DEBUG_PREFIX_MAP=@as_has_debug_prefix_map@ + + LDFLAGS?=@LDFLAGS@ ++LDFLAGS_FOR_BUILD=@LDFLAGS_FOR_BUILD@ + + ### How to invoke the C preprocessor through the C compiler + CPP=@CPP@ +@@ -160,7 +162,9 @@ UNIX_OR_WIN32=@unix_or_win32@ + INSTALL_SOURCE_ARTIFACTS=@install_source_artifacts@ + + CFLAGS=@CFLAGS@ ++CFLAGS_FOR_BUILD=@CFLAGS_FOR_BUILD@ + CPPFLAGS=@CPPFLAGS@ ++CPPFLAGS_FOR_BUILD=@CPPFLAGS_FOR_BUILD@ + OCAMLC_CFLAGS=@ocamlc_cflags@ + + OCAMLC_CPPFLAGS=@ocamlc_cppflags@ +diff --git a/aclocal.m4 b/aclocal.m4 +index cb73385dda..d2e58a45f6 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -30,6 +30,7 @@ m4_include([build-aux/ax_check_compile_flag.m4]) + + # Macros from the autoconf macro archive + m4_include([build-aux/ax_func_which_gethostbyname_r.m4]) ++m4_include([build-aux/ax_prog_cc_for_build.m4]) + m4_include([build-aux/ax_pthread.m4]) + + # OCaml version +diff --git a/build-aux/ax_prog_cc_for_build.m4 b/build-aux/ax_prog_cc_for_build.m4 +new file mode 100644 +index 0000000000..1db8d73f96 +--- /dev/null ++++ b/build-aux/ax_prog_cc_for_build.m4 +@@ -0,0 +1,155 @@ ++# =========================================================================== ++# https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_PROG_CC_FOR_BUILD ++# ++# DESCRIPTION ++# ++# This macro searches for a C compiler that generates native executables, ++# that is a C compiler that surely is not a cross-compiler. This can be ++# useful if you have to generate source code at compile-time like for ++# example GCC does. ++# ++# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything ++# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). ++# The value of these variables can be overridden by the user by specifying ++# a compiler with an environment variable (like you do for standard CC). ++# ++# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object ++# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if ++# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are ++# substituted in the Makefile. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Paolo Bonzini ++# ++# Copying and distribution of this file, with or without modification, are ++# permitted in any medium without royalty provided the copyright notice ++# and this notice are preserved. This file is offered as-is, without any ++# warranty. ++ ++#serial 21 ++ ++AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) ++AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl ++AC_REQUIRE([AC_PROG_CC])dnl ++AC_REQUIRE([AC_PROG_CPP])dnl ++AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++ ++dnl Use the standard macros, but make them use other variable names ++dnl ++pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl ++pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl ++pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl ++pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl ++pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl ++pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl ++pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl ++pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl ++pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl ++pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl ++pushdef([ac_cv_objext], ac_cv_build_objext)dnl ++pushdef([ac_exeext], ac_build_exeext)dnl ++pushdef([ac_objext], ac_build_objext)dnl ++pushdef([CC], CC_FOR_BUILD)dnl ++pushdef([CPP], CPP_FOR_BUILD)dnl ++pushdef([GCC], GCC_FOR_BUILD)dnl ++pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl ++pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl ++pushdef([EXEEXT], BUILD_EXEEXT)dnl ++pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl ++pushdef([OBJEXT], BUILD_OBJEXT)dnl ++pushdef([host], build)dnl ++pushdef([host_alias], build_alias)dnl ++pushdef([host_cpu], build_cpu)dnl ++pushdef([host_vendor], build_vendor)dnl ++pushdef([host_os], build_os)dnl ++pushdef([ac_cv_host], ac_cv_build)dnl ++pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl ++pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl ++pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl ++pushdef([ac_cv_host_os], ac_cv_build_os)dnl ++pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl ++pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl ++pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl ++pushdef([cross_compiling], cross_compiling_build)dnl ++ ++cross_compiling_build=no ++ ++ac_build_tool_prefix= ++AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], ++ [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) ++ ++AC_LANG_PUSH([C]) ++ ++dnl The pushdef([ac_cv_c_compiler_gnu], ...) currently does not cover ++dnl the use of this variable in _AC_LANG_COMPILER_GNU called by ++dnl AC_PROG_CC. Unset this cache variable temporarily as a workaround. ++was_set_c_compiler_gnu=${[ac_cv_c_compiler_gnu]+y} ++AS_IF([test ${was_set_c_compiler_gnu}], ++ [saved_c_compiler_gnu=$[ac_cv_c_compiler_gnu] ++ AS_UNSET([[ac_cv_c_compiler_gnu]])]) ++ ++AC_PROG_CC ++ ++dnl Restore ac_cv_c_compiler_gnu ++AS_IF([test ${was_set_c_compiler_gnu}], ++ [[ac_cv_c_compiler_gnu]=$[saved_c_compiler_gnu]]) ++ ++_AC_COMPILER_EXEEXT ++_AC_COMPILER_OBJEXT ++AC_PROG_CPP ++ ++dnl Restore the old definitions ++dnl ++popdef([cross_compiling])dnl ++popdef([am_cv_prog_cc_c_o])dnl ++popdef([am_cv_CC_dependencies_compiler_type])dnl ++popdef([ac_tool_prefix])dnl ++popdef([ac_cv_host_os])dnl ++popdef([ac_cv_host_vendor])dnl ++popdef([ac_cv_host_cpu])dnl ++popdef([ac_cv_host_alias])dnl ++popdef([ac_cv_host])dnl ++popdef([host_os])dnl ++popdef([host_vendor])dnl ++popdef([host_cpu])dnl ++popdef([host_alias])dnl ++popdef([host])dnl ++popdef([OBJEXT])dnl ++popdef([LDFLAGS])dnl ++popdef([EXEEXT])dnl ++popdef([CPPFLAGS])dnl ++popdef([CFLAGS])dnl ++popdef([GCC])dnl ++popdef([CPP])dnl ++popdef([CC])dnl ++popdef([ac_objext])dnl ++popdef([ac_exeext])dnl ++popdef([ac_cv_objext])dnl ++popdef([ac_cv_exeext])dnl ++popdef([ac_cv_c_compiler_gnu])dnl ++popdef([ac_cv_prog_cc_g])dnl ++popdef([ac_cv_prog_cc_cross])dnl ++popdef([ac_cv_prog_cc_works])dnl ++popdef([ac_cv_prog_cc_c89])dnl ++popdef([ac_cv_prog_gcc])dnl ++popdef([ac_cv_prog_CPP])dnl ++ ++dnl restore global variables ac_ext, ac_cpp, ac_compile, ++dnl ac_link, ac_compiler_gnu (dependant on the current ++dnl language after popping): ++AC_LANG_POP([C]) ++ ++dnl Finally, set Makefile variables ++dnl ++AC_SUBST(BUILD_EXEEXT)dnl ++AC_SUBST(BUILD_OBJEXT)dnl ++AC_SUBST([CFLAGS_FOR_BUILD])dnl ++AC_SUBST([CPPFLAGS_FOR_BUILD])dnl ++AC_SUBST([LDFLAGS_FOR_BUILD])dnl ++]) +diff --git a/configure b/configure +index aa9a21ffdca342513b957d4aa6a10daf55fc2f41..3e9ac24d76e24204d3b5ee33cfd6033c0756a04e 100755 +GIT binary patch +delta 6813 +zcmds6du&tJ8Q1xod!1bJ^6JEC7RZfp?7W;8kit@jf|Ej7mIo~rYbkDUoX6_gBz7Qa +z$U@Xrv=drknfSIv+n`&u!KMy0ZI?e*8dhmY8yaL%6_vD*RHFN1%CuChU8hm)T;FT^ +zoSS4t{869R%S`cu7bjW{O|%gD1Nt-3Uy3r( +zBAii1W%|d`dR&eYuea1C#TE=3iY>_^CI?*EART_N~N?rI>QFLJUq*z$Y~3!= +z9fjntP*`FtJyZb4qtm(VQXsgP-PaN9?T8qKEF(iBrjojPB?&ECOgVd!j+GsY1IMMB +zp;;H8*s|`F-G0hpaN|-kuy4k^+Q;Z|hh={_)TQF!NT3uL3d)xp|o +z4e-Q{`+eP^0qUgv9T8t75cTm39>*|F7J_wM`OrwhFOK1*iAR!NigfG?bo%ggAry;h +zC=bgqF=?K9c_2j9XhSm%kNXp4A%-$Ody&ZcXZvnbBffo+JgkpDyGTx@#vP6|XGxQk +zj2t|ARkVFMIc{$B*tx(`#>&JeNS=XWI36h&xI~WE$E8zlHHQ5AXoiKm`9j4dOHv#z +z%!=L>$#FBbKbM-D!R-N$o`N7wE|67glbY=HYVinZiE5~d9-h5pp2)ayid^Agz_tMp +zjacC93nsCM*^df{Y7<{~l?7+&4uWrWngk0^-0k;c`*rdiyn2$C-u@QJNoQ$s(@v9> +z)vrQ<&mIv{F#GQ$B`slV3=+(~3}&96!ZKRMO0>%!c`$*Cq2SxGrpII#wK|A>5z~Mk +zASZ@kyZ(9fJgFLGC2IcUZKsgaTnYpu0s6%eYe+5OeXYhNLf{2jZdt~pFKGs&ZJOjH +zV>uV$PlAkJdtc1PzG+ggul#bFoaEifB6+(}ZMi~za&Myg*bK>&5}t0vsgJ;g@63?D +zesSZFrfjKF^FC2XW>T`pt_9}H7`;XgvMO&}Bfn$Er)J4Ec6?)&xbF=ZG{r4^i06Mm +z^4VB87lJI@`2jhgPo94ltoYnCe4q9H7prkLHX^m8*J>-(@tTKQyn99NKm@XQ1djhj +zu-CELlgYBUEb)a;`O@D=A>jk*4i!BX?lb4eadv!H3SAHjkELed?nxr@_?#aEM;V9D +zohX8QU0dP+zz63^0h=X!q&DJr=ShPeq?hK&uXr!8aNTaLTK`Y-+C59p+c|-)ACap( +z40k9P4FPe3{3xmBt_0&fO=(|ZCF>Ea}3y(1^}j$i}BziG(XlpqyPEcEe*j +z=aCZd=${nI9Bf$w7Ja->0u3xzRcQjTwo>@HPW5pqOzEG0EK9`Ed>IrtS?jqwr>r01 +zF_&RZIk&$#0q_9YYM_GMeQff{nuM;A8rbUQW8c4igPODS +zilV;I=~IxunqWLSUS;JnsNAew7M0y=mPO^wH3?MwYhlWe%ydt9;-^A^?&zo1K|$@U +z#fSEurG-cpQB)2^x`;Q{!N&WlX|q}LBHx>#O`G`B?G`#RvHnZG$Dws*43g->QFVP2 +zR;~~$@IP6QiHD|B>y+RBm&}O8nsTlAMEgMWxYGJ_@pq+`tEWxzz*DA8u#c3nZ0Zv@ +z6jnL4Mg+U&k+3Lewko3n)SDjUR=8qtAr;nZ4pu%(g^x|Tv#Bz-B4@ypB%S5Onqxx4 +z3T6fuBBnf?Js=7?<4h*hahpuGBQ;w+4z}s5Q_c!SOS5L+VlLR&LlJ1Ug(D`EZt`X;@IY +z@tP0w@LvbXX53oRiSeOIzD +zsn<5WPu;0DPS}45Bp-v^v`6iB#&gykYqzjmcy30>&(N^eI(2P0HV+SB?t8)`%&kMF +z9eKV}BfFdIhAE}{Jz*lHfs@uot39hwQujkIEbJWTa+K!;+sgkd0~ZdG`gB%AtS^?y +wYf>iWgfxLYRDSlMu;;$2(N+y6zOv$xKa*LIq(dQ5q(3wLr79sY?cK}&1A2UZHUIzs + +delta 62 +zcmX?fK=b%I^$oN9nkD?(CHxtIm +Date: Thu, 22 Feb 2024 13:37:28 +0100 +Subject: [PATCH 05/14] Use `target` instead of `host` to detect the C + toolchain + +When building a cross-compiler, the runtime will run on the target, not +the host so: +- set `cross_compiling` by comparing `build` to `target` (rather than to + `host`), as this variable will be used later +- use `target` to set up the tool prefix, +- as the libtool configuration will configure a `build` to `host` + toolchain, temporarily assign `host*` values to `target*` values +--- + configure | Bin 680002 -> 680558 bytes + configure.ac | 18 ++++++++++++++++++ + 2 files changed, 18 insertions(+) + +diff --git a/configure b/configure +index 3e9ac24d76e24204d3b5ee33cfd6033c0756a04e..551db9f3eba6742194b9d917734979c416643042 100755 +GIT binary patch +delta 1928 +zcmZ`(e@v8R9N#@Z-s4X26htTT4ng!C9;h@p^LCNp%z+*G(7cQ5d6*B#z_px6)8 +zl}>54w)B~332T}~YE9x>Qg=|0`xpt}8D)$MVG0s)_^DX7)! +z`_vY9Pf*Jj^PV)*?u{J*E(Rd +zLRUI3KZoCu&5fVOr{G2KV;|u~veB-7T%8R;Q@`TP0EZ^lcmY;^%2EF>KW!s}L(TMDQwDJ5>8-zX)2LtP;@Z!yp}t4XmOfnx`0 +zO9B4XJ>;0om>wd-a`mU5BOUT_ojOF;%SSVOn0zIDF26!L=9{WTsY%42>>}gx=PCJw +zoPdH%;1#U4k0fzNAIY~u>2+U_F4@2HOOnIxUMC6cQW{zcFP;mwR+U0W$)i%}jWP1G +zY^L{jQWKwGzEM|;=Jy7I%rZz9L0Hi=`AP0cik13InpG~KS-jgyyJRndxFhARNu-ky +zUXb)3&6g!pn^f@N5_&MvZ2d|uT@G#V;e1-H#DkcCq3V8iub3|3+Y9NG{QI_+(RK}^J>sHKY^b%_YUZ1i8`%}*iN#!5Gy6rGwnA&8GB>IB`#jhBh6`(U@m#mmTkn#qCGKiwuPW2`dK-(4z^fHi*$P +zY8!rb(F)+^zpXrd^ebyy7LnSJKF|MgZQ`eMT~5^-im|rDD&OB95_MGSg;vp@K`4Kn +zSn78~efqCWA~(n5z*3RWFPfv+ku3;FN5&L;E +z`iXx;8Ku5+41xr3@&gspzgjRrU9ryty;RGW4&M~w?j}$0NChn5`gSE8OsD9nr7({S +zqd}F}76F$osDmlC?vFrT%Ez%5h|(N%NjtnjHv06s2VhUi(e_6ml7ja?4qXg!7lP7l +zJ772!GT%#lc;fpsAKuyy0X;neud}6>55Pc>ELFV^nQlUNeFQ5PI@x}F?*ddg9A3Eq +zBLvph%GG-IXQ&6t(9P4(#G}`jV6)^Vcg#Tbf3g<+(+r#vT+d|JqxUilQ==o7p~z3@ +zyjwn0NXT4wl9P2+r5ty0!9a~%N#ULvd6k_TBc<8IjjWQD%uO}P$F3!Xj>Y5__VwpR +zd6wt;J_=?Ckb)3TUtj9rpb?DD|xvX%A+J+qRxvv5}a=y9|d +zaH}2y4FMI#Gj8S6hu!LVwrIHXY^Neq{XxA-vQm`J4JmhOayQRcu>ghNDpWUu*VzK| +z=V14A6vv`r{5(r#;)w>8p}jY$#XMqNU#8OMl4kX7>NmPwpKh*GWo&=XGS$K8>T*?0 +z2+gu(qq|Z0uychfCGFq}b%@g%8`TVZH7HMa->DArL(aZiC3q0uty0YkNmji{eL`=? +zujluwBEE*@{c0;$HA~hi@rNeQJY4p%`kEy9<7$Ym@R?*%nd35NjyY*MnRE}o^e>~G +B?Wh0% + +diff --git a/configure.ac b/configure.ac +index 4bbeb0886e..61225d5951 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -288,6 +288,14 @@ AC_CANONICAL_BUILD + AC_CANONICAL_HOST + AC_CANONICAL_TARGET + ++# Override cross_compiling and ac_tool_prefix variables since the C toolchain is ++# used to generate target code when building a cross compiler ++AS_IF([test x"$build" = x"$target"], ++ [cross_compiling=no], ++ [cross_compiling=yes]) ++AS_IF([test -n "$target_alias"], ++ [ac_tool_prefix=$target_alias-]) ++ + # Ensure that AC_CONFIG_LINKS will either create symlinks which are compatible + # with native Windows (i.e. NTFS symlinks, not WSL or Cygwin-emulated ones) or + # use its fallback mechanisms. Native Windows versions of ocamlc/ocamlopt cannot +@@ -594,12 +602,22 @@ AC_CHECK_TOOLS([LD],[ld link]) + # Also, it has been observed that, on some platforms (e.g. msvc) LT_INIT + # alters the CFLAGS variable, so we save its value before calling the macro + # and restore it after the call ++pushdef([host], target)dnl ++pushdef([host_alias], target_alias)dnl ++pushdef([host_cpu], target_cpu)dnl ++pushdef([host_vendor], target_vendor)dnl ++pushdef([host_os], target_os)dnl + old_host_os=$host_os + AS_IF([test x"$host_os" = "xwindows"],[host_os=mingw]) + saved_CFLAGS="$CFLAGS" + LT_INIT + CFLAGS="$saved_CFLAGS" + host_os=$old_host_os ++popdef([host_os])dnl ++popdef([host_vendor])dnl ++popdef([host_cpu])dnl ++popdef([host_alias])dnl ++popdef([host])dnl + + AS_CASE([$host], + [sparc-sun-solaris*], +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0006-SQUASH-Use-target-instead-of-host-when-relevant-in-c.patch b/patches/5.2.0~beta1/0006-SQUASH-Use-target-instead-of-host-when-relevant-in-c.patch new file mode 100644 index 00000000..0e2d29d8 --- /dev/null +++ b/patches/5.2.0~beta1/0006-SQUASH-Use-target-instead-of-host-when-relevant-in-c.patch @@ -0,0 +1,83 @@ +From 374f6bae10c6c0b993ea085e9a0adb77a5045493 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Wed, 21 Feb 2024 19:05:44 +0100 +Subject: [PATCH 06/14] SQUASH? Use `target` instead of `host` when relevant in + configuration + +--- + configure | Bin 680558 -> 679923 bytes + configure.ac | 10 +++++----- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configure b/configure +index 551db9f3eba6742194b9d917734979c416643042..8c116ba182012cdc80b1700e908758ea16727650 100755 +GIT binary patch +delta 399 +zcmaENMDz20&4w+Eojazl+rcP4ebQb=W!{p+qV&{~_{5yd#A4m)j4wEB(S$ziWn8fR +z=}yKyjA#-Yii#6 +z67S<;tK#D_{ecgY$n?EC7&*2BEuYOIub=>ufGOcpP)N-wP6bk6aV4ephQo|N%ml>D +zK+FQftlJw7v)S>mg5ACS;CZ%POw(o7vhi>4xWpFMG=1uHcK+?3L)h(vr!(GUl;cP7 +zUQWt%!<&qz7=nqioU^9$=CZSI&&y=L#)u(bc!05Q`;%;T9>(bl&DkWTbLX-P!~8d0 +yE|*<)y2=wq`Rx(8?CmVmjf&ajMd99X@eFcx4gq-|=o`Ocb|B{1?pMsI@E!nTu#eIJ + +delta 372 +zcmeyoU-R7&&4w+Eojay4%;iv>E_<4le|p1SMvm!m}UBp2TX!u +zJ}ycMwh9&23MCn-d0YxW092+l{o-n->C+`DIRvJ!t7motv5cpy9%AHgcRj=i#7scU +z48$xz%(~t65Sum6^muD_-tGP8*fuatf3=^DclvxwPS)+g7uh14rqB4p%Da7cFuR@b +zbm0KzV5Xdu=@+w@T|u $system = 'unknown' + has_native_backend=no + native_ldflags="" +-AS_CASE([$host], ++AS_CASE([$target], + [[i[3456]86-*-linux*]], + [arch=i386; system=linux], + [[i[3456]86-*-freebsd*]], +@@ -1479,7 +1479,7 @@ AS_IF([$natdynlink], + + AC_DEFINE_UNQUOTED([OCAML_OS_TYPE], ["$ostype"]) + +-AC_CHECK_TOOL([DIRECT_LD],[ld]) ++AC_CHECK_TARGET_TOOL([DIRECT_LD],[ld]) + AS_IF([test -z "$PARTIALLD"], + [AS_CASE(["$host,$ocaml_cc_vendor"], + [x86_64-*-darwin*,gcc-*], [PACKLD_FLAGS=' -arch x86_64'], +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0007-WIP-Use-the-STRIP-command-automatically-detected-by-.patch b/patches/5.2.0~beta1/0007-WIP-Use-the-STRIP-command-automatically-detected-by-.patch new file mode 100644 index 00000000..97ed31e9 --- /dev/null +++ b/patches/5.2.0~beta1/0007-WIP-Use-the-STRIP-command-automatically-detected-by-.patch @@ -0,0 +1,73 @@ +From d8d4a6c37d5f56902228f49737f8c8902eb4c69e Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Fri, 23 Feb 2024 12:00:32 +0100 +Subject: [PATCH 07/14] WIP Use the STRIP command automatically detected by + libtool + +libtool configuration will try and detect the `strip` for the code +generated by the configured C compiler, so that it works also for a +cross-compiler + +WIP: ensure it works also on MSVC, hopefully libtool-detected strip will +not break the compiled code +--- + Makefile.config.in | 1 + + configure | Bin 679923 -> 679924 bytes + configure.ac | 1 + + stdlib/Makefile | 5 +---- + 4 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/Makefile.config.in b/Makefile.config.in +index 4243bebad9..b91634efb6 100644 +--- a/Makefile.config.in ++++ b/Makefile.config.in +@@ -185,6 +185,7 @@ OCAMLOPT_CFLAGS=@ocamlc_cflags@ + OCAMLOPT_CPPFLAGS=@ocamlc_cppflags@ + NATIVECCLIBS=@cclibs@ + SYSTHREAD_SUPPORT=@systhread_support@ ++STRIP=@STRIP@ + PACKLD=@PACKLD@$(EMPTY) + CCOMPTYPE=@ccomptype@ + TOOLCHAIN=@toolchain@ +diff --git a/configure b/configure +index 8c116ba182012cdc80b1700e908758ea16727650..5560495c01770d425d23b130411e4a407ea8622b 100755 +GIT binary patch +delta 67 +zcmeyoU-Qd;%?%Cyo7?R%?%Cytid5co&lTd{ns!y8wPGS3}m!XZ_le>1Y#y2W(HywAZ7((HXvpP +MVvg;36`XC)0ho{)Jpcdz + +diff --git a/configure.ac b/configure.ac +index 6f4fa4b8df..973320d23b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -243,6 +243,7 @@ AC_SUBST([mkdll_ldflags_exp]) + AC_SUBST([mkexe_ldflags_exp]) + AC_SUBST([PACKLD]) + AC_SUBST([build_libraries_manpages]) ++AC_SUBST([STRIP]) + AC_SUBST([compute_deps]) + AC_SUBST([ocaml_bindir]) + AC_SUBST([ocaml_libdir]) +diff --git a/stdlib/Makefile b/stdlib/Makefile +index 50f825a1b3..a7f2e60a7a 100644 +--- a/stdlib/Makefile ++++ b/stdlib/Makefile +@@ -96,10 +96,7 @@ endif + .INTERMEDIATE: tmpheader.exe + tmpheader.exe: $(HEADERPROGRAM).$(O) + $(V_MKEXE)$(call MKEXE_VIA_CC,$@,$^) +-# FIXME This is wrong - mingw could invoke strip; MSVC equivalent? +-ifneq "$(UNIX_OR_WIN32)" "win32" +- strip $@ +-endif ++ $(STRIP) $@ + + stdlib.cma: $(OBJS) + $(V_LINKC)$(CAMLC) -a -o $@ $^ +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0008-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch b/patches/5.2.0~beta1/0008-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch new file mode 100644 index 00000000..aa104d3f --- /dev/null +++ b/patches/5.2.0~beta1/0008-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch @@ -0,0 +1,65 @@ +From d5325e40ee7a67de019789222794dce95ab2498c Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Mon, 26 Feb 2024 11:51:11 +0100 +Subject: [PATCH 08/14] Allow `ocaml` as a target OS to configure freestanding + cross-compilers + +Allow the use of *-*-ocaml or *-*-*-ocaml target triplets to stand for +freestanding cross-compilers by temporarily rewriting the target OS to +`none` when generating the canonical target + +This allows to use *-*-ocaml and *-*-*-ocaml prefixes for cross-compiler +specific toolchains, so that all the specific tools (for instance +aarch64-solo5-ocaml-gcc, etc.) are automatically discovered +--- + configure | Bin 679924 -> 680433 bytes + configure.ac | 17 +++++++++++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/configure b/configure +index 5560495c01770d425d23b130411e4a407ea8622b..be2cb9bb7a92325f9e7ccab8e2ecfcda8d0f94ce 100755 +GIT binary patch +delta 550 +zcmb7Ay-EW?5GFDHosGTCWOEQtxW*KMA%zHvl|>%l7|%&u*zAVg#TYEk?uwKazKD=g +zg0J9<2zdY}r|3lyl;vAyz8SvxX68@P>vMGXSlQ0A1{^76Mj%Xz10?_*c(i@;aNdQU +zvCy+b&ZEARx(}%t45cCq7h~`=7#fRKsxep^S?ReWXn?<>l7u%Pw9zDhqdsY}=()~4 +zDKekQ6xBz2U +Date: Mon, 26 Feb 2024 12:06:45 +0100 +Subject: [PATCH 09/14] Define OS type to None + +--- + configure | Bin 680433 -> 680483 bytes + configure.ac | 4 +++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index be2cb9bb7a92325f9e7ccab8e2ecfcda8d0f94ce..10c8f62f003188d6f7ced33363d717e2a8ea6ddc 100755 +GIT binary patch +delta 84 +zcmex(Sab0a&4w1n7N!>F7M2#)Eo_IbtLtd#YU$?X=cU$Yftjf}X_^XFTna#tUtCgI +gkZP;s2b7)u(2-rP{pxi#AZ7<*j_p^kbINo90P@)%iU0rr + +delta 43 +wcmZ2{MDyce&4w1n7N!>F7M2#)Eo_IbPuAuZY-hc}2E^<@%(0#I2B%yX0DJckL;wH) + +diff --git a/configure.ac b/configure.ac +index 9070cd64e5..d87d67c067 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1091,7 +1091,9 @@ AS_CASE([$ocaml_cc_vendor,$target], + [oc_ldflags='-brtl -bexpfull' + AC_DEFINE([HAS_ARCH_CODE32], [1])], + [gcc-*,powerpc-*-linux*], +- [oc_ldflags="-mbss-plt"]) ++ [oc_ldflags="-mbss-plt"], ++ [*,*-*-none|*,*-*-elf], ++ [ostype="None"]) + + ## Program to use to install files + AC_PROG_INSTALL +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0010-Add-freestanding-targets-to-supported-configurations.patch b/patches/5.2.0~beta1/0010-Add-freestanding-targets-to-supported-configurations.patch new file mode 100644 index 00000000..7a575b6c --- /dev/null +++ b/patches/5.2.0~beta1/0010-Add-freestanding-targets-to-supported-configurations.patch @@ -0,0 +1,40 @@ +From 8f2da8d481adb25650887004f82f9769527d0cf4 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Mon, 26 Feb 2024 19:35:26 +0100 +Subject: [PATCH 10/14] Add freestanding targets to supported configurations + +--- + configure | Bin 680483 -> 680638 bytes + configure.ac | 6 +++++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 10c8f62f003188d6f7ced33363d717e2a8ea6ddc..6c7429ddb5a2303874d7294bfbb9244758eff259 100755 +GIT binary patch +delta 94 +zcmZ2{M04L!&4w1n7N!>F7M2#)7Pc+yJCdi%N3nDAR#=$Do0;fp>E`9?|A$kA+ + +delta 43 +xcmdmYRCDnW&4w1n7N!>F7M2#)7Pc+yJCYf>CM$AFx96v@12M<;{1i_Ae*jv24@dw2 + +diff --git a/configure.ac b/configure.ac +index d87d67c067..b1270504e2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1459,7 +1459,11 @@ AS_CASE([$target], + [x86_64-*-cygwin*], + [has_native_backend=yes; arch=amd64; system=cygwin], + [riscv64-*-linux*], +- [has_native_backend=yes; arch=riscv; model=riscv64; system=linux] ++ [has_native_backend=yes; arch=riscv; model=riscv64; system=linux], ++ [x86_64-*-none], ++ [has_native_backend=yes; arch=amd64; system=none], ++ [aarch64-*-none], ++ [has_native_backend=yes; arch=arm64; system=none] + ) + + AS_CASE([$arch], +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0011-Check-that-the-configured-and-the-installed-OCaml-ar.patch b/patches/5.2.0~beta1/0011-Check-that-the-configured-and-the-installed-OCaml-ar.patch new file mode 100644 index 00000000..237f8f7b --- /dev/null +++ b/patches/5.2.0~beta1/0011-Check-that-the-configured-and-the-installed-OCaml-ar.patch @@ -0,0 +1,46 @@ +From 0a306885ba5686694b551f8f89bab040d8dde8ba Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Tue, 19 Mar 2024 19:14:29 +0100 +Subject: [PATCH 11/14] Check that the configured and the installed OCaml are + compatible + +--- + configure | Bin 680638 -> 681229 bytes + configure.ac | 7 +++++++ + 2 files changed, 7 insertions(+) + +diff --git a/configure b/configure +index 6c7429ddb5a2303874d7294bfbb9244758eff259..d32864224c874dfb4c9693f56b7b9de0579bdd02 100755 +GIT binary patch +delta 458 +zcmdmYRI~S#W@7PfdUQ)PwlRE46{!qUv5RE0!^y!<@f5iuurRqu0pr@y&prl}@W@fEW%cTGWi8)27i7A!wa2w*GR@)}zCj+fYR?scW +zE6q&+E6xNuIkmV%p+d=2&q&XpE-AGn(NIZV!4@c@g43kwh5OhXB|uJ2EXhpDNmbB5 +z(yckYa0a`WI4()SMQjq&3$C*Zcx2|`FhQZLSOK@?no0^vDn6cmu73VX3Z`6XnbQj= +Yup77ca@7Pfe<>E2A7dhK_3*npTFh&h0mbNd}0F2e`_sm2hR + +diff --git a/configure.ac b/configure.ac +index b1270504e2..c89578bf3b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -826,6 +826,13 @@ AS_IF( + CPPFLAGS_FOR_BUILD='$(CPPFLAGS)' + LDFLAGS_FOR_BUILD='$(LDFLAGS)'], + [cross_compiler=true ++ # We require a non-cross-compiler of the same version ++ AC_MSG_CHECKING([the version of the installed OCaml compiler]) ++ already_installed_version=`ocamlc -vnum` ++ AS_IF([test x"AC_PACKAGE_VERSION" = x"$already_installed_version"], ++ [AC_MSG_RESULT([compatible (AC_PACKAGE_VERSION)])], ++ [AC_MSG_ERROR(m4_normalize([incompatible (AC_PACKAGE_VERSION vs ++ $already_installed_version)]))]) + AC_MSG_NOTICE([detecting the C toolchain for build]) + AX_PROG_CC_FOR_BUILD]) + +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0012-Use-the-target-pkg-config-to-detect-zstd.patch b/patches/5.2.0~beta1/0012-Use-the-target-pkg-config-to-detect-zstd.patch new file mode 100644 index 00000000..375c6d97 --- /dev/null +++ b/patches/5.2.0~beta1/0012-Use-the-target-pkg-config-to-detect-zstd.patch @@ -0,0 +1,43 @@ +From b6b7acbe57e478b1b7a4be28a651ed6f47b7d848 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Wed, 20 Mar 2024 17:41:26 +0100 +Subject: [PATCH 12/14] Use the target pkg-config to detect zstd + +Make sure that we don't detect zstd on build when we are building a +cross-compiler, as the native zstd has no reason to be compatible with +the cross toolchain +--- + configure | Bin 681229 -> 680988 bytes + configure.ac | 2 +- + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index d32864224c874dfb4c9693f56b7b9de0579bdd02..5bc661f55f99d087f9ba52f3433b2b5aaad9de36 100755 +GIT binary patch +delta 145 +zcmeA@r8(z>W({Gn^h)g%%&!{#1Q#pss^e0ak<+p2Ba4cq?zIq#nAVdv!C5Hful7gDr +v^u|gKIkvRKoZ?ia?We0b>=>sf*KsJaqyhz|>(_EfwYSu9Y;URK?0g0Q8YeMs + +delta 180 +zcmbPpLbLajWt}T +zi~?M6vGnN+moQD)exaD-DD!j&F*fn(0ntn>)7O@Bh)jP`&LKa2iWr;hcC`wQ#mv(y +z%Q(2VtJH89FiwB)gON|Ypd>!P+dbad-_Om{T}i=Kp~70BBqKGCO92QFGTSF!XH{pM +T9#+dC-#)pPWBcS<&dz55QC~l_ + +diff --git a/configure.ac b/configure.ac +index c89578bf3b..0e569223d0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2262,7 +2262,7 @@ AC_CHECK_HEADER([spawn.h], + [AC_CHECK_FUNC([posix_spawn], + [AC_CHECK_FUNC([posix_spawnp], [AC_DEFINE([HAS_POSIX_SPAWN])])])]) + +-AC_PATH_TOOL([PKG_CONFIG], [pkg-config], [false]) ++AC_PATH_TARGET_TOOL([PKG_CONFIG], [pkg-config], [false]) + + ## ZSTD compression library + +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0013-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch b/patches/5.2.0~beta1/0013-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch new file mode 100644 index 00000000..c6af9500 --- /dev/null +++ b/patches/5.2.0~beta1/0013-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch @@ -0,0 +1,122 @@ +From b33ab14aca121a8239495189f3f7cef8b12674f5 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Fri, 23 Feb 2024 16:56:07 +0100 +Subject: [PATCH 13/14] WIP Add a Makefile.cross for recipes to build a + cross-compiler + +Define cross.opt and cross-install targets + +FIXME: Problems of inconsistencies between compilation options (only +about zstd?) between the native toolchain and the cross toolchain may +break the build? +--- + Makefile | 2 ++ + Makefile.cross | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 85 insertions(+) + create mode 100644 Makefile.cross + +diff --git a/Makefile b/Makefile +index df191af79c..cb6b3f4484 100644 +--- a/Makefile ++++ b/Makefile +@@ -2732,6 +2732,8 @@ endif + + include .depend + ++include Makefile.cross ++ + Makefile.config Makefile.build_config: config.status + config.status: + @echo "Please refer to the installation instructions:" +diff --git a/Makefile.cross b/Makefile.cross +new file mode 100644 +index 0000000000..b993783d2f +--- /dev/null ++++ b/Makefile.cross +@@ -0,0 +1,83 @@ ++#************************************************************************** ++#* * ++#* OCaml * ++#* * ++#* Samuel Hym, Tarides * ++#* * ++#* Copyright 2024 Tarides * ++#* * ++#* All rights reserved. This file is distributed under the terms of * ++#* the GNU Lesser General Public License version 2.1, with the * ++#* special exception on linking described in the file LICENSE. * ++#* * ++#************************************************************************** ++ ++# Recipes to build a cross-compiler (_not_ cross-compiling the compiler), aka ++# generating code that will run on `target`, assuming that a non-cross OCaml ++# compiler (so targetting our build machine) of the same version is available in ++# $PATH ++ ++# We assume no zstd for the cross-compiler (ie no requirement on zstd for the ++# target) ++# Still the cross-compiler will run on host, not target. And as a consequence of ++# the rules linking it, the cross-compilers will be linked with the _build_ ++# version of libcomprmarsh, so we still must discover the flags to link with ++# libzstd if it was set up in the non-cross compiler, so we rely on the ++# pkg-config command to get the linking flags for zstd ++PKG_CONFIG := pkg-config ++# This is used only once, so it doesn't have to be much lazier ++NATIVE_ZSTD_LIBS=ZSTD_LIBS="$(shell $(PKG_CONFIG) --libs libzstd)" ++# As the libcomprmarsh built by the C cross compiler will not be linked in, we ++# can build an empty one ++NO_ZSTD=libcomprmarsh_OBJECTS= ++ ++CROSS_OVERRIDES=OCAMLRUN=ocamlrun NEW_OCAMLRUN=ocamlrun \ ++ BOOT_OCAMLLEX=ocamllex OCAMLYACC=ocamlyacc ++CROSS_COMPILER_OVERRIDES=$(CROSS_OVERRIDES) CAMLC=ocamlc CAMLOPT=ocamlopt \ ++ BEST_OCAMLC=ocamlc BEST_OCAMLOPT=ocamlopt BEST_OCAMLLEX=ocamllex ++ ++INSTALL_OVERRIDES=build_ocamldoc=false WITH_DEBUGGER= ++ ++# Freestanding target custom options ++ifeq "$(SYSTEM)" "none" ++RUNTIME_BUILD_OVERRIDES=runtime_PROGRAMS= ++INSTALL_OVERRIDES += runtime_PROGRAMS=`which ocamlrun` \ ++ runtime_BYTECODE_STATIC_LIBRARIES=runtime/ld.conf ++else ++RUNTIME_BUILD_OVERRIDES= ++endif ++ ++cross.opt: ++ $(MAKE) runtime-all $(NO_ZSTD) $(RUNTIME_BUILD_OVERRIDES) ++ $(MAKE) ocamlc ocamlopt $(TOOLS_BYTECODE_TARGETS) expunge \ ++ $(CROSS_COMPILER_OVERRIDES) ++ $(MAKE) library $(CROSS_OVERRIDES) ++ifneq "$(SYSTEM)" "none" ++ $(MAKE) ocamlyacc $(CROSS_OVERRIDES) ++ $(MAKE) ocamllex $(CROSS_COMPILER_OVERRIDES) ++endif ++ $(MAKE) ocaml $(CROSS_COMPILER_OVERRIDES) ++ $(MAKE) -C otherlibs all $(CROSS_OVERRIDES) ++ # Opt ++ $(MAKE) runtimeopt $(NO_ZSTD) ++ $(MAKE) ocamlc.opt ocamlopt.opt $(TOOLS_NATIVE_TARGETS) \ ++ $(NO_ZSTD) $(CROSS_COMPILER_OVERRIDES) $(NATIVE_ZSTD_LIBS) ++ $(MAKE) libraryopt $(NO_ZSTD) $(CROSS_OVERRIDES) ++ $(MAKE) otherlibrariesopt ocamltoolsopt $(NO_ZSTD) $(CROSS_OVERRIDES) ++ $(MAKE) tools-allopt.opt $(NO_ZSTD) $(CROSS_COMPILER_OVERRIDES) ++ ++.PHONY: cross-install ++cross-install: ++ # dummy files ++ touch \ ++ $(addprefix toplevel/, \ ++ $(foreach ext,cmi cmt cmti cmx, native/nat__dummy__.$(ext)) \ ++ all__dummy__.cmx topstart.o native/tophooks.cmi) ++ $(LN) `which ocamlyacc` yacc/ocamlyacc.opt$(EXE) ++ $(LN) `which ocamllex` lex/ocamllex.opt$(EXE) ++ifeq "$(SYSTEM)" "none" ++ $(LN) `which ocamlyacc` yacc/ocamlyacc$(EXE) ++ $(LN) `which ocamllex` lex/ocamllex$(EXE) ++endif ++ # Real installation ++ $(MAKE) install $(INSTALL_OVERRIDES) OCAMLRUN=ocamlrun +-- +2.43.0 + diff --git a/patches/5.2.0~beta1/0014-Set-Max_domains-to-1.patch b/patches/5.2.0~beta1/0014-Set-Max_domains-to-1.patch new file mode 100644 index 00000000..e54d10ca --- /dev/null +++ b/patches/5.2.0~beta1/0014-Set-Max_domains-to-1.patch @@ -0,0 +1,31 @@ +From e5e64a5ca1ade6765e363e326bf7cff39e29c205 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Fri, 12 Apr 2024 19:21:52 +0200 +Subject: [PATCH 14/14] Set Max_domains to 1 + +Solo5 is single-core with no scheduler, so avoid the useless memory +waste +--- + runtime/caml/domain.h | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/runtime/caml/domain.h b/runtime/caml/domain.h +index 4b9be80b41..986486478c 100644 +--- a/runtime/caml/domain.h ++++ b/runtime/caml/domain.h +@@ -31,11 +31,7 @@ extern "C" { + + /* The runtime currently has a hard limit on the number of domains. + This hard limit may go away in the future. */ +-#ifdef ARCH_SIXTYFOUR +-#define Max_domains 128 +-#else +-#define Max_domains 16 +-#endif ++#define Max_domains 1 + + /* is the minor heap full or an external interrupt has been triggered */ + Caml_inline int caml_check_gc_interrupt(caml_domain_state * dom_st) +-- +2.43.0 +