From 536965e6df64fcbee19308b97c71e2d4a8139946 Mon Sep 17 00:00:00 2001 From: LekKit <50500857+LekKit@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:17:03 +0200 Subject: [PATCH] Makefile: Omit linking to libatomic on x86_64 --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index ae0f980c..2545c9e8 100644 --- a/Makefile +++ b/Makefile @@ -195,11 +195,15 @@ endif ifneq (,$(findstring main, $(shell $(CC) $(CFLAGS) $(LDFLAGS) -ldl 2>&1))) override LDFLAGS += -ldl endif + +# Linking to libatomic on x86_64 is redundant and may cause issues +ifeq (,$(findstring -,$(CC_TRIPLET))$(filter-out x86_64,$(ARCH))) ifneq (,$(findstring main, $(shell $(CC) $(CFLAGS) $(LDFLAGS) -latomic 2>&1))) override LDFLAGS += -latomic else override CFLAGS += -DNO_LIBATOMIC endif +endif # Set some addiional options based on POSIX flavor