* update ocaml to 4.14.1-2

This commit is contained in:
Alexander Baldeck 2023-10-13 15:00:42 +02:00
parent 8f3413f52d
commit 8ffe9e36e9
3 changed files with 212 additions and 1033 deletions

View File

@ -3,8 +3,8 @@
pkgbase='ocaml'
pkgname=('ocaml' 'ocaml-compiler-libs')
pkgver=5.1.0
pkgrel=1
pkgver=4.14.1
pkgrel=2
pkgdesc="A functional language with OO extensions"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('LGPL2.1' 'custom: QPL-1.0')
@ -12,14 +12,14 @@ url="https://caml.inria.fr/"
makedepends=('ncurses>=5.6-7')
optdepends=('ncurses: advanced ncurses features' 'tk: advanced tk features')
source=(https://caml.inria.fr/distrib/ocaml-${pkgver%.*}/${pkgname}-${pkgver}.tar.xz
ocaml-5.0.0-elfv2-ppc64.patch)
sha512sums=('23579b76592e225f2ddec58d78084dfd11befede18b61be71d3896fd72a90cc0fe4fb1f64a7dcbc83239ed69ec4254e13ab86fd810671851044c2a353da3adc5'
'a7063fd3ce8f0622fafa9619b986abb11e2811c7e8e79973317c9c64f357a6d293b4057a258cf2de5446ed2014c41593cdbb65b874b2bbf17a9d4fe181c505d8')
ocaml-4.08.0-elfv2-ppc64.patch)
sha512sums=('326a063e7e18ec55a21fbb129e4b2915733e67166ec1d94412875853aa10fbfb27fdfc9f6440ce65b188924b93f3cb8d01b0c4640179a5a12bc4e561f48b3e5b'
'a6dd3a2cfef21c1df7286ec2f4ad6ca48deac1f450232e7533a46e00867b0b1521d228345b5ee7212dc86c8e39295d152aed27c3e7f374b4c6a5595c425422a6')
options=('!makeflags' '!emptydirs' 'staticlibs')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -Np1 -i ${srcdir}/ocaml-5.0.0-elfv2-ppc64.patch
patch -Np1 -i ${srcdir}/ocaml-4.08.0-elfv2-ppc64.patch
}
build() {
@ -28,17 +28,11 @@ build() {
CXXFLAGS+=' -ffat-lto-objects'
case "${CARCH}" in
powerpc*)
_configure_flags=(--disable-native-compiler)
_make_target="world"
;;
*)
_make_target="world-opt"
;;
x86_64) _configure_flags=(--enable-frame-pointers)
esac
./configure --prefix /usr --mandir /usr/share/man ${_configure_flags[@]}
make --debug=v ${_make_target}
./configure --prefix /usr --mandir /usr/share/man --disable-force-safe-string ${_configure_flags[@]}
make --debug=v world.opt
}
package_ocaml() {
@ -65,8 +59,11 @@ optdepends=()
cd "${srcdir}/${pkgbase}-${pkgver}"
make DESTDIR="${pkgdir}" install
# Remove non-compiler-libs
find "${pkgdir}/usr/lib/ocaml/" -mindepth 1 -maxdepth 1 -not -name "compiler-libs" -execdir rm -rf "{}" "+"
rm -rf "${pkgdir}/usr/bin" "${pkgdir}/usr/share"
rm -rf "${pkgdir}/usr/bin" "${pkgdir}/usr/lib/ocaml/caml" \
"${pkgdir}/usr/lib/ocaml/ocamldoc" "${pkgdir}/usr/lib/ocaml/stublibs" \
"${pkgdir}/usr/lib/ocaml/threads" "${pkgdir}/usr/share"
find "${pkgdir}/usr/lib/ocaml/" -maxdepth 1 -type f -delete
install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
install -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/"
}

View File

