commit:     135554b7ca1a6d753d83be2d57fc7fe2c2df2f01
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  4 22:13:39 2024 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Sun Aug  4 22:13:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=135554b7

sci-libs/openlibm: Bump to 0.8.3

Bug: https://bugs.gentoo.org/937338
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 sci-libs/openlibm/Manifest                         |  1 +
 .../files/openlibm-0.8.3-stack-protection.patch    | 73 ++++++++++++++++++++++
 sci-libs/openlibm/openlibm-0.8.3.ebuild            | 39 ++++++++++++
 3 files changed, 113 insertions(+)

diff --git a/sci-libs/openlibm/Manifest b/sci-libs/openlibm/Manifest
index 0672751ba741..85212eeed794 100644
--- a/sci-libs/openlibm/Manifest
+++ b/sci-libs/openlibm/Manifest
@@ -1,2 +1,3 @@
 DIST openlibm-0.7.5.tar.gz 366889 BLAKE2B 
cd892965122237783cc288e57c965ae56d26fdcce93d89dd764ba659d292ade20baa754af303f04b831902f62f95388e2e7e11c050a0712a235bbc5793f2a9c4
 SHA512 
fe5797f49e9f9ac70485c53c6096ac273c33c7b44fbb694788717f0e427fe9a8e121939c4c1334f2d20f2fe1f440d952cc20cbdd49717996a2fb9a1045b05799
 DIST openlibm-0.8.0.tar.gz 367130 BLAKE2B 
e516fee18203040b8f3cdffab10c4ca22df638551b420ec7e679ff373221973a013c93520b29395c61c8ef0f0f6c87516c1d4a9885c3bbb5e8cae8900efee6ea
 SHA512 
336dfac1fd4ab6ce256aa0129a211c3556eac46d2e775e5cec9626dc5bbcb4d5e65c86617d72e531694e8c8e6320a0fabc76600a02b0ac9f1d652774d0a94440
+DIST openlibm-0.8.3.tar.gz 374991 BLAKE2B 
91474b5c9480753dafb2f85521a8909eaa00febc871bd71d6ffecfd1001200ce66c66c43f4f5738215f04bc109035dcceb2a9f6319e8b9405e6cab65e802aafb
 SHA512 
1c6969e6e3117ddc066697318e43cf42d170750cb85cbed6013eb29d7513d5998eeffbff4a658d222cf637977cb7dca34b7a15814f8870f4e36e880673d757c0

diff --git a/sci-libs/openlibm/files/openlibm-0.8.3-stack-protection.patch 
b/sci-libs/openlibm/files/openlibm-0.8.3-stack-protection.patch
new file mode 100644
index 000000000000..91e28b238624
--- /dev/null
+++ b/sci-libs/openlibm/files/openlibm-0.8.3-stack-protection.patch
@@ -0,0 +1,73 @@
+# https://github.com/JuliaMath/openlibm/pull/307
+From 435459ec45b368e618578d2a526edd0c51709ad1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jakov=20Smoli=C4=87?= <[email protected]>
+Date: Mon, 5 Aug 2024 00:02:28 +0200
+Subject: [PATCH] Add stack markings for GNU to fmod assembly files
+
+This adds stack markings to the missing fmod .S files, otherwise the
+final libopenlibm object file gets marked with an executable stack.
+
+Output when compiling from source on Gentoo Linux:
+
+```
+ * QA Notice: The following files contain writable and executable sections
+ *  Files with such sections will not work properly (or at all!) on some
+ *  architectures/operating systems.  A bug should be filed at
+ *  https://bugs.gentoo.org/ to make sure the issue is fixed.
+ *  For more information, see:
+ *
+ *    https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
+ *
+ *  Please include the following list of files in your report:
+ *  Note: Bugs should be filed for the respective maintainers
+ *  of the package in question and not [email protected].
+ * RWX --- --- usr/lib64/libopenlibm.so.4.0
+```
+---
+ amd64/e_fmod.S  | 5 +++++
+ amd64/e_fmodf.S | 5 +++++
+ amd64/e_fmodl.S | 5 +++++
+ 3 files changed, 15 insertions(+)
+
+diff --git a/amd64/e_fmod.S b/amd64/e_fmod.S
+index 37cae39..d2c8ecd 100644
+--- a/amd64/e_fmod.S
++++ b/amd64/e_fmod.S
+@@ -49,3 +49,8 @@ ENTRY(fmod)
+       fstp    %st
+       ret
+ END(fmod)
++
++/* Enable stack protection */
++#if defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/amd64/e_fmodf.S b/amd64/e_fmodf.S
+index 197892e..b045e73 100644
+--- a/amd64/e_fmodf.S
++++ b/amd64/e_fmodf.S
+@@ -19,3 +19,8 @@ ENTRY(fmodf)
+       fstp    %st
+       ret
+ END(fmodf)
++
++/* Enable stack protection */
++#if defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/amd64/e_fmodl.S b/amd64/e_fmodl.S
+index 64be92f..cab539d 100644
+--- a/amd64/e_fmodl.S
++++ b/amd64/e_fmodl.S
+@@ -45,3 +45,8 @@ ENTRY(fmodl)
+       fstp    %st(1)
+       ret
+ END(fmodl)
++
++/* Enable stack protection */
++#if defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+-- 
+2.44.2
+

diff --git a/sci-libs/openlibm/openlibm-0.8.3.ebuild 
b/sci-libs/openlibm/openlibm-0.8.3.ebuild
new file mode 100644
index 000000000000..ca42e2a13e3b
--- /dev/null
+++ b/sci-libs/openlibm/openlibm-0.8.3.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="High quality system independent, open source libm"
+HOMEPAGE="https://github.com/JuliaLang/openlibm";
+SRC_URI="https://github.com/JuliaMath/openlibm/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+IUSE="static-libs"
+LICENSE="public-domain MIT ISC BSD-2 LGPL-2.1+"
+# See https://abi-laboratory.pro/index.php?view=timeline&l=openlibm
+SLOT="0/4"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~s390 ~x86 ~amd64-linux ~x86-linux"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-stack-protection.patch
+)
+
+src_prepare() {
+       default
+       sed -e "/^OLM_LIBS :=/s/^/#/" -i Makefile || die
+       if ! use static-libs ; then
+               sed -e "/install: /s/install-static//" -i Makefile || die
+       fi
+}
+
+src_configure() {
+       tc-export CC CXX FC AR LD
+       default
+}
+
+src_install() {
+       emake DESTDIR="${D}" prefix="${EPREFIX}/usr" \
+               libdir="${EPREFIX}/usr/$(get_libdir)" install
+       dodoc README.md
+}

Reply via email to