From 8c4b29c2b08198f6b54c0b262b3802ab92a46b84 Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Wed, 17 Apr 2024 12:28:43 +0200 Subject: [PATCH] TMP Add patches for 5.2.0~beta2 --- ...missing-defined-in-preprocessor-test.patch | 27 ++ ....h-before-HAS_GETTIMEOFDAY-is-tested.patch | 34 ++ ...and-use-CC-.-_FOR_BUILD-to-build-sak.patch | 310 ++++++++++++++++++ ...ad-of-host-to-detect-the-C-toolchain.patch | 111 +++++++ ...ad-of-host-when-relevant-in-configur.patch | 83 +++++ ...P-command-automatically-detected-by-.patch | 73 +++++ ...-target-OS-to-configure-freestanding.patch | 65 ++++ .../0008-Define-OS-type-to-None.patch | 38 +++ ...-targets-to-supported-configurations.patch | 40 +++ ...onfigured-and-the-installed-OCaml-ar.patch | 46 +++ ...the-target-pkg-config-to-detect-zstd.patch | 43 +++ ...le.cross-for-recipes-to-build-a-cros.patch | 122 +++++++ .../0013-Set-Max_domains-to-1.patch | 31 ++ 13 files changed, 1023 insertions(+) create mode 100644 patches/5.2.0~beta2/0001-Add-missing-defined-in-preprocessor-test.patch create mode 100644 patches/5.2.0~beta2/0002-Include-config.h-before-HAS_GETTIMEOFDAY-is-tested.patch create mode 100644 patches/5.2.0~beta2/0003-Detect-and-use-CC-.-_FOR_BUILD-to-build-sak.patch create mode 100644 patches/5.2.0~beta2/0004-Use-target-instead-of-host-to-detect-the-C-toolchain.patch create mode 100644 patches/5.2.0~beta2/0005-Use-target-instead-of-host-when-relevant-in-configur.patch create mode 100644 patches/5.2.0~beta2/0006-WIP-Use-the-STRIP-command-automatically-detected-by-.patch create mode 100644 patches/5.2.0~beta2/0007-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch create mode 100644 patches/5.2.0~beta2/0008-Define-OS-type-to-None.patch create mode 100644 patches/5.2.0~beta2/0009-Add-freestanding-targets-to-supported-configurations.patch create mode 100644 patches/5.2.0~beta2/0010-Check-that-the-configured-and-the-installed-OCaml-ar.patch create mode 100644 patches/5.2.0~beta2/0011-Use-the-target-pkg-config-to-detect-zstd.patch create mode 100644 patches/5.2.0~beta2/0012-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch create mode 100644 patches/5.2.0~beta2/0013-Set-Max_domains-to-1.patch diff --git a/patches/5.2.0~beta2/0001-Add-missing-defined-in-preprocessor-test.patch b/patches/5.2.0~beta2/0001-Add-missing-defined-in-preprocessor-test.patch new file mode 100644 index 00000000..59a0ad04 --- /dev/null +++ b/patches/5.2.0~beta2/0001-Add-missing-defined-in-preprocessor-test.patch @@ -0,0 +1,27 @@ +From 8300488c8891138da0bb490f1e74aaa9acfe11bd Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Tue, 27 Feb 2024 16:14:38 +0100 +Subject: [PATCH 01/13] 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~beta2/0002-Include-config.h-before-HAS_GETTIMEOFDAY-is-tested.patch b/patches/5.2.0~beta2/0002-Include-config.h-before-HAS_GETTIMEOFDAY-is-tested.patch new file mode 100644 index 00000000..ff0f2e57 --- /dev/null +++ b/patches/5.2.0~beta2/0002-Include-config.h-before-HAS_GETTIMEOFDAY-is-tested.patch @@ -0,0 +1,34 @@ +From 3a811f54eb8b087ccbcebf40898053c37afec2a5 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Tue, 27 Feb 2024 16:22:58 +0100 +Subject: [PATCH 02/13] 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~beta2/0003-Detect-and-use-CC-.-_FOR_BUILD-to-build-sak.patch b/patches/5.2.0~beta2/0003-Detect-and-use-CC-.-_FOR_BUILD-to-build-sak.patch new file mode 100644 index 00000000..7902a8c9 --- /dev/null +++ b/patches/5.2.0~beta2/0003-Detect-and-use-CC-.-_FOR_BUILD-to-build-sak.patch @@ -0,0 +1,310 @@ +From 7353c75e772ad2beed7d4f9344e7d777d2786556 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Wed, 21 Feb 2024 18:47:12 +0100 +Subject: [PATCH 03/13] 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 647384 -> 682451 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 c307be8f419008a6282200bfe39e231a24da8dbb..81a01f255d8c54961f0ebde2437dc859954c2380 100755 +GIT binary patch +delta 6734 +zcmds6du)@}71uq+pPdhq)T{F#4dLd)vGX#C17xt^P)O1Mjq+$q#rnVtjuXZl45XwecNGiehPo||}?K+KW_j}mB +z*C8V+DSr^j(s$22_dI^*+;i_e`OB#1{P~iTKWH9ms=u#kW8;H?`&u3dY}&S^sa~#Y +zZJk9*CFq=imQ7n5wm&2rgNE%5+JLR*WVHta!C0WKjw6YK=SG@e7-=T#2kd8IzeVau +zv-OlZMA;wD>-V^d>*`88vObYwkUpu?;taE#&{<5X$u!G%jmIQHi3jhOBo|)DlBx+~K3&w+-EtwWmX&weISgL0OiA +zy^&}%5R5#vySs-;4=_nR9sY1cmKk#TAfTxV?CuS9cK7?`?oJvDMPt+(rix3SS7c^U +zn0}4HqA%IS1PE(PKCdE&dS)*VwD)wkM^lB&A;Vy1k~+I(86Az5tewfgQrGOn@n~)s +z-h~*pd^o8$$X29;@kTPx_pWV4fYalR&|oCoso~&CpcLv4h5BRjlSo~&0*`yDVRfYe +zc*5e|Kv%er1?lPbXdoJj1;h!zYXD~^Y|b@h`vwznaShyxh +zQk~3=3$IGKqKSu3Ko7n%Lkd%~Fc>Q3O;f0!_9s9{sqPB;c3Bk3D0;XjYUwkx;n+TS!2CQsN-ElTiALx|Um3n^ +zmCrUCovl0GarFj2`(p|V`oYa^zZ;g}VVthpZZ#7LF +z7s;!)BTbJ?kX$*L6*%@Wc<{mm`SYzfhing)sJ;)0N-~nN{fd!rFJkO6+0QGzcA5N= +zAD@^cTlw*|N#ea7V6Z*w5W|@F5y|6o;Y=7Zar;N)8Iw5rS8(E!%qOn3nbUy=hWwX5@R*&$UHsL^Fe;|F36eLRFCg}N^-c;u28od +zr(Ti1gOlm72!GZH8S24*lOYTCUMF?xl4Wp#nEC10YtKGnB@VPLhtF1Ur^CKbG=6Y5 +z@+M;@1tIy%DCF^h*mIrSn=W3VUZhaTvz(?-Z0f&E;h@{N>+5&EU@*|7y}7gpXUc;F +zpDl#r<}$Yeu5`{?MZt=1OIy*qSlWge4K@c}SD=E|S-t|^%uG>)t$w?g0|HOJEIDz< +zL8<6wL>;noE_gCS6p0Rxl!Nbo9VAo2qeZZeH{<0Zh~H*@Q3P&&%Ik*Q3f?Dg7xlJO +zDGUqq26Y2WGTg8{RYJORPs^0^?e +zc%h#c%6Wg*JE!-qm2-Ok+{%RaB^3$pKdVT1Pb=r|{pQMq_pwURdzJuqV~!8XdFyrJ +z!@h*BK_6`Pin$+LyH4A=>;b1etJ&)<{3OOqEC0Kz`Ny^22z7vU0@S!oo5rG)4S$4Q#lhIxU+F#KeXQ>$Jol-1BIo +z=uMNQewWcsNs-jqjiYC64O(gT;(szB19PYB)#|VQOD3cuL$}c|V!a!7ZW%qb`14So +z$CH+L-l^jj*h@uRGz2O}EXn5(_h6HU2gW +zwxRC;$;XOp$c*#VW<#ZE?o-*Y4yRtStj8avfsD&@UUg7vXGx-DsEngz +zwzluUE~goQ*DqSHJeDj=+V#zBEqAcive3m(KKBH&Uu#gtcdYlDsjKkJgf%bSz}jf7 +zwc>$k_$p?9V7-^Sb5Pbq7yEbA+n}V7)UFS#Ba3PUX|1f*3;%4;>|xgxo+gAG>6A5R +z+5eS+Gy6%+Von5Vy}fjf&{VIEOj*;c{DJb5tJa-&RDE_DAc<8K5B-r$f-JufmL&GG +Nv7cQHOKDGB{2%PRV +Date: Thu, 22 Feb 2024 13:37:28 +0100 +Subject: [PATCH 04/13] 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 682451 -> 683007 bytes + configure.ac | 18 ++++++++++++++++++ + 2 files changed, 18 insertions(+) + +diff --git a/configure b/configure +index 81a01f255d8c54961f0ebde2437dc859954c2380..1818e364f63ab68d4c8c82a340ec3ccb55d44730 100755 +GIT binary patch +delta 1918 +zcmZ`(eN2^A7~ee~@8w>Bt01zFkCzW~#4TZnl16}Enat1;b5nsX_rAcp-R{NvUQp}< +zw5AjKSX*@lx`ZvwBDE%QR%?X=3g_G`bh>bjYNd@qjzx<*(hj`OX)Z2*obB1~`906` +zd!F;0Gd!Gm|3+p@k7b~(xwKIW1ayz4x&wa0sB-(Cuh+f0uU2*WJgUoG74-YPRrLX_ +zMn9l7x&peZ+N&9=q5IsL8m!aQjp{7JUFXt$s&3fR)doZJ2u!Wjd|JR26f9SuRtu_b +zzbLZ5PV=eN4Z7DeS3-41&sG(_*{WK=&d$9O5zpRNlq5wE3VeQ6VpS6Dvv!ka*lTp= +zY_hKSpRR%ovqY84tGkRx1&jB!S&pqu0N8KX^%^y(8A0_xn#pBV{gy;J=jSi?TZ&^% +zo3+$i%fQV39%Zw(aZ3!}eZz7lE-V#;CX_bY8|I-o?c +z=T=&6{OmHsHk%pvQ+v@Hkzn7fLmQWb&78we9YjfqGT*J^XtM%sIT+dpF`*M^5C4&& +zhbSZzKnDh!b)pN4!Y0q=!yh9j0Ur7kU7>8P(;CHp=tYkq(~SKb9f<(OiHiu6t|QOXIE9X%g|I)6Ym{FsnFB|^W|c`V-`q~d=2SQ^W^Z+pOAO)JebYi48J~!K3HJz +zoZdruGIhay6btreW%v`2%@iAMf#Sz(_*NF!b$K{TM!vfSe<){Eu?gq%gB$RubP6EV +z20@3m7SU*Ey& +z9WYv7C?=C*^KE+jiy +z?VorF8=b*cwkm`vci+KI7z3M{!n@d)XGt8tH-J +zCOPyM&VZ-EQzJ+{+#VBKox=xnNe6=P>NVuL0xH)P5EsDj6_9_Rt`M8G4B%_!Bwvoe +zv5Pb(0RGlK(ke412g!(B{h1d@hkRV^he@G)G$TjIcan4dP0|rrfd|G|8D9JNUWE92>*7_*fNnRErT!bhC6T!{oRenZuL>~21d=R0%hwEX!cF_Qx0C;AAb^?6#TFfy6Q++{UW5dsYejlAi-wl=4c +zeTs^G=#IE(lpAVowwn1Qm@d_}9wSr@ys!rxU3S>2v=d*CsxZljKyrr3h<^t+J!NnWC0Tz1%E%Qwim5 +z5=;G#s7L>^UF2lDoqW3^vh|VmxFrSVF2raOZvv8naxNzSgQAd@| +z9}+R;AT(&5e(P0H4fNSmDvR}^*TpUm`z$#j3MEO}-VtLY(Pi(6GC|yyA<>&cNPa9p +zW;#tnOYB%@`)0RoKe#^HZaYSFXjCjnW#i)$V#p%N3tx+kbGXa1Q{v9K48t?xC=W(I +zbzPKF>bqwkNC3w_RGIoW3;L)l_PC*&YWY0yeF26xxPzz4VLsQlE8w_?qUV-E78yo^ +zDzGICNjkq4rr5ea47mv(XPO{FbI`@D@Fv;l(VHHI0|`fa9)oZKKJ+AXFvR@`O1JEV +zBZ-jtUgE=bzohu^u2u->=|OmdExmFK`hsMs@&ib75xVaaShdi}_T&4Ppwi*+>LnN? +zu(?LA)w4fC9Z-gDoQ5?#dVLvoNN%!h2C8nzn)FXIa87VNlU;}2D{zDwow@>renJ;r +z^3ei9=DOpYtSc+zXc89;RLfNq?y8p8*ts!Ml0n?yYFWYD)EfE3O{CD#sNBiE{@y0f +z^IX5#DG&35+4i)o=0|k;c{$F}{V&SHUMg5LAb-szbn~!0NTt!B#dyz0GKj6iGOP`{ +zkVGkYpUcxs%9lMmSRgY~{?S;RJmFUu)*dF)TwOzVU0S;@;;Fe`s_J6a65 +zR2PBzfC}NHOZoIkmwJgU8tx+7DNj>>QLp0k1f_E_l`Ap1JLaiqfWmJVs9VA7Y=QZ2 +zu)ErdqLC1Om9En8i+Yu+y|<~wJYro}syuT@v-WQF2i>kuH`c0Bwtrx`YGZV5g{mTi +zX4x{()u4RXzEYKtwtuBM!D$T*YKFZUl&d@MRmb@uXWXwwco09VR*efuR<&JyMsLTj +z=XI+>zJ?XOY8O{EOV%uL>jrlgF8@@0N0PizH9%MRTs*GKNirwdoD?08yKW!&50~2J +AH2?qr + +diff --git a/configure.ac b/configure.ac +index 98a8fcefd4..2da7f8a74c 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~beta2/0005-Use-target-instead-of-host-when-relevant-in-configur.patch b/patches/5.2.0~beta2/0005-Use-target-instead-of-host-when-relevant-in-configur.patch new file mode 100644 index 00000000..0b863473 --- /dev/null +++ b/patches/5.2.0~beta2/0005-Use-target-instead-of-host-when-relevant-in-configur.patch @@ -0,0 +1,83 @@ +From 07915e1a0436afd7f63b05a1e37177a7acac5fbb Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Wed, 21 Feb 2024 19:05:44 +0100 +Subject: [PATCH 05/13] Use `target` instead of `host` when relevant in + configuration + +--- + configure | Bin 683007 -> 682372 bytes + configure.ac | 10 +++++----- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configure b/configure +index 1818e364f63ab68d4c8c82a340ec3ccb55d44730..230dfb0a404e12ade6a15bc17ca073a1bee1f5fc 100755 +GIT binary patch +delta 400 +zcmex=U9;t~X2TZ7&K=X&?O+t2K4~wbGH*#@QF>}gd}2;!VzKV@52Z}D=t6rL7i@pJ +zlW`9tn#9IprfJh%_b|Sm9{-k+Yr4%|MqbvG{Jd1I>3 +z`?%Pu__$1e;KL*`eeVuNj_p9pXS2vFD1anjO1KmhQgez^ffQI=NvXZzFe4B%0WmWW +zvj8#c_J+f3c08X+#4?>Tmt7d!m}UBp2TX!u +zJ}ycMwh9&23MCn-d0YxW092+l{o-n->C+EXaCA;rJ;cc0?s|w3h?#(x8Hibcn034B +zAvSBC=?xz2EYsJTb8v5;c#dri)AU#S*?6ZLICHXY54^}0*))B|A6DM&JA>Kngr^G! +zFb6Z`q)fk<#q0{A1z#}E*p|V5pK*FiF0%kg^zLq6U^A8r!UB67oL7A +zn_YJLk_)V|+r@I&+gYanzse{m;^G

Kp>}5|ZnuA1GiKnSOOO(`1Ot=NGWcwqGe= +O2V#!xR|+^c`~U!K8-2b2 + +diff --git a/configure.ac b/configure.ac +index 2da7f8a74c..436bae5a10 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -597,7 +597,7 @@ AS_IF([test x"$enable_ocamldoc" = "xno"], + # Initialization of libtool + # Allow the MSVC linker to be found even if ld isn't installed. + # User-specified LD still takes precedence. +-AC_CHECK_TOOLS([LD],[ld link]) ++AC_CHECK_TARGET_TOOLS([LD],[ld link]) + # libtool expects host_os=mingw for native Windows + # 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 +@@ -1027,7 +1027,7 @@ AS_CASE([$flexdll_source_dir,$supports_shared_libraries,$flexlink,$host], + + mkexe_cmd_exp="$CC" + +-AS_CASE([$ocaml_cc_vendor,$host], ++AS_CASE([$ocaml_cc_vendor,$target], + [*,x86_64-*-darwin*], + [oc_ldflags='-Wl,-no_compact_unwind'; + AC_DEFINE([HAS_ARCH_CODE32], [1])], +@@ -1045,7 +1045,7 @@ AS_CASE([$ocaml_cc_vendor,$host], + ) + ostype="Cygwin"], + [*,*-*-mingw32*], +- [AS_CASE([$host], ++ [AS_CASE([$target], + [i686-*-*], [oc_dll_ldflags="-static-libgcc"]) + ostype="Win32" + toolchain="mingw" +@@ -1342,7 +1342,7 @@ system=unknown + # preserving $arch = 'none' <=> $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~beta2/0006-WIP-Use-the-STRIP-command-automatically-detected-by-.patch b/patches/5.2.0~beta2/0006-WIP-Use-the-STRIP-command-automatically-detected-by-.patch new file mode 100644 index 00000000..63a75604 --- /dev/null +++ b/patches/5.2.0~beta2/0006-WIP-Use-the-STRIP-command-automatically-detected-by-.patch @@ -0,0 +1,73 @@ +From f6f07d207f853931da0b86e6850e71459e7dfe55 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Fri, 23 Feb 2024 12:00:32 +0100 +Subject: [PATCH 06/13] 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 682372 -> 682373 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 230dfb0a404e12ade6a15bc17ca073a1bee1f5fc..cd663ae8bcd6e2eec9d9cac0335dafa568b79bcf 100755 +GIT binary patch +delta 67 +zcmZp +Date: Mon, 26 Feb 2024 11:51:11 +0100 +Subject: [PATCH 07/13] 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 682373 -> 682882 bytes + configure.ac | 17 +++++++++++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/configure b/configure +index cd663ae8bcd6e2eec9d9cac0335dafa568b79bcf..6b168430ec6e22cac0a014b80bbfe826725d830f 100755 +GIT binary patch +delta 550 +zcmb7Ay-EW?5GFDHosGTCWbYuJaE%s%A%zHvl|>%l7|%&u*t-q8i!oT72y#VA3tvP? +z9qU?(cK_>>4L;?Qn?dHA1$1Iw5GlY`&K-!<1Z +r?!{|;cXCwJt{Tm6=6_sO6w`5yQD-bL8jMB85@VUMGMSE7A79=8j3KnF + +delta 60 +zcmZp=uGxB7vtbLPK>PHHW=8YvN}Y_=EbaSy8G)Dyh?#*H#AgL!HXvpPVvg +Date: Mon, 26 Feb 2024 12:06:45 +0100 +Subject: [PATCH 08/13] Define OS type to None + +--- + configure | Bin 682882 -> 682932 bytes + configure.ac | 4 +++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 6b168430ec6e22cac0a014b80bbfe826725d830f..02aee9274f708297fd7de913f4a1567651b069b9 100755 +GIT binary patch +delta 84 +zcmZp=uDRv9W@7PbS|HFUIewRH3H^HOWHz|7Q~G))C7E(IXSFD|Jp +gNVQe+1Ij8*R^*m$zj&Puh}nUdWBbMHoEs+t0L;1`{r~^~ + +delta 44 +xcmdmTU9;)BW@7PbS|r^`683%9f0U;|=yAm-T4dV_QQWB`I%5ZV9$ + +diff --git a/configure.ac b/configure.ac +index 44e370fc4f..52d93f6180 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~beta2/0009-Add-freestanding-targets-to-supported-configurations.patch b/patches/5.2.0~beta2/0009-Add-freestanding-targets-to-supported-configurations.patch new file mode 100644 index 00000000..00ec002b --- /dev/null +++ b/patches/5.2.0~beta2/0009-Add-freestanding-targets-to-supported-configurations.patch @@ -0,0 +1,40 @@ +From 2b54182296fad1e9e77bc6a5406ced4850128364 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Mon, 26 Feb 2024 19:35:26 +0100 +Subject: [PATCH 09/13] Add freestanding targets to supported configurations + +--- + configure | Bin 682932 -> 683087 bytes + configure.ac | 6 +++++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 02aee9274f708297fd7de913f4a1567651b069b9..f2fe4110503d86047d2a632f3a44323bf0fa4ce0 100755 +GIT binary patch +delta 99 +zcmdmTUGw}6&4w1n7N!>F7M2#)7Pc+y+mfgIN3wJBR#=$Do0;fp>E`9F7M2#)7Pc+y+mhP@Q`mu+1Bf}d2c~fSV+R0N2M +Date: Tue, 19 Mar 2024 19:14:29 +0100 +Subject: [PATCH 10/13] Check that the configured and the installed OCaml are + compatible + +--- + configure | Bin 683087 -> 683678 bytes + configure.ac | 7 +++++++ + 2 files changed, 7 insertions(+) + +diff --git a/configure b/configure +index f2fe4110503d86047d2a632f3a44323bf0fa4ce0..b17e1c9dfb52abd1376742ca6717e77c53b002fd 100755 +GIT binary patch +delta 462 +zcmX?qLv!9;&4w1n7N!>F7M2#)Eo|{zrpgN8sR~7@g{7HAsS1e-dHH#|$wm3a#k$G) +zxdoXysYMF;X$mD7sS3r3xv2_esYS(^`FYbDeb|jBANa(n4U&Nh!W3ra6_+IDXK4R5{;DP6>NbbDmYD=Ubv6VQ5@vt#FEUU +zoKyu3B;C^)m$HjV;E>duF1UzIV*0;0Mgfn^JRFJ?%8C_mTdt|3prqpC>F4U_ucTng +bm6iz(=k{JMHXvpPVh$kY+}_K@btn-4NHw0k + +delta 48 +zcmbPtSM&T0&4w1n7N!>F7M2#)Eo|{z)4T0C^xE(6umLeU5OV-A=k_~1T!#_?#5@uB + +diff --git a/configure.ac b/configure.ac +index 5333e5cf3a..c733d64a7a 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~beta2/0011-Use-the-target-pkg-config-to-detect-zstd.patch b/patches/5.2.0~beta2/0011-Use-the-target-pkg-config-to-detect-zstd.patch new file mode 100644 index 00000000..ecd6eb2d --- /dev/null +++ b/patches/5.2.0~beta2/0011-Use-the-target-pkg-config-to-detect-zstd.patch @@ -0,0 +1,43 @@ +From 5d794e027ff9e2690622a9a2ce5ccba139451a02 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Wed, 20 Mar 2024 17:41:26 +0100 +Subject: [PATCH 11/13] 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 683678 -> 683437 bytes + configure.ac | 2 +- + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index b17e1c9dfb52abd1376742ca6717e77c53b002fd..f5d947566b07d785fd25cc0e9c5a17f239e8176c 100755 +GIT binary patch +delta 145 +zcmbPtS99%c&4w1n7N!>F7M2#)7Pc1lEgU?=}(?8%5T@K;8@H&-R1y?AVf`fC5Hful7gDr +v^!iE;IkvRKoZ?ia?I)`_>=>sf)^RAZqyhz|>(+8ewKvsqY;UULl=%PvJLfS{ + +delta 159 +zcmZ2`TXWuB&4w1n7N!>F7M2#)7Pc1lEgU%so+@5yj{G8!IEh70p9NM&i;OGp6*Htwh9&23MCn-d0YxWfRNcf@j9zI +Date: Fri, 23 Feb 2024 16:56:07 +0100 +Subject: [PATCH 12/13] 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~beta2/0013-Set-Max_domains-to-1.patch b/patches/5.2.0~beta2/0013-Set-Max_domains-to-1.patch new file mode 100644 index 00000000..852a58f0 --- /dev/null +++ b/patches/5.2.0~beta2/0013-Set-Max_domains-to-1.patch @@ -0,0 +1,31 @@ +From eefe2cd555f7ee8e6ca3008702f23e33a6cd3cab Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Fri, 12 Apr 2024 19:21:52 +0200 +Subject: [PATCH 13/13] 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 +