GNU bug report logs - #54759
Compile error on macOS w/ gcc

Previous Next

Package: gzip;

Reported by: Young Mo Kang <kym327 <at> gmail.com>

Date: Thu, 7 Apr 2022 01:00:02 UTC

Severity: normal

Tags: moreinfo

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54759 in the body.
You can then email your comments to 54759 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gzip <at> gnu.org:
bug#54759; Package gzip. (Thu, 07 Apr 2022 01:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Young Mo Kang <kym327 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Thu, 07 Apr 2022 01:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Young Mo Kang <kym327 <at> gmail.com>
To: bug-gzip <at> gnu.org
Subject: Compile error on macOS w/ gcc
Date: Wed, 6 Apr 2022 17:58:54 -0700
Hello gzip devs and maintainers,

Not sure if this issue has been already brought up, since I’m not subscribed to the email.

I am having compilation error on M1 mac running macOS 11.6.3 with gcc 11.2.0.
It compiles just fine with clang, but not with gcc.
The reproducible commands:

```
wget https://ftp.gnu.org/gnu/gzip/gzip-1.11.tar.gz
tar xfz gzip-1.11.tar.gz
cd gzip-1.11
mkdir build
cd build
CC=gcc-11 ../configure
make -j4
```

and the output by running the above:
```
+ wget https://ftp.gnu.org/gnu/gzip/gzip-1.11.tar.gz
--2022-04-06 17:50:53--  https://ftp.gnu.org/gnu/gzip/gzip-1.11.tar.gz
Resolving ftp.gnu.org (ftp.gnu.org)... 209.51.188.20
Connecting to ftp.gnu.org (ftp.gnu.org)|209.51.188.20|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1256839 (1.2M) [application/x-gzip]
Saving to: ‘gzip-1.11.tar.gz’

     0K .......... .......... .......... .......... ..........  4%  294K 4s
    50K .......... .......... .......... .......... ..........  8%  588K 3s
   100K .......... .......... .......... .......... .......... 12% 17.4M 2s
   150K .......... .......... .......... .......... .......... 16% 25.3M 1s
   200K .......... .......... .......... .......... .......... 20%  615K 1s
   250K .......... .......... .......... .......... .......... 24% 16.3M 1s
   300K .......... .......... .......... .......... .......... 28% 21.7M 1s
   350K .......... .......... .......... .......... .......... 32% 28.1M 1s
   400K .......... .......... .......... .......... .......... 36%  629K 1s
   450K .......... .......... .......... .......... .......... 40% 30.0M 1s
   500K .......... .......... .......... .......... .......... 44% 23.8M 1s
   550K .......... .......... .......... .......... .......... 48% 29.4M 0s
   600K .......... .......... .......... .......... .......... 52% 28.0M 0s
   650K .......... .......... .......... .......... .......... 57% 29.5M 0s
   700K .......... .......... .......... .......... .......... 61% 29.5M 0s
   750K .......... .......... .......... .......... .......... 65% 29.6M 0s
   800K .......... .......... .......... .......... .......... 69% 32.5M 0s
   850K .......... .......... .......... .......... .......... 73%  691K 0s
   900K .......... .......... .......... .......... .......... 77% 18.2M 0s
   950K .......... .......... .......... .......... .......... 81% 32.3M 0s
  1000K .......... .......... .......... .......... .......... 85% 31.6M 0s
  1050K .......... .......... .......... .......... .......... 89% 37.1M 0s
  1100K .......... .......... .......... .......... .......... 93% 35.5M 0s
  1150K .......... .......... .......... .......... .......... 97% 33.7M 0s
  1200K .......... .......... .......                         100% 24.5M=0.5s

2022-04-06 17:50:54 (2.29 MB/s) - ‘gzip-1.11.tar.gz’ saved [1256839/1256839]

+ tar xfz gzip-1.11.tar.gz
+ cd gzip-1.11
+ mkdir build
+ cd build
+ CC=gcc-11
+ ../configure
checking for a BSD-compatible install... /opt/homebrew/opt/coreutils/libexec/gnubin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /opt/homebrew/opt/coreutils/libexec/gnubin/mkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc-11
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to enable C11 features... none needed
checking whether gcc-11 understands -c and -o together... yes
checking whether the compiler is clang... no
checking for compiler option needed when checking for declarations... none
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc-11... gcc3
checking how to run the C preprocessor... gcc-11 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for nm... nm
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for a POSIX-compliant shell... /bin/sh
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for sys/param.h... yes
checking for sys/socket.h... yes
checking for dirent.h... yes
checking for features.h... no
checking for stdio_ext.h... no
checking for getopt.h... yes
checking for sys/cdefs.h... yes
checking for sys/time.h... yes
checking for limits.h... yes
checking for threads.h... no
checking for math.h... yes
checking for sys/mman.h... yes
checking for utime.h... yes
checking for crtdefs.h... no
checking for fcntl.h... yes
checking for memory.h... yes
checking for time.h... yes
checking for sys/sdt.h... yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking build system type... aarch64-apple-darwin20.6.0
checking host system type... aarch64-apple-darwin20.6.0
checking for egrep... /usr/bin/grep -E
checking for Minix Amsterdam compiler... no
checking for ar... ar
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether malloc is ptrdiff_t safe... yes
checking whether malloc, realloc, calloc set errno on failure... yes
checking for _set_invalid_parameter_handler... no
checking for fchdir... yes
checking for fdopendir... yes
checking for fcntl... yes
checking for symlink... yes
checking for mempcpy... no
checking for vasnprintf... no
checking for snprintf... yes
checking for fpurge... yes
checking for __fpurge... no
checking for __freading... no
checking for __fseterr... no
checking for fstatat... yes
checking for fsync... yes
checking for getdtablesize... yes
checking for getprogname... yes
checking for getexecname... no
checking for gettimeofday... yes
checking for lstat... yes
checking for mprotect... yes
checking for openat... yes
checking for strerror_r... yes
checking for __xpg_strerror_r... no
checking for pipe... yes
checking for sigaction... yes
checking for sigaltstack... yes
checking for siginterrupt... yes
checking for catgets... yes
checking for unlinkat... yes
checking for futimes... yes
checking for futimesat... no
checking for futimens... yes
checking for utimensat... yes
checking for lutimes... yes
checking for chown... yes
checking for fchmod... yes
checking for fchown... yes
checking whether the preprocessor supports include_next... yes
checking whether source code line length is unlimited... yes
checking for gcc-11 options needed to detect all undeclared functions... none needed
checking for complete errno.h... yes
checking whether strerror_r is declared... yes
checking whether strerror_r returns char *... no
checking whether fchdir is declared... yes
checking for working fcntl.h... yes
checking for pid_t... yes
checking for mode_t... yes
checking for promoted mode_t type... int
checking whether fdatasync is declared... no
checking for stdint.h... yes
checking for inttypes.h... yes
checking whether printf supports size specifiers as in C99... yes
checking whether printf supports 'long double' arguments... yes
checking whether printf supports infinite 'double' arguments... yes
checking whether byte ordering is bigendian... no
checking whether long double and double are the same... yes
checking whether printf supports infinite 'long double' arguments... yes
checking whether printf supports the 'a' and 'A' directives... no
checking whether printf supports the 'F' directive... yes
checking whether printf supports the 'n' directive... no
checking whether printf supports the 'ls' directive... yes
checking whether printf supports POSIX/XSI format strings with positions... yes
checking whether printf supports the grouping flag... yes
checking whether printf supports the left-adjust flag correctly... yes
checking whether printf supports the zero flag correctly... yes
checking whether printf supports large precisions... yes
checking whether the compiler produces multi-arch binaries... no
checking whether printf survives out-of-memory conditions... yes
checking for wchar_t... yes
checking for wint_t... yes
checking whether wint_t is large enough... yes
checking for intmax_t... yes
checking where to find the exponent in a 'double'... word 1 bit 20
checking whether snprintf returns a byte count as in C99... yes
checking whether snprintf truncates the result as in C99... yes
checking for snprintf... (cached) yes
checking for strnlen... yes
checking for wcslen... yes
checking for wcsnlen... yes
checking for mbrtowc... yes
checking for wcrtomb... yes
checking whether _snprintf is declared... no
checking whether frexp() can be used without linking with libm... yes
checking whether alarm is declared... yes
checking whether stdin defaults to large file offsets... yes
checking whether fseeko is declared... yes
checking for fseeko... yes
checking whether fflush works on input streams... no
checking whether stat file-mode macros are broken... no
checking for C/C++ restrict keyword... __restrict__
checking for nlink_t... yes
checking whether lstat correctly handles trailing slash... no
checking whether ftello is declared... yes
checking whether ungetc works on arbitrary bytes... no
checking for ftello... yes
checking whether ftello works... yes
checking whether getcwd (NULL, 0) allocates memory for result... yes
checking for getcwd with POSIX signature... yes
checking whether getdtablesize is declared... yes
checking for getopt.h... (cached) yes
checking for getopt_long_only... yes
checking whether getopt is POSIX compatible... no
checking for struct timeval... yes
checking for wide-enough struct timeval.tv_sec member... yes
checking whether limits.h has WORD_BIT, BOOL_WIDTH etc.... no
checking whether stdint.h conforms to C99... yes
checking whether stdint.h works without ISO C predefines... yes
checking whether stdint.h has UINTMAX_WIDTH etc.... no
checking where to find the exponent in a 'float'... word 0 bit 23
checking whether imported symbols can be declared weak... no
checking for pthread.h... yes
checking for pthread_kill in -lpthread... yes
checking whether POSIX threads API is available... yes
checking for multithread API to use... posix
checking for a sed that does not truncate output... /opt/homebrew/bin/gsed
checking whether malloc (0) returns nonnull... yes
checking whether NAN macro works... yes
checking whether HUGE_VAL works... yes
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... yes
checking whether memrchr is declared... no
checking whether <limits.h> defines MIN and MAX... no
checking whether <sys/param.h> defines MIN and MAX... yes
checking for O_CLOEXEC... yes
checking whether strerror(0) succeeds... no
checking for nl_langinfo... yes
checking for ptrdiff_t... yes
checking whether C symbols are prefixed with underscore at the linker level... yes
checking for sigset_t... yes
checking for uid_t in sys/types.h... yes
checking for volatile sig_atomic_t... yes
checking for sighandler_t... no
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for good max_align_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking whether fcloseall is declared... no
checking which flavor of printf attribute matches inttypes macros... system
checking whether ecvt is declared... yes
checking whether fcvt is declared... yes
checking whether gcvt is declared... yes
checking whether strdup is declared... yes
checking for struct timespec in <time.h>... yes
checking for TIME_UTC in <time.h>... yes
checking whether execvpe is declared... no
checking whether the utimes function works... yes
checking whether <wchar.h> uses 'inline' correctly... yes
checking whether wcsdup is declared... yes
checking for time_t past the year 2038... yes
checking for alloca as a compiler built-in... yes
checking whether calloc (0, n) and calloc (n, 0) return nonnull... yes
checking whether this system supports file names of any length... no
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking for clock_settime... yes
checking for closedir... yes
checking for dirfd... yes
checking whether dirfd is declared... yes
checking whether dirfd is a macro... no
checking whether // is distinct from /... no
checking whether dup works... yes
checking whether dup2 works... yes
checking for error_at_line... no
checking whether fflush works on input streams... (cached) no
checking whether fcntl handles F_DUPFD correctly... yes
checking whether fcntl understands F_DUPFD_CLOEXEC... yes
checking for fdatasync... yes
checking whether fdopendir is declared... yes
checking whether fdopendir works... yes
checking whether fflush works on input streams... (cached) no
checking whether conversion from 'int' to 'long double' works... yes
checking for nl_langinfo... (cached) yes
checking for ptrdiff_t... (cached) yes
checking whether fpurge is declared... yes
checking whether fpurge works... no
checking whether free is known to preserve errno... no
checking whether frexp works... yes
checking whether frexpl is declared... yes
checking whether frexpl() can be used without linking with libm... yes
checking whether frexpl works... yes
checking for fseeko... (cached) yes
checking whether fflush works on input streams... (cached) no
checking for _fseeki64... no
checking whether fstatat (..., 0) works... yes
checking for ftello... (cached) yes
checking for _ftelli64... no
checking whether getdtablesize works... yes
checking whether program_invocation_name is declared... no
checking whether program_invocation_short_name is declared... no
checking whether __argv is declared... no
checking whether __progname is defined in default libraries... yes
checking for gettimeofday with POSIX signature... yes
checking whether isnan(double) can be used without linking with libm... yes
checking whether isnan(float) can be used without linking with libm... yes
checking whether isnan(float) works... yes
checking whether isnan(long double) can be used without linking with libm... yes
checking whether isnanl works... yes
checking for C compiler flag to ignore unused libraries... none
checking for pthread_rwlock_t... yes
checking whether pthread_rwlock_rdlock prefers a writer to a reader... yes
checking whether lseek detects pipes... yes
checking whether malloc (0) returns nonnull... (cached) yes
checking for mempcpy... (cached) no
checking for memrchr... no
checking whether open recognizes a trailing slash... no
checking for opendir... yes
checking whether perror matches strerror... yes
checking whether frexp works... (cached) yes
checking whether ldexp can be used without linking with libm... yes
checking whether frexpl() can be used without linking with libm... (cached) yes
checking whether frexpl works... (cached) yes
checking whether frexpl is declared... (cached) yes
checking whether ldexpl() can be used without linking with libm... yes
checking whether ldexpl works... yes
checking whether ldexpl is declared... yes
checking for raise... yes
checking for sigprocmask... yes
checking for readdir... yes
checking whether realloc (0, 0) returns nonnull... yes
checking for reallocarray... no
checking whether rmdir works... yes
checking for struct sigaction.sa_sigaction... yes
checking for signbit macro... yes
checking for signbit compiler built-ins... yes
checking for sigprocmask... (cached) yes
checking for stdint.h... (cached) yes
checking for SIZE_MAX... yes
checking for ssize_t... yes
checking whether stat handles trailing slashes on files... no
checking for struct stat.st_atim.tv_nsec... no
checking for struct stat.st_atimespec.tv_nsec... yes
checking for struct stat.st_birthtimespec.tv_nsec... yes
checking for working stdalign.h... yes
checking for working stdnoreturn.h... yes
checking for stpcpy... yes
checking whether unlink honors trailing slashes... no
checking whether unlink of a parent directory fails as it should... yes
checking for utime... yes
checking whether utime handles trailing slashes on files... no
checking for ptrdiff_t... (cached) yes
checking for nl_langinfo... (cached) yes
checking for ptrdiff_t... (cached) yes
checking for stdint.h... (cached) yes
checking for underline in external names... yes
checking for an assembler syntax supported by this package... no
checking for an ANSI C-conforming const... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for size_t... (cached) yes
checking for off_t... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating lib/Makefile
config.status: creating tests/Makefile
config.status: creating lib/config.h
config.status: linking ../GNUmakefile to GNUmakefile
config.status: executing depfiles commands
+ make -j4
  GEN      version.c
  GEN      version.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in lib
  GEN      alloca.h
  GEN      dirent.h
  GEN      fcntl.h
  GEN      getopt.h
  GEN      getopt-cdefs.h
  GEN      inttypes.h
  GEN      limits.h
  GEN      math.h
  GEN      signal.h
  GEN      stdint.h
  GEN      stdio.h
  GEN      stdlib.h
  GEN      string.h
  GEN      sys/stat.h
  GEN      sys/time.h
  GEN      sys/types.h
  GEN      time.h
  GEN      unistd.h
  GEN      utime.h
  GEN      wchar.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
  CC       openat-proc.o
  CC       basename-lgpl.o
  CC       cloexec.o
  CC       opendir-safer.o
  CC       dirname-lgpl.o
  CC       stripslash.o
  CC       exitfail.o
  CC       creat-safer.o
  CC       open-safer.o
  CC       fd-hook.o
  CC       fd-safer-flag.o
  CC       dup-safer-flag.o
  CC       filenamecat-lgpl.o
  CC       freading.o
  CC       getprogname.o
  CC       gettime.o
In file included from ../../lib/gettime.c:22:
../../lib/timespec.h:52:1: warning: 'maybe_unused' attribute ignored [-Wattributes]
   52 | _GL_TIMESPEC_INLINE struct timespec
      | ^~~~~~~~~~~~~~~~~~~
../../lib/timespec.h:52:21: error: expected identifier or '(' before 'struct'
   52 | _GL_TIMESPEC_INLINE struct timespec
      |                     ^~~~~~
../../lib/timespec.h:63:1: warning: 'maybe_unused' attribute ignored [-Wattributes]
   63 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      | ^~~~~~~~~~~~~~~~~~~
../../lib/timespec.h:63:21: error: expected identifier or '(' before 'int'
   63 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      |                     ^~~
../../lib/timespec.h:71:1: warning: 'maybe_unused' attribute ignored [-Wattributes]
   71 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      | ^~~~~~~~~~~~~~~~~~~
../../lib/timespec.h:71:21: error: expected identifier or '(' before 'int'
   71 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      |                     ^~~
../../lib/timespec.h:85:1: warning: 'maybe_unused' attribute ignored [-Wattributes]
   85 | _GL_TIMESPEC_INLINE double
      | ^~~~~~~~~~~~~~~~~~~
../../lib/timespec.h:85:21: error: expected identifier or '(' before 'double'
   85 | _GL_TIMESPEC_INLINE double
      |                     ^~~~~~
make[3]: *** [gettime.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
```

