From ca88bf80c5b3cb9cb876feb63065ffc50404fd05 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 21 Aug 2020 01:40:03 +0200 Subject: [PATCH] ocaml: prevent no-pie on ppc64*-musl, add nopie=yes on ARMs --- .../ocaml/patches/ocaml-4.08.0-ppc-pie.patch | 22 +++++++++++++++++++ srcpkgs/ocaml/template | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/srcpkgs/ocaml/patches/ocaml-4.08.0-ppc-pie.patch b/srcpkgs/ocaml/patches/ocaml-4.08.0-ppc-pie.patch index 8f8a0d747e4..333276741c7 100644 --- a/srcpkgs/ocaml/patches/ocaml-4.08.0-ppc-pie.patch +++ b/srcpkgs/ocaml/patches/ocaml-4.08.0-ppc-pie.patch @@ -18,3 +18,25 @@ .globl caml_system__frametable .type caml_system__frametable, @object caml_system__frametable: +--- ocaml-4.11.0/configure.ac ++++ ocaml-4.11.0/configure.ac +@@ -1006,7 +1006,7 @@ AS_IF([test $arch != "none" && $arch64 ], + # e.g. Ubuntu >= 17.10 for i386, which uses the glibc dynamic loader. + + AS_CASE([$arch], +- [amd64|s390x|none], ++ [amd64|s390x|power|none], + # ocamlopt generates PIC code or doesn't generate code at all + [], + [AS_CASE([$host], +--- ocaml-4.11.0/configure ++++ ocaml-4.11.0/configure +@@ -13886,7 +13886,7 @@ + # e.g. Ubuntu >= 17.10 for i386, which uses the glibc dynamic loader. + + case $arch in #( +- amd64|s390x|none) : ++ amd64|s390x|power|none) : + # ocamlopt generates PIC code or doesn't generate code at all + ;; #( + *) : diff --git a/srcpkgs/ocaml/template b/srcpkgs/ocaml/template index 64b8aba83a1..54317337d95 100644 --- a/srcpkgs/ocaml/template +++ b/srcpkgs/ocaml/template @@ -18,8 +18,12 @@ patch_args="-Np1" export ASPP="cc -c" case "$XBPS_TARGET_MACHINE" in + x86_64*|ppc64*) ;; # also just segfaults when compiled without PIE (BSS-PLT?) 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 ;; esac post_install() {