Skip to content

Commit

Permalink
Makefile: Omit linking to libatomic on x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
LekKit committed Nov 7, 2024
1 parent fca8a5c commit 536965e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 536965e

Please sign in to comment.