From d89245af283ea6faad959f02b74a3490cf6a0ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 21 Mar 2022 20:07:00 +0100 Subject: [PATCH 1/6] ocaml: fix aarch64-musl build Earlier fix for *-musl platforms has been "nopie=yes", which disables PIE by modifying CFLAGS/LDFLAGS/... during build. This results in OCaml's runtime shared library linking fail. Later OCaml releases incorporated a fix for *-musl platforms that properly disables PIE only where required. Set nopie_files instead, which respects OCaml's build system choice of CFLAGS/LDFLAGS/... and fixes aarch64-build. --- srcpkgs/ocaml/template | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/srcpkgs/ocaml/template b/srcpkgs/ocaml/template index 629c13791dfe..23599fbc1b46 100644 --- a/srcpkgs/ocaml/template +++ b/srcpkgs/ocaml/template @@ -1,7 +1,7 @@ # Template file for 'ocaml' pkgname=ocaml version=4.13.1 -revision=2 +revision=3 build_style="gnu-configure" configure_args="--with-pic --libdir=/usr/lib/ocaml" make_build_target="world.opt" @@ -22,7 +22,26 @@ case "$XBPS_TARGET_MACHINE" in ppc-musl) broken="/usr/bin/ocamlc: unsupported relocation type 6";; # https://github.com/ocaml/ocaml/issues/7562 # for ppc we solved this separately though - *-musl) nopie=yes ;; + *-musl) + nopie_files+=" + /usr/bin/ocamlc.opt + /usr/bin/ocamlcmt + /usr/bin/ocamlcp.opt + /usr/bin/ocamldep.opt + /usr/bin/ocamldoc.opt + /usr/bin/ocamllex.opt + /usr/bin/ocamlmklib.opt + /usr/bin/ocamlmktop.opt + /usr/bin/ocamlobjinfo.opt + /usr/bin/ocamlopt.opt + /usr/bin/ocamloptp.opt + /usr/bin/ocamlprof.opt + /usr/bin/ocamlrun + /usr/bin/ocamlrund + /usr/bin/ocamlruni + /usr/bin/ocamlyacc + " + ;; esac post_install() { From 0d306b7cfef7ee53b0fed30170b1ce8912ea7930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 21 Mar 2022 20:14:41 +0100 Subject: [PATCH 2/6] dune: set nopie=yes to fix aarch64-musl build --- srcpkgs/dune/template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/dune/template b/srcpkgs/dune/template index 178746cfc292..25472affd969 100644 --- a/srcpkgs/dune/template +++ b/srcpkgs/dune/template @@ -1,7 +1,7 @@ # Template file for 'dune' pkgname=dune version=3.0.3 -revision=1 +revision=2 makedepends="ocaml" depends="ocaml" short_desc="Composable build system for OCaml" @@ -11,6 +11,7 @@ homepage="https://dune.build/" distfiles="https://github.com/ocaml/dune/archive/refs/tags/${version}.tar.gz" checksum=8f5e1570e68f7b2e0a8d1ffea77318e058f125f4cb8ea9a4af9cf9afe4ced893 nocross="ocaml" +nopie=yes _dune_release_pkgs="dune dune-action-plugin dune-build-info dune-configurator dune-glob dune-private-libs dune-site dyn stdune ordering xdg fiber" From 7e332458d43e2854789a45e375e8679e019b4e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 21 Mar 2022 20:15:17 +0100 Subject: [PATCH 3/6] opam: set nopie=yes to fix aarch64-musl build --- srcpkgs/opam/template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/opam/template b/srcpkgs/opam/template index 236a2f963b70..fe103262ef59 100644 --- a/srcpkgs/opam/template +++ b/srcpkgs/opam/template @@ -1,7 +1,7 @@ # Template file for 'opam' pkgname=opam version=2.1.2 -revision=1 +revision=2 build_style=gnu-configure configure_args="--docdir=/usr/share/doc/${pkgname}" make_build_args="lib-ext all" @@ -16,6 +16,7 @@ homepage="http://opam.ocamlpro.com" distfiles="https://github.com/ocaml/${pkgname}/archive/${version}.tar.gz" checksum=735e717532f135064940fe3fef573acce6b1bbdc5e146470c2ac20fc8510a470 nocross=yes +nopie=yes disable_parallel_build=yes post_install() { From 04d31b6ff110dab52773b601291522dfefe9bfe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 21 Mar 2022 20:15:59 +0100 Subject: [PATCH 4/6] ocamlbuild: set nopie=yes to fix aarch64-musl build --- srcpkgs/ocamlbuild/template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/ocamlbuild/template b/srcpkgs/ocamlbuild/template index 077d5cc7f632..044b8f7aed12 100644 --- a/srcpkgs/ocamlbuild/template +++ b/srcpkgs/ocamlbuild/template @@ -1,7 +1,7 @@ # Template file for 'ocamlbuild' pkgname=ocamlbuild version=0.14.1 -revision=1 +revision=2 build_style=gnu-makefile make_build_args="PREFIX=/usr" make_install_args="PREFIX=/usr" @@ -13,3 +13,4 @@ homepage="https://github.com/ocaml/ocamlbuild" distfiles="https://github.com/ocaml/${pkgname}/archive/${version}.tar.gz" checksum=4e1279ff0ef80c862eaa5207a77020d741e89ef94f0e4a92a37c4188dbf08256 nocross=yes +nopie=yes From 09449441f75cd98e84e627f20973aaf80acce43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 21 Mar 2022 20:16:35 +0100 Subject: [PATCH 5/6] coccinelle: set nopie=yes to fix aarch64-musl build --- srcpkgs/coccinelle/template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/coccinelle/template b/srcpkgs/coccinelle/template index 211c9bdb4394..c9c80a611c9c 100644 --- a/srcpkgs/coccinelle/template +++ b/srcpkgs/coccinelle/template @@ -1,7 +1,7 @@ # Template file for 'coccinelle' pkgname=coccinelle version=1.1.0 -revision=3 +revision=4 build_style=gnu-configure configure_args="--without-pdflatex --enable-release --enable-opt --with-python=/usr/bin/python3" @@ -16,6 +16,7 @@ distfiles="https://github.com/coccinelle/coccinelle/archive/${version}.tar.gz" checksum=e40bdd51eda84f9bf3154c592ebb4af73a4dd9656c03e7ca1d3aa0247d98d185 disable_parallel_build=yes nocross=yes +nopie=yes pre_configure() { autoreconf -fi From 7a502d91092fd7251c047ba5b4a35f88304af5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 21 Mar 2022 20:17:46 +0100 Subject: [PATCH 6/6] unison: set nopie=yes to fix aarch64-musl build --- srcpkgs/unison/template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/unison/template b/srcpkgs/unison/template index 67c424a3b8af..bbcc19b90668 100644 --- a/srcpkgs/unison/template +++ b/srcpkgs/unison/template @@ -1,7 +1,7 @@ # Template file for 'unison' pkgname=unison version=2.51.4 -revision=2 +revision=3 hostmakedepends="ocaml" short_desc="File-synchronization tool" maintainer="allan " @@ -10,6 +10,7 @@ homepage="https://www.cis.upenn.edu/~bcpierce/unison/" distfiles="https://github.com/bcpierce00/unison/archive/v${version}.tar.gz" checksum=d1ecc7581aaf2ed0f3403d4960f468acd7b9f1d92838a17c96e6d1df79b802d5 nocross="OCaml does not cross compile" +nopie=yes do_build() { CFLAGS= make ${makejobs} UISTYLE=text DEBUGGING=false THREADS=true