From 774f1c33efaaccf633ede6e704800345eb313878 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 12 Sep 2023 20:22:04 +0200 Subject: [PATCH] fix atomic on macOS and all platforms --- tools/cryptorf/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/cryptorf/Makefile b/tools/cryptorf/Makefile index 293194f03..45cd51a5d 100644 --- a/tools/cryptorf/Makefile +++ b/tools/cryptorf/Makefile @@ -3,7 +3,14 @@ MYSRCS = cryptolib.c util.c MYINCLUDES = -I../../common/cryptorf MYCFLAGS = MYDEFS = -MYLDLIBS = -lpthread -latomic + +# Atomic +# RPi Zero gcc requires -latomic +# but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld +# doesn't recognize option --as-needed +ifneq ($(platform),Darwin) + MYLDLIBS += -lpthread -Wl,--as-needed -latomic -Wl,--no-as-needed +endif BINS = cm sm sma sma_multi INSTALLTOOLS = $(BINS)