summaryrefslogtreecommitdiff
path: root/sys-apps/fix-gnustack
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-11 11:44:03 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-11 11:44:03 +0000
commitdf26c7469c1f2af2e643d43e2e32a6c9142e4885 (patch)
tree1beee9b11d06bfcc69d1d6c8ab00566f8633aec1 /sys-apps/fix-gnustack
parentad391b961414c99124b93cb86695c04bd8d57937 (diff)
gentoo auto-resync : 11:01:2023 - 11:44:03
Diffstat (limited to 'sys-apps/fix-gnustack')
-rw-r--r--sys-apps/fix-gnustack/Manifest6
-rw-r--r--sys-apps/fix-gnustack/files/0.1/0001-fix-gnustack-respect-CFLAGS-LDFLAGS-for-tests.patch28
-rw-r--r--sys-apps/fix-gnustack/files/0.1/0002-fix-gnustack-add-set-x-in-tests-for-easier-debugging.patch22
-rw-r--r--sys-apps/fix-gnustack/files/0.1/0003-fix-gnustack-pass-Wl-z-execstack-for-tests-with-Clan.patch26
-rw-r--r--sys-apps/fix-gnustack/fix-gnustack-0.1-r1.ebuild30
-rw-r--r--sys-apps/fix-gnustack/metadata.xml4
6 files changed, 115 insertions, 1 deletions
diff --git a/sys-apps/fix-gnustack/Manifest b/sys-apps/fix-gnustack/Manifest
index 30bc784d14e7..591dfbe4b728 100644
--- a/sys-apps/fix-gnustack/Manifest
+++ b/sys-apps/fix-gnustack/Manifest
@@ -1,3 +1,7 @@
+AUX 0.1/0001-fix-gnustack-respect-CFLAGS-LDFLAGS-for-tests.patch 778 BLAKE2B a351284c1fc435934d2b0057234c1b288b04c6095b1ae117cc124c7ca66a8cac2ccb885ff5826d5e755293abb2a98408ee0a1778c4e551636f4d732e921c9f47 SHA512 2b697b69917ea2a0c8fac1aad4091595c61bfdc9feb3cc0f7d6607af952e71cea2c53aaad6720fa84f4ecfa47b143ec97d26de04a511c0e2517c4b4abddfa2c7
+AUX 0.1/0002-fix-gnustack-add-set-x-in-tests-for-easier-debugging.patch 680 BLAKE2B 0914a7c064030433fa9cd9ae4e4868b5ee38711a64669e3fcd4a4e947ad5e5c9df33720a9ba121c7bc786ecd3dea89f17bd683bef3f586554063af9fd7c6326f SHA512 b89278cd23c6c0cd4c9255f26afb194da06d1c16d8cd9cf7a30ea35d8f8a2ca0b26e5630c357f9c06e13ffce643823c2448d8eeb7e6b7f8176650cb6712930c5
+AUX 0.1/0003-fix-gnustack-pass-Wl-z-execstack-for-tests-with-Clan.patch 858 BLAKE2B 50035def4bdd8782953dd4764c1cb006512fc1f97b9fe7473fa0b84df50d6005ff11508e84c249da8db398e6da611de014e556d78e7ae1ab44282c4e33363891 SHA512 302e7fd419b09f0e2076f9f8d737b54fa423873f7f917d6a8530e12f547cf2a0e6bdb5a2ffab5f32053c6f82aaaef83f4ca4564584281799ca2a1c468bfcc2f9
DIST fix-gnustack-0.1.tar.bz2 105457 BLAKE2B 25825972d0a37335a6d6aec316e4dc972d6590da5d7d1145252b3fb4fbbf6276cc7818e47270065583558adf36522ea26652f8e7212a2046fc0d54c131ad5324 SHA512 df83beef5533003ceedda799bb27af15f877d2b3bc7c8213b2ac64a100270790655de3836eaa0ab8411d9eb91a6056e4902973b740b9b0791dcc5477226544a1
+EBUILD fix-gnustack-0.1-r1.ebuild 639 BLAKE2B faaa0d1361e85f616e65987a6e60825f0b50566c5d6839f29e37cbfe7f630ca14362451aba4007322308a7f3d98eefd73f729d6703150aa653dd469d712cfd4a SHA512 3749fc2405744fa89c87ed0382438e8edf06f7489f0f1724f67d039f83f9aaeaf86e4618fc6feb3261dd2829c728312cd0233b0e7c9d580115bde5ae7c1fc051
EBUILD fix-gnustack-0.1.ebuild 443 BLAKE2B 6ff06d40ef5a3aa53e19b028b738c81a8029a13a7fca90d7728010f1ddcd91347988368ec37fd828419106832c91c36cc4c0835b7d16ccdeffc2b785e5c620d4 SHA512 26693f127e2c878cfa585afb46602b742c4c1bdbadc77243c7dfa11aa8fb52ff80bc2954641c8dcd378bfdd7050aa1cd3861a034d51dc2a327577ceb2b2ba808
-MISC metadata.xml 338 BLAKE2B 73df8ab9fd015c49a1e7f9915c2e3df4959fab90d2decfb844e359b58c9300c0a2ca0926d80974574cb274b21de93dbe5c410b6fdc26d29a9a1e353b508ae5df SHA512 6be488568edeee9aaa740da57adf79d751b395ee82ab60a3d121dead2f6513d8856898fdcdbf7f6ce378abfd924d7fcacd3a3d0c02531fffa365284bab308d8f
+MISC metadata.xml 465 BLAKE2B dd1c394fa274793a675b48ee9d86936ea01a0a4f9ac277bfd6df4e737da3eacc31b0140a3bd6da2b032a77fdc5499a70e91a0a02a557698e4f4dab5483963141 SHA512 31167b524a7302d8458cd1fa932fd108609eadd88844f23ce28b13f7412a762894b5801ad54dff36db86c6e089f39e0db39f135704449492087ad3762fd8ce31
diff --git a/sys-apps/fix-gnustack/files/0.1/0001-fix-gnustack-respect-CFLAGS-LDFLAGS-for-tests.patch b/sys-apps/fix-gnustack/files/0.1/0001-fix-gnustack-respect-CFLAGS-LDFLAGS-for-tests.patch
new file mode 100644
index 000000000000..f0c786abf183
--- /dev/null
+++ b/sys-apps/fix-gnustack/files/0.1/0001-fix-gnustack-respect-CFLAGS-LDFLAGS-for-tests.patch
@@ -0,0 +1,28 @@
+From 4fb8a9cb2a5410aa565d028bd8deb53d8682da62 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 6 Jan 2023 05:39:13 +0000
+Subject: [PATCH 1/3] fix-gnustack: respect CFLAGS, LDFLAGS for tests
+
+Needed to correctly run tests with Clang, as Clang doesn't create
+executable stacks by default.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -5,11 +5,11 @@ noinst_PROGRAMS = bad-gnustack
+ EXTRA_DIST = gnustacktest.sh
+
+ bad-gnustack.s: bad-gnustack.c
+- $(CC) -S $<
++ $(CC) $(CPPFLAGS) $(CFLAGS) -S $<
+ $(SED) -i -e 's/GNU-stack,"",/GNU-stack,"x",/' $@
+
+ bad-gnustack$(EXEEXT): bad-gnustack.s
+- $(CC) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ check_SCRIPTS = gnustacktest
+ TEST = $(check_SCRIPTS)
+--
+2.39.0
+
diff --git a/sys-apps/fix-gnustack/files/0.1/0002-fix-gnustack-add-set-x-in-tests-for-easier-debugging.patch b/sys-apps/fix-gnustack/files/0.1/0002-fix-gnustack-add-set-x-in-tests-for-easier-debugging.patch
new file mode 100644
index 000000000000..16ade32c2bd1
--- /dev/null
+++ b/sys-apps/fix-gnustack/files/0.1/0002-fix-gnustack-add-set-x-in-tests-for-easier-debugging.patch
@@ -0,0 +1,22 @@
+From 87ca5c5bbe63ea3c9227fdd4a01ccdc1ce723323 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 6 Jan 2023 05:39:43 +0000
+Subject: [PATCH 2/3] fix-gnustack: add 'set -x' in tests for easier debugging
+
+It's hard to see why something failed otherwise, as we only have the
+exit code.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/tests/gnustacktest.sh
++++ b/tests/gnustacktest.sh
+@@ -16,6 +16,7 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #
++set -x
+
+ before=$(../fix-gnustack -f bad-gnustack)
+ before=$(echo ${before} | awk '{ print $2 }')
+--
+2.39.0
+
diff --git a/sys-apps/fix-gnustack/files/0.1/0003-fix-gnustack-pass-Wl-z-execstack-for-tests-with-Clan.patch b/sys-apps/fix-gnustack/files/0.1/0003-fix-gnustack-pass-Wl-z-execstack-for-tests-with-Clan.patch
new file mode 100644
index 000000000000..66ffa5e5136d
--- /dev/null
+++ b/sys-apps/fix-gnustack/files/0.1/0003-fix-gnustack-pass-Wl-z-execstack-for-tests-with-Clan.patch
@@ -0,0 +1,26 @@
+From c8a1d365ff1349cc438352917863ed98ee34a80f Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 11 Jan 2023 07:09:53 +0000
+Subject: [PATCH 3/3] fix-gnustack: pass -Wl,-z,execstack for tests with Clang
+
+Clang doesn't create executable stacks by default, so we need to force it
+for the purposes of the tests.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -8,8 +8,10 @@ bad-gnustack.s: bad-gnustack.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -S $<
+ $(SED) -i -e 's/GNU-stack,"",/GNU-stack,"x",/' $@
+
++# Clang doesn't create executable stacks by default, so
++# tests for fix-gnustack fail without this.
+ bad-gnustack$(EXEEXT): bad-gnustack.s
+- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,execstack -o $@ $<
+
+ check_SCRIPTS = gnustacktest
+ TEST = $(check_SCRIPTS)
+--
+2.39.0
+
diff --git a/sys-apps/fix-gnustack/fix-gnustack-0.1-r1.ebuild b/sys-apps/fix-gnustack/fix-gnustack-0.1-r1.ebuild
new file mode 100644
index 000000000000..592e82c6121b
--- /dev/null
+++ b/sys-apps/fix-gnustack/fix-gnustack-0.1-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Utility to report and remove the executable flag from an ELF object's GNU_STACK"
+HOMEPAGE="https://dev.gentoo.org/~blueness/fix-gnustack"
+SRC_URI="https://dev.gentoo.org/~blueness/${PN}/${P}.tar.bz2"
+S="${WORKDIR}/${PN}"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="dev-libs/elfutils"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ # Backports from master, drop on next release
+ "${FILESDIR}"/${PV}
+)
+
+src_prepare() {
+ default
+
+ # Drop on next release, only needed for tests patch
+ eautoreconf
+}
diff --git a/sys-apps/fix-gnustack/metadata.xml b/sys-apps/fix-gnustack/metadata.xml
index 33d53cff133d..f1e4bd47573f 100644
--- a/sys-apps/fix-gnustack/metadata.xml
+++ b/sys-apps/fix-gnustack/metadata.xml
@@ -8,4 +8,8 @@
<email>base-system@gentoo.org</email>
<name>Gentoo Base System</name>
</maintainer>
+ <upstream>
+ <remote-id type="gentoo">proj/elfix</remote-id>
+ <remote-id type="github">gentoo/elfix</remote-id>
+ </upstream>
</pkgmetadata>