@ -0,0 +1,198 @@
--- ocaml-4.08.0/asmcomp/power/arch.ml
+++ ocaml-4.08.0/asmcomp/power/arch.ml
@@ -28,7 +28,7 @@ type abi = ELF32 | ELF64v1 | ELF64v2
let abi =
match Config.model with
| "ppc" -> ELF32
- | "ppc64" -> ELF64v1
+ | "ppc64" -> ELF64v2
| "ppc64le" -> ELF64v2
| _ -> assert false
--- ocaml-4.10.0/runtime/power.S
+++ ocaml-4.10.0/runtime/power.S
@@ -13,7 +13,7 @@
/* */
/**************************************************************************/
-#if defined(MODEL_ppc64le)
+#if _CALL_ELF == 2
.abiversion 2
#endif
@@ -52,8 +52,7 @@
#define TRAP_PREVIOUS_OFFSET 4
#define CALLBACK_LINK_SIZE 16
#define CALLBACK_LINK_OFFSET 0
-#endif
-#if defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
#define RESERVED_STACK 48
#define PARAM_SAVE_AREA (8*8)
#define LR_SAVE 16
@@ -64,8 +63,7 @@
#define TRAP_PREVIOUS_OFFSET 64
#define CALLBACK_LINK_SIZE 32
#define CALLBACK_LINK_OFFSET 48
-#endif
-#if defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
#define RESERVED_STACK 32
#define PARAM_SAVE_AREA 0
#define LR_SAVE 16
@@ -91,9 +89,8 @@
#define ENDFUNCTION(name) \
.size name, . - name
-#endif
-#if defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
#define FUNCTION(name) \
.section ".opd","aw"; \
.align 3; \
@@ -107,9 +104,8 @@
#define ENDFUNCTION(name) \
.size name, . - .L.name
-#endif
-#if defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
#define FUNCTION(name) \
.section ".text"; \
.globl name; \
@@ -151,7 +147,7 @@
#define Caml_state(var) 8*domain_field_caml_##var(28)
-#if defined(MODEL_ppc64)
+#if _CALL_ELF == 1
.section ".opd","aw"
#else
.section ".text"
@@ -332,14 +328,14 @@
#if defined(MODEL_ppc)
mtctr C_CALL_FUN
bctrl
-#elif defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
ld 0, 0(C_CALL_FUN)
mr C_CALL_TOC, 2 /* save current TOC in a callee-save register */
mtctr 0
ld 2, 8(C_CALL_FUN)
bctrl
mr 2, C_CALL_TOC /* restore current TOC */
-#elif defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
mtctr C_CALL_FUN
mr 12, C_CALL_FUN
mr C_CALL_TOC, 2 /* save current TOC in a callee-save register */
@@ -515,14 +511,14 @@
#if defined(MODEL_ppc)
mtctr 12
.L105: bctrl
-#elif defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
ld 0, 0(12)
mtctr 0
std 2, TOC_SAVE(1)
ld 2, 8(12)
.L105: bctrl
ld 2, TOC_SAVE(1)
-#elif defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
mtctr 12
std 2, TOC_SAVE(1)
.L105: bctrl
@@ -641,7 +637,7 @@
b .L102
ENDFUNCTION(caml_callback3_asm)
-#if defined(MODEL_ppc64)
+#if _CALL_ELF == 1
.section ".opd","aw"
#else
.section ".text"
--- ocaml-4.08.0/testsuite/tools/asmgen_power.S
+++ ocaml-4.08.0/testsuite/tools/asmgen_power.S
@@ -25,12 +25,10 @@
#if defined(MODEL_ppc)
#define RESERVED_STACK 16
#define LR_SAVE_AREA 4
-#endif
-#if defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
#define RESERVED_STACK 48
#define LR_SAVE_AREA 16
-#endif
-#if defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
#define RESERVED_STACK 32
#define LR_SAVE_AREA 16
#endif
@@ -44,9 +42,8 @@
.type name, @function; \
.align 2; \
name:
-#endif
-#if defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
#define FUNCTION(name) \
.section ".opd","aw"; \
.align 3; \
@@ -56,9 +53,8 @@
.text; \
.align 2; \
.L.name:
-#endif
-#if defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
#define FUNCTION(name) \
.section ".text"; \
.globl name; \
@@ -118,11 +114,11 @@ FUNCTION(call_gen_code)
/* Get function pointer in CTR */
#if defined(MODEL_ppc)
mtctr 3
-#elif defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
ld 0, 0(3)
mtctr 0
ld 2, 8(3)
-#elif defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
mtctr 3
mr 12, 3
#else
@@ -184,11 +180,11 @@ FUNCTION(caml_c_call)
/* Jump to C function (address in r28) */
#if defined(MODEL_ppc)
mtctr 28
-#elif defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
ld 0, 0(28)
mtctr 0
ld 2, 8(28)
-#elif defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
mtctr 28
mr 12, 28
#else
--- ocaml-4.08.0/runtime/caml/stack.h
+++ ocaml-4.08.0/runtime/caml/stack.h
@@ -35,10 +35,10 @@
#if defined(MODEL_ppc)
#define Saved_return_address(sp) *((intnat *)((sp) - 4))
#define Callback_link(sp) ((struct caml_context *)((sp) + 16))
-#elif defined(MODEL_ppc64)
+#elif _CALL_ELF == 1
#define Saved_return_address(sp) *((intnat *)((sp) + 16))
#define Callback_link(sp) ((struct caml_context *)((sp) + (48 + 32)))
-#elif defined(MODEL_ppc64le)
+#elif _CALL_ELF == 2
#define Saved_return_address(sp) *((intnat *)((sp) + 16))
#define Callback_link(sp) ((struct caml_context *)((sp) + (32 + 32)))
#else

File diff suppressed because it is too large Load Diff