Fix static linking on macOS ##build

This commit is contained in:
pancake 2023-11-22 00:29:16 +01:00 committed by pancake
parent 607d6963ba
commit f2c8b12c1a
5 changed files with 15 additions and 13 deletions

View File

@ -6,7 +6,6 @@ BINS=r2blob
SOURCES= r2blob.c SOURCES= r2blob.c
include ../../config-user.mk
include ../rules.mk include ../rules.mk
SHLR=../../shlr SHLR=../../shlr

View File

@ -12,8 +12,6 @@ BUNDLE=org.radare.radare2
MACSDK=macosx10.10 MACSDK=macosx10.10
ENTITL=radare2.xcent ENTITL=radare2.xcent
#ENTITL=radare2_ios.xml #ENTITL=radare2_ios.xml
#CFLAGS+=-flto
#LDFLAGS+=-flto
CFLAGS_INCLUDES+=-I$(SHLR)/sdb/src CFLAGS_INCLUDES+=-I$(SHLR)/sdb/src
CFLAGS_INCLUDES+=-I$(LIBR)/include CFLAGS_INCLUDES+=-I$(LIBR)/include

View File

@ -1,7 +1,7 @@
BIN=rahash2 BIN=rahash2
BINDEPS=r_main BINDEPS=r_main
include ../rules.mk include ../rules.mk
ifeq ($(OSTYPE),android) ifeq ($(OSTYPE),android)

View File

@ -6,5 +6,6 @@ include ../../libr/main/deps.mk
include ../../shlr/zip/deps.mk include ../../shlr/zip/deps.mk
include ../../shlr/java/deps.mk include ../../shlr/java/deps.mk
include ../../shlr/capstone.mk include ../../shlr/capstone.mk
include ../rules.mk include ../rules.mk
LDFLAGS+=$(LINK) LDFLAGS+=$(LINK)

View File

@ -111,18 +111,20 @@ all: ${BEXE} ${BINS}
ifeq ($(WITH_LIBR),1) ifeq ($(WITH_LIBR),1)
${BINS}: ${OBJS} ${BINS}: ${OBJS}
${CC} ${CFLAGS} $@.c ${OBJS} ../../libr/libr.a -o $@ $(LDFLAGS) ${CC} ${CFLAGS} $@.c ${OBJS} ../../libr/libr.a -o $@
#$(LDFLAGS)
${BEXE}: ${OBJ} ${SHARED_OBJ} ${BEXE}: ${OBJ} ${SHARED_OBJ}
ifeq ($(COMPILER),wasi) ifeq ($(COMPILER),wasi)
${CC} ${CFLAGS} $+ -L.. -o $@ $(LDFLAGS) ${CC} ${CFLAGS} $+ -L.. -o $@ $(LDFLAGS)
else else
ifeq ($(CC),emcc) ifeq ($(CC),emcc)
emcc $(BIN).c ../../shlr/libr_shlr.a ../../shlr/capstone/libcapstone.a ../../libr/libr.a ../../shlr/gdb/lib/libgdbr.a ../../shlr/zip/librz.a -I ../../libr/include -o $(BIN).js emcc $(BIN).c ../../shlr/libr_shlr.a ../../shlr/capstone/libcapstone.a ../../libr/libr.a ../../shlr/gdb/lib/libgdbr.a ../../shlr/zip/librz.a -I ../../libr/include -o $(BIN).js
else else
${CC} ${CFLAGS} $+ -L.. -o $@ ../../libr/libr.a $(LDFLAGS) ${CC} ${CFLAGS} $+ -L.. -o $@ ../../libr/libr.a
endif #$(LDFLAGS)
endif endif
endif
else else
${BINS}: ${OBJS} ${BINS}: ${OBJS}
@ -131,8 +133,10 @@ ifneq ($(SILENT),)
endif endif
${CC} ${CFLAGS} $@.c ${OBJS} ${REAL_LDFLAGS} $(LINK) -o $@ ${CC} ${CFLAGS} $@.c ${OBJS} ${REAL_LDFLAGS} $(LINK) -o $@
# -static fails because -ldl -lpthread static-gcc ... include ../../config-user.mk
${BEXE}: ${OBJ} ${SHARED_OBJ} ${BEXE}: ${OBJ} ${SHARED_OBJ}
# -static fails because -ldl -lpthread static-gcc ...
ifneq ($(SILENT),) ifneq ($(SILENT),)
@echo LD $@ @echo LD $@
endif endif