From 9617ea6a3afd1b90536e0a20ef5781a850fa5c60 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Tue, 23 Jun 2020 06:51:51 +0200 Subject: [PATCH] macos: workaround to build tcc using tcc until .o object files generated by tcc are fully compatible with ar. Instead of ar, use 'tcc -ar' --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6f6fdd36..d5d7c256 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,9 @@ else NATIVE_TARGET = $(ARCH) ifdef CONFIG_OSX NATIVE_TARGET = $(ARCH)-osx - LDFLAGS += -flat_namespace -undefined warning + ifneq ($(CC),tcc) + LDFLAGS += -flat_namespace -undefined warning + endif export MACOSX_DEPLOYMENT_TARGET := 10.6 endif endif @@ -224,7 +226,11 @@ tcc_p$(EXESUF): $($T_FILES) # static libtcc library libtcc.a: $(LIBTCC_OBJ) +ifeq ($(CC),tcc) + $(CC) -ar rcs $@ $^ +else $S$(AR) rcs $@ $^ +endif # dynamic libtcc library libtcc.so: $(LIBTCC_OBJ)