In an attempt to build coreutils with debug symbols, I was surprised to find
that this sequence:
$ git clone https://github.com/coreutils/coreutils
$ cd coreutils/
$ ./bootstrap
$ export CFLAGS=-g
$ ./configure --disable-silent-rules
$ make
resulted in the attached build failure. (The build was clean up to that point.)
Seems to be 100% reproducible: Same behavior seen several times starting
from fresh git clone directory each time. Yet without the CFLAGS=-g, it
builds ok.
What am I doing wrong?
Thanks,
Glenn
.
.
.
gcc -I. -I./lib -Ilib -I./lib -Isrc -I./src -Werror -fno-common -Wall
-Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time
-Wdisabled-optimization -Wduplicated-cond -Wextra -Wformat-signedness
-Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations
-Wmissing-include-dirs -Wnull-dereference -Wopenmp-simd -Woverlength-strings
-Wpacked -Wpointer-arith -Wshadow -Wstrict-prototypes -Wsuggest-attribute=cold
-Wsuggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=malloc
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wsuggest-final-methods
-Wsuggest-final-types -Wsync-nand -Wtrampolines -Wunknown-pragmas
-Wvariadic-macros -Wvla -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2
-Wbidi-chars=any,ucn -Wformat=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2
-Wuse-after-free=3 -Wunused-const-variable=2 -Wvla-larger-than=4031
-Wno-sign-compare -Wno-unused-parameter -Wno-format-nonliteral
-fdiagnostics-show-option -funit-at-a-time -Wno-return-local-addr
-Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef
-Wno-unused-function -Wno-unused-parameter -Wno-float-conversion
-Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits
-Wno-unsuffixed-float-constants -g -MT lib/libcoreutils_a-nstrftime.o -MD -MP
-MF lib/.deps/libcoreutils_a-nstrftime.Tpo -c -o lib/libcor
eutils_a-nstrftime.o `test -f 'lib/nstrftime.c' || echo './'`lib/nstrftime.c
lib/nstrftime.c: In function '__strftime_internal':
lib/nstrftime.c:147:31: error: 'memset' specified size 18446744073709551615
exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
147 | # define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len))
| ^~~~~~~~~~~~~~~~~~~~
lib/nstrftime.c:174:17: note: in expansion of macro 'memset_zero'
174 | memset_zero (p, _delta);
\
| ^~~~~~~~~~~
lib/nstrftime.c:188:31: note: in expansion of macro 'width_add'
188 | # define width_add1(width, c) width_add (width, 1, *p = c)
| ^~~~~~~~~
lib/nstrftime.c:1047:17: note: in expansion of macro 'width_add1'
1047 | width_add1 (0, sign_char);
| ^~~~~~~~~~
lib/nstrftime.c:146:32: error: 'memset' specified size 18446744073709551615
exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
146 | # define memset_space(P, Len) (memset (P, ' ', Len), (P) += (Len))
| ^~~~~~~~~~~~~~~~~~~~
lib/nstrftime.c:176:17: note: in expansion of macro 'memset_space'
176 | memset_space (p, _delta);
\
| ^~~~~~~~~~~~
lib/nstrftime.c:188:31: note: in expansion of macro 'width_add'
188 | # define width_add1(width, c) width_add (width, 1, *p = c)
| ^~~~~~~~~
lib/nstrftime.c:1047:17: note: in expansion of macro 'width_add1'
1047 | width_add1 (0, sign_char);