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 index 59a0ad04..13a9a80d 100644 --- 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 @@ -1,7 +1,7 @@ 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 +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 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 index ff0f2e57..6ea34521 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 02/14] Include `config.h` before `HAS_GETTIMEOFDAY` is tested Also remove a duplicate `errno.h` --- 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 index 7902a8c9..3fb5840a 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 03/14] Detect and use {CC,...}_FOR_BUILD to build sak --- Makefile | 9 +- diff --git a/patches/5.2.0~beta2/0004-Use-target-instead-of-host-to-detect-the-C-toolchain.patch b/patches/5.2.0~beta2/0004-Use-target-instead-of-host-to-detect-the-C-toolchain.patch index af293dc6..ae2d46cc 100644 --- a/patches/5.2.0~beta2/0004-Use-target-instead-of-host-to-detect-the-C-toolchain.patch +++ b/patches/5.2.0~beta2/0004-Use-target-instead-of-host-to-detect-the-C-toolchain.patch @@ -1,7 +1,7 @@ From 9454c7ed8a83504a2c6f6dd98937f08b37c9a7ad Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Thu, 22 Feb 2024 13:37:28 +0100 -Subject: [PATCH 04/13] Use `target` instead of `host` to detect the C +Subject: [PATCH 04/14] Use `target` instead of `host` to detect the C toolchain When building a cross-compiler, the runtime will run on the target, not 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 index 0b863473..4a763e09 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 05/14] Use `target` instead of `host` when relevant in configuration --- 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 index 63a75604..2ffe6017 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 06/14] WIP Use the STRIP command automatically detected by libtool libtool configuration will try and detect the `strip` for the code diff --git a/patches/5.2.0~beta2/0007-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch b/patches/5.2.0~beta2/0007-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch index 1e1b9071..a08bf038 100644 --- a/patches/5.2.0~beta2/0007-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch +++ b/patches/5.2.0~beta2/0007-Allow-ocaml-as-a-target-OS-to-configure-freestanding.patch @@ -1,7 +1,7 @@ From 6e6c8b41f026e5c8932abd2f777688b84b659fc0 Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Mon, 26 Feb 2024 11:51:11 +0100 -Subject: [PATCH 07/13] Allow `ocaml` as a target OS to configure freestanding +Subject: [PATCH 07/14] Allow `ocaml` as a target OS to configure freestanding cross-compilers Allow the use of *-*-ocaml or *-*-*-ocaml target triplets to stand for diff --git a/patches/5.2.0~beta2/0008-Define-OS-type-to-None.patch b/patches/5.2.0~beta2/0008-Define-OS-type-to-None.patch index c1df2c29..57301dc2 100644 --- a/patches/5.2.0~beta2/0008-Define-OS-type-to-None.patch +++ b/patches/5.2.0~beta2/0008-Define-OS-type-to-None.patch @@ -1,7 +1,7 @@ From 6d522758a2ead363666eeb5ddbd3b99b23cd3dc4 Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Mon, 26 Feb 2024 12:06:45 +0100 -Subject: [PATCH 08/13] Define OS type to None +Subject: [PATCH 08/14] Define OS type to None --- configure | Bin 682882 -> 682932 bytes 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 index 00ec002b..9bf11414 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 09/14] Add freestanding targets to supported configurations --- configure | Bin 682932 -> 683087 bytes diff --git a/patches/5.2.0~beta2/0010-Check-that-the-configured-and-the-installed-OCaml-ar.patch b/patches/5.2.0~beta2/0010-Check-that-the-configured-and-the-installed-OCaml-ar.patch index c02d47d4..3064455a 100644 --- a/patches/5.2.0~beta2/0010-Check-that-the-configured-and-the-installed-OCaml-ar.patch +++ b/patches/5.2.0~beta2/0010-Check-that-the-configured-and-the-installed-OCaml-ar.patch @@ -1,7 +1,7 @@ From 099399cee91a0a0930e51dcc6274aa1cbd7ba334 Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Tue, 19 Mar 2024 19:14:29 +0100 -Subject: [PATCH 10/13] Check that the configured and the installed OCaml are +Subject: [PATCH 10/14] Check that the configured and the installed OCaml are compatible --- 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 index ecd6eb2d..961ac274 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 11/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 diff --git a/patches/5.2.0~beta2/0012-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch b/patches/5.2.0~beta2/0012-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch index 9d965661..8aa5968f 100644 --- a/patches/5.2.0~beta2/0012-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch +++ b/patches/5.2.0~beta2/0012-WIP-Add-a-Makefile.cross-for-recipes-to-build-a-cros.patch @@ -1,7 +1,7 @@ From bd0e90919cea8757301115da1698728dd89f4709 Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Fri, 23 Feb 2024 16:56:07 +0100 -Subject: [PATCH 12/13] WIP Add a Makefile.cross for recipes to build a +Subject: [PATCH 12/14] WIP Add a Makefile.cross for recipes to build a cross-compiler Define cross.opt and cross-install targets 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 index 852a58f0..0e590132 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 13/14] Set Max_domains to 1 Solo5 is single-core with no scheduler, so avoid the useless memory waste diff --git a/patches/5.2.0~beta2/0014-Set-stack-as-non-executable-on-freestanding-targets.patch b/patches/5.2.0~beta2/0014-Set-stack-as-non-executable-on-freestanding-targets.patch new file mode 100644 index 00000000..f68fd3d0 --- /dev/null +++ b/patches/5.2.0~beta2/0014-Set-stack-as-non-executable-on-freestanding-targets.patch @@ -0,0 +1,53 @@ +From e5be9f05c33da4c466bb01d2de34f1cec23d1706 Mon Sep 17 00:00:00 2001 +From: Samuel Hym +Date: Mon, 29 Apr 2024 18:21:24 +0200 +Subject: [PATCH 14/14] Set stack as non-executable on freestanding targets + +--- + asmcomp/amd64/emit.mlp | 2 +- + asmcomp/arm64/emit.mlp | 2 +- + runtime/amd64.S | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp +index 619ce9c3c5..19f896c1ac 100644 +--- a/asmcomp/amd64/emit.mlp ++++ b/asmcomp/amd64/emit.mlp +@@ -1079,7 +1079,7 @@ let end_assembly() = + D.size frametable (ConstSub (ConstThis, ConstLabel frametable)) + end; + +- if system = S_linux then ++ if system = S_linux || system = S_unknown then + (* Mark stack as non-executable, PR#4564 *) + D.section [".note.GNU-stack"] (Some "") [ "%progbits" ]; + +diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp +index 1816f8c345..41769e4f93 100644 +--- a/asmcomp/arm64/emit.mlp ++++ b/asmcomp/arm64/emit.mlp +@@ -1217,7 +1217,7 @@ let end_assembly () = + emit_symbol_type emit_symbol lbl "object"; + emit_symbol_size lbl; + begin match Config.system with +- | "linux" -> ++ | "linux" | "none" -> + (* Mark stack as non-executable *) + ` .section .note.GNU-stack,\"\",%progbits\n` + | _ -> () +diff --git a/runtime/amd64.S b/runtime/amd64.S +index 49c712b167..be0856a72b 100644 +--- a/runtime/amd64.S ++++ b/runtime/amd64.S +@@ -1386,7 +1386,7 @@ G(caml_negf_mask): + G(caml_absf_mask): + .quad 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF + +-#if defined(SYS_linux) ++#if defined(SYS_linux) || defined(SYS_none) + /* Mark stack as non-executable, PR#4564 */ + .section .note.GNU-stack,"",%progbits + #endif +-- +2.43.0 +