Patch taken from: https://github.com/JuliaPackaging/Yggdrasil/pull/8671 diff --git a/Makefile b/Makefile index c7a2b7f7..0c509288 100644 --- Makefile.orig +++ Makefile @@ -140,7 +140,7 @@ LIBFLAME_SO_OUTPUT_NAME := $(LIBFLAME_SO_PATH) ifeq ($(OS_NAME),Darwin) # OS X shared library link flags. SOFLAGS := -dynamiclib -SOFLAGS += -Wl,-install_name,$(LIBFLAME_SONAME) +SOFLAGS += -Wl,-install_name,@rpath/$(LIBFLAME_SONAME) else SOFLAGS := -shared # Linux shared library link flags. @@ -670,7 +670,7 @@ ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes) $(SORT) $(AR_OBJ_LIST_FILE) | $(UNIQ) > $(AR_OBJ_LIST_FILE).sotmp $(CAT) $(AR_OBJ_LIST_FILE).sotmp | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $(LIBFLAME_A) ifeq ($(OS_NAME),Darwin) - $(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS) + $(LINKER) $(SOFLAGS) -o $@ -Wl,-rpath,$(BASE_LIB_PATH):$(LIBFLAME_A_PATH) -Wl,-all_load $(LDFLAGS) else $(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive $(LIBFLAME_A) -Wl,--no-whole-archive $(LDFLAGS) endif @@ -686,7 +686,7 @@ ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes) @$(SORT) $(AR_OBJ_LIST_FILE) | $(UNIQ) > $(AR_OBJ_LIST_FILE).sotmp @$(CAT) $(AR_OBJ_LIST_FILE).sotmp | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $(LIBFLAME_A) ifeq ($(OS_NAME),Darwin) - @$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS) + $(LINKER) $(SOFLAGS) -o $@ -Wl,-rpath,$(BASE_LIB_PATH):$(LIBFLAME_A_PATH) -Wl,-all_load $(LDFLAGS) else @$(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive $(LIBFLAME_A) -Wl,--no-whole-archive $(LDFLAGS) endif