From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3D21115808B for ; Fri, 25 Feb 2022 19:58:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6D8FEE081A; Fri, 25 Feb 2022 19:58:34 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4D055E081A for ; Fri, 25 Feb 2022 19:58:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 40480342E9E for ; Fri, 25 Feb 2022 19:58:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8C6A9287 for ; Fri, 25 Feb 2022 19:58:31 +0000 (UTC) From: "Alfredo Tupone" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alfredo Tupone" Message-ID: <1645819092.85fb0c39c57aae6d7795b6ee1259d53ecfebd882.tupone@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch dev-lang/ocaml/ocaml-4.12.1.ebuild X-VCS-Directories: dev-lang/ocaml/files/ dev-lang/ocaml/ X-VCS-Committer: tupone X-VCS-Committer-Name: Alfredo Tupone X-VCS-Revision: 85fb0c39c57aae6d7795b6ee1259d53ecfebd882 X-VCS-Branch: master Date: Fri, 25 Feb 2022 19:58:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 298856db-eaa6-4002-89c8-a19e60b7253c X-Archives-Hash: dc2bf0c9eb5568dd35fc65c713dd0a66 commit: 85fb0c39c57aae6d7795b6ee1259d53ecfebd882 Author: Alfredo Tupone gentoo org> AuthorDate: Fri Feb 25 19:58:12 2022 +0000 Commit: Alfredo Tupone gentoo org> CommitDate: Fri Feb 25 19:58:12 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85fb0c39 dev-lang/ocaml: fix TEXTREL on 4.12.1 Closes: https://bugs.gentoo.org/825282 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alfredo Tupone gentoo.org> .../files/ocaml-4.12.1-fix-textrel-riscv.patch | 46 ++++++++++++++++++++++ dev-lang/ocaml/ocaml-4.12.1.ebuild | 1 + 2 files changed, 47 insertions(+) diff --git a/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch b/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch new file mode 100644 index 000000000000..5ba8582d3a65 --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch @@ -0,0 +1,46 @@ +From ddf99786f8229c8282905af5c7c74360d4f2fbd0 Mon Sep 17 00:00:00 2001 +From: Alex Fan +Date: Tue, 22 Feb 2022 19:28:30 +1100 +Subject: [PATCH] riscv: Generate frametable in data section to improve code + relocatability (#11042) + +Similar to what PowerPC and System-Z have done in commit 24980d3fd9848e281761ef2b8fe383e71261789b + +With this commit ocamlopt produces .so shared libraries and PIE relocatable +executables that contain no relocations in the text segment. + +Upstream status: merged in 4.14 and 5.x +--- + Changes | 5 +++++ + asmcomp/riscv/emit.mlp | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/Changes b/Changes +index 4898e9d69fc..2bec76daac6 100644 +--- a/Changes ++++ b/Changes +@@ -477,6 +477,11 @@ OCaml 4.14.0 + - #10907, #10959: Wrong type inferred from existential types + (Jacques Garrigue and Gabriel Scherer, report by @dyzsr, review by Leo White) + ++- #10688: Move frame descriptor table from `rodata` to `data` section on ++ RISC-V. Improves support for building DLLs and PIEs. In particular, this ++ applies to all binaries in distributions that build PIEs by default (eg ++ Gentoo and Alpine). ++ (Alex Fan, review by Gabriel Scherer) + + OCaml 4.13 maintenance branch + ----------------------------- +diff --git a/asmcomp/riscv/emit.mlp b/asmcomp/riscv/emit.mlp +index 474a3c6857a..b36aa0ea38c 100644 +--- a/asmcomp/riscv/emit.mlp ++++ b/asmcomp/riscv/emit.mlp +@@ -645,7 +645,7 @@ let end_assembly() = + `{emit_symbol lbl_end}:\n`; + ` .quad 0\n`; + (* Emit the frame descriptors *) +- ` {emit_string rodata_space}\n`; ++ ` {emit_string data_space}\n`; (* not rodata because relocations inside *) + let lbl = Compilenv.make_symbol (Some "frametable") in + declare_global_data lbl; + `{emit_symbol lbl}:\n`; diff --git a/dev-lang/ocaml/ocaml-4.12.1.ebuild b/dev-lang/ocaml/ocaml-4.12.1.ebuild index fd6cae2fff2c..70049fcc0ae4 100644 --- a/dev-lang/ocaml/ocaml-4.12.1.ebuild +++ b/dev-lang/ocaml/ocaml-4.12.1.ebuild @@ -24,6 +24,7 @@ QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs' PATCHES=( "${FILESDIR}"/${PN}-4.12.0-glibc-2.34.patch + "${FILESDIR}"/${P}-fix-textrel-riscv.patch ) src_prepare() {