summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <fork@madler.net>2022-10-10 02:40:53 -0700
committerMark Adler <fork@madler.net>2022-10-10 10:30:22 -0700
commit29fd715fd0bdaffee21e2d2d37be8c5a6ac67ee4 (patch)
treefbd78d6a3e16b09d14a042babc4a476d07f967ad
parent40c5a9bc06c5b0746aab270971c8cc546e3d5fc7 (diff)
downloadzlib-29fd715fd0bdaffee21e2d2d37be8c5a6ac67ee4.tar.gz
Turn off RWX segment warnings on sparc systems.
-rw-r--r--Makefile.in6
-rwxr-xr-xconfigure7
2 files changed, 10 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index 1cc9f4d..2dedc44 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,7 +22,7 @@ CFLAGS=-O
SFLAGS=-O
LDFLAGS=
-TEST_LDFLAGS=-L. libz.a
+TEST_LDFLAGS=$(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 -L. $(SHAREDLIBV)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
example64$(EXE): example64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
diff --git a/configure b/configure
index bc3c802..aa872ec 100755
--- a/configure
+++ b/configure
@@ -33,7 +33,10 @@ 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
@@ -220,6 +223,10 @@ 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"}