gcc10 switched default behavior from -fcommon to -fno-common. Since "__shared" relies on the legacy behavior, explicitly specify it.
Signed-off-by: Bruce Rogers <brog...@suse.com> --- src/Makefile.housekeeping | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 1dd14794..8fb2b958 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -170,6 +170,16 @@ CFI_FLAGS := $(shell $(CFI_TEST) && \ WORKAROUND_CFLAGS += $(CFI_FLAGS) endif +# gcc 10 switched default behavior from -fcommon to -fno-common. Since +# "__shared" relies on the legacy behavior, explicitly specify it. +# +ifeq ($(CCTYPE),gcc) +FCOMMON_TEST = $(CC) -fcommon -x c -c /dev/null \ + -o /dev/null >/dev/null 2>&1 +FCOMMON_FLAGS := $(shell $(FCOMMON_TEST) && $(ECHO) '-fcommon') +WORKAROUND_CFLAGS += $(FCOMMON_FLAGS) +endif + # gcc 4.6 generates spurious warnings if -Waddress is in force. # Inhibit this. # -- 2.26.2 _______________________________________________ ipxe-devel mailing list ipxe-devel@lists.ipxe.org https://lists.ipxe.org/mailman/listinfo/ipxe-devel