and this is what I get from running “gcc-11 —version”
```
gcc-11 (Homebrew GCC 11.2.0_3) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

Not sure if I have to set some special flags/configs for this to work, but even so, it would be nice if gzip can be built w/o custom flags/configs out of the box with both clang & gcc.

Thanks.
Young





Information forwarded to bug-gzip <at> gnu.org:
bug#54759; Package gzip. (Thu, 07 Apr 2022 22:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 54759 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Young Mo Kang <kym327 <at> gmail.com>
Cc: 54759 <at> debbugs.gnu.org
Subject: Re: bug#54759: Compile error on macOS w/ gcc
Date: Thu, 7 Apr 2022 15:57:08 -0700
Thanks for the bug report. Please try gzip 1.12, released today. It has 
bug fixes (inherited from Gnulib) in the area you reported, and should 
build on macOS with GCC. Thanks.




Added tag(s) moreinfo. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 07 Apr 2022 22:58:02 GMT) Full text and rfc822 format available.

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 26 Dec 2022 05:43:02 GMT) Full text and rfc822 format available.

Notification sent to Young Mo Kang <kym327 <at> gmail.com>:
bug acknowledged by developer. (Mon, 26 Dec 2022 05:43:02 GMT) Full text and rfc822 format available.

Message #15 received at 54759-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Young Mo Kang <kym327 <at> gmail.com>
Cc: 54759-done <at> debbugs.gnu.org
Subject: Re: bug#54759: Compile error on macOS w/ gcc
Date: Sun, 25 Dec 2022 21:42:26 -0800
On 4/7/22 15:57, Paul Eggert wrote:
> Thanks for the bug report. Please try gzip 1.12, released today. It 
> has bug fixes (inherited from Gnulib) in the area you reported, and 
> should build on macOS with GCC. Thanks.

No further comment, so I assume this old bug report no longer applies to 
current gzip. Closing the bug report.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 23 Jan 2023 12:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.