public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/zlib/, sys-libs/zlib/files/
Date: Wed, 23 Nov 2022 04:25:21 +0000 (UTC)	[thread overview]
Message-ID: <1669177471.bac67bd1ecdf620db1b0dc03b63e66d978ff7325.sam@gentoo> (raw)

commit:     bac67bd1ecdf620db1b0dc03b63e66d978ff7325
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 23 04:24:31 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 23 04:24:31 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bac67bd1

sys-libs/zlib: fix build on sparc

Closes: https://bugs.gentoo.org/879883
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...-off-RWX-segment-warnings-on-sparc-system.patch | 56 ++++++++++++++++++++++
 sys-libs/zlib/zlib-1.2.13-r1.ebuild                |  9 +++-
 2 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/sys-libs/zlib/files/zlib-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch b/sys-libs/zlib/files/zlib-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch
new file mode 100644
index 000000000000..48d58acaaf7f
--- /dev/null
+++ b/sys-libs/zlib/files/zlib-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch
@@ -0,0 +1,56 @@
+From 2ad2713e6cb9166dcede9a020f6913b8189ff0c6 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 23 Nov 2022 04:17:16 +0000
+Subject: [PATCH] Revert "Turn off RWX segment warnings on sparc systems."
+
+This breaks building on sparc with older binutils.
+
+This reverts commit 29fd715fd0bdaffee21e2d2d37be8c5a6ac67ee4.
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -22,7 +22,7 @@ CFLAGS=-O
+ 
+ SFLAGS=-O
+ LDFLAGS=
+-TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
++TEST_LDFLAGS=-L. libz.a
+ LDSHARED=$(CC)
+ CPP=$(CC) -E
+ 
+@@ -288,10 +288,10 @@ minigzip$(EXE): minigzip.o $(STATICLIB)
+ 	$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
+ 
+ examplesh$(EXE): example.o $(SHAREDLIBV)
+-	$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
++	$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
+ 
+ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
+-	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
++	$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
+ 
+ example64$(EXE): example64.o $(STATICLIB)
+ 	$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
+--- a/configure
++++ b/configure
+@@ -33,10 +33,7 @@ fi
+ # set command prefix for cross-compilation
+ if [ -n "${CHOST}" ]; then
+     uname=${CHOST}
+-    mname=${CHOST}
+     CROSS_PREFIX="${CHOST}-"
+-else
+-    mname=`(uname -a || echo unknown) 2>/dev/null`
+ fi
+ 
+ # destination name for static library
+@@ -223,10 +220,6 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
+   fi
+   case "$uname" in
+   Linux* | linux* | *-linux* | GNU | GNU/* | solaris*)
+-        case "$mname" in
+-        *sparc*)
+-            LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;;
+-        esac
+         LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;;
+   *BSD | *bsd* | DragonFly)
+         LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}

diff --git a/sys-libs/zlib/zlib-1.2.13-r1.ebuild b/sys-libs/zlib/zlib-1.2.13-r1.ebuild
index ee60673a59b8..50b767a0ef31 100644
--- a/sys-libs/zlib/zlib-1.2.13-r1.ebuild
+++ b/sys-libs/zlib/zlib-1.2.13-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 # Worth keeping an eye on 'develop' branch upstream for possible backports.
 AUTOTOOLS_AUTO_DEPEND="no"
 VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/madler.asc
-inherit autotools multilib-minimal usr-ldscript verify-sig
+inherit autotools multilib-minimal flag-o-matic usr-ldscript verify-sig
 
 CYGWINPATCHES=(
 	"https://github.com/cygwinports/zlib/raw/22a3462cae33a82ad966ea0a7d6cbe8fc1368fec/1.2.11-gzopen_w.patch -> ${PN}-1.2.11-cygwin-gzopen_w.patch"
@@ -43,6 +43,9 @@ PATCHES=(
 
 	# Respect LDFLAGS during configure tests. Pending upstream
 	"${FILESDIR}"/${PN}-1.2.13-use-LDFLAGS-in-configure.patch
+
+	# Fix building on sparc with older binutils, we pass it in ebuild instead
+	"${FILESDIR}"/${PN}-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch
 )
 
 src_prepare() {
@@ -85,6 +88,10 @@ src_prepare() {
 echoit() { echo "$@"; "$@"; }
 
 multilib_src_configure() {
+	# We pass manually instead of relying on the configure script/makefile
+	# because it would pass it even for older binutils.
+	use sparc && append-flags $(test-flags-CCLD -Wl,--no-warn-rwx-segments)
+
 	case ${CHOST} in
 		*-mingw*|mingw*|*-cygwin*)
 			;;


             reply	other threads:[~2022-11-23  4:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  4:25 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-04  2:24 [gentoo-commits] repo/gentoo:master commit in: sys-libs/zlib/, sys-libs/zlib/files/ Sam James
2024-01-24  8:05 Sam James
2023-10-30 10:21 Sam James
2022-03-28  7:28 Sam James
2022-03-11 15:18 Sam James
2022-01-28  7:53 Sam James
2015-09-29 13:26 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1669177471.bac67bd1ecdf620db1b0dc03b63e66d978ff7325.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox