[linux] Disable implicit linking against libatomic

GCC 16 attempts to link against -latomic_asneeded by default, and
expects that this library will be provided by the installed build
toolchain alongside libgcc.

The Fedora cross-gcc packages do not include libatomic, which causes
the build to fail.

We do not require any functions provided by libatomic.  Work around
the missing packaged files in Fedora by disabling gcc's implicit
linking via the -fno-link-libatomic build option.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-06-01 14:12:39 +01:00
parent 409747f42c
commit e0a2ca984f
+7
View File
@@ -42,6 +42,13 @@ ifneq ($(NO_WERROR),1)
LINUX_CFLAGS += -Werror
endif
# Check for implicit libatomic
#
LIBATOMIC_TEST = $(CC) $(LINUX_CFLAGS) -x c /dev/null -nostartfiles \
-fno-link-libatomic -o /dev/null >/dev/null 2>&1
LIBATOMIC_FLAGS := $(shell $(LIBATOMIC_TEST) && $(ECHO) '-fno-link-libatomic')
LINUX_CFLAGS += $(LIBATOMIC_FLAGS)
# Check for libslirp
#
LIBSLIRP_TEST = $(CC) $(LINUX_CFLAGS) -x c /dev/null -nostartfiles \