From a420fbafe812f9584f4e71cf3bd42f222bae74c8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 28 Mar 2016 16:26:45 -0700 Subject: [PATCH] Port to Oracle Solaris Studio 12.4 Problem reported by Kiyoshi KANAZAWA in: http://bugs.gnu.org/23133 * NEWS: Document this. * configure.ac (ASMV): Do not define if NO_ASM is anywhere in DEFS; it doesn't need to be surrounded by white space. * lib/match.c: Do not use x86 version if __x86_64__ is defined. --- NEWS | 8 ++++++++ configure.ac | 4 ++-- lib/match.c | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d2bf976..fdae647 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,14 @@ GNU gzip NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Bug fixes + + Port to Oracle Solaris Studio 12 on x86-64. + [bug present since at least gzip-1.2.4] + + When configuring gzip, ./configure DEFS='...-DNO_ASM...' now + suppresses assembler again. [bug introduced in gzip-1.3.5] + * Noteworthy changes in release 1.7 (2016-03-27) [stable] diff --git a/configure.ac b/configure.ac index f64df6b..08ad445 100644 --- a/configure.ac +++ b/configure.ac @@ -204,8 +204,8 @@ AC_OBJEXT AC_CACHE_CHECK([for an assembler syntax supported by this package], [gzip_cv_assembler], [gzip_cv_assembler=no - case " $DEFS " in - *' NO_ASM '*) ;; + case $DEFS in + *NO_ASM*) ;; *) if cp $srcdir/lib/match.c _match.S && eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" && diff --git a/lib/match.c b/lib/match.c index 8846038..41fb03e 100644 --- a/lib/match.c +++ b/lib/match.c @@ -49,7 +49,11 @@ error: DYN_ALLOC not yet supported in match.s #endif -#if defined(i386) || defined(_I386) || defined(__i386) || defined(__i386__) +/* On x86-64, Sun C 5.13 (Oracle Solaris Studio 12.4) 'cc -E -m64' + defines i386 when compiling .s or .S files! Luckily it also + defines __x86_64__. See Bug#23133. */ +#if ((defined i386 || defined _I386 || defined __i386 || defined __i386__) \ + && !defined __x86_64__) /* This version is for 386 Unix or OS/2 in 32 bit mode. * Warning: it uses the AT&T syntax: mov source,dest -- 2.47.2