void-packages/srcpkgs/julia/patches/36697.diff

105 lines
3.5 KiB
Diff

This patch was taken from <https://github.com/JuliaLang/julia/pull/36697>
to workaround julia 1.5.0 not building correctly with musl libc.
diff --git Make.inc Make.inc
index e91461514463..21a0299318b5 100644
--- Make.inc
+++ Make.inc
@@ -940,17 +940,17 @@ LIBUNWIND:=
else
ifeq ($(USE_SYSTEM_LIBUNWIND), 1)
ifneq ($(OS),Darwin)
-LIBUNWIND:=-lunwind-generic -lunwind
+LIBUNWIND:=-lunwind
# Only for linux since we want to use not yet released libunwind features
JCFLAGS+=-DSYSTEM_LIBUNWIND
JCPPFLAGS+=-DSYSTEM_LIBUNWIND
endif
else
ifeq ($(OS),Darwin)
-LIBUNWIND:=$(build_libdir)/libosxunwind.a
+LIBUNWIND:=-losxunwind
JCPPFLAGS+=-DLIBOSXUNWIND
else
-LIBUNWIND:=$(build_libdir)/libunwind-generic.a $(build_libdir)/libunwind.a
+LIBUNWIND:=-lunwind
endif
endif
endif
@@ -1206,12 +1206,12 @@ OSLIBS += -lelf -lkvm -lrt -lpthread
OSLIBS += -lgcc_s
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \
- $(NO_WHOLE_ARCHIVE) $(LIBUNWIND)
+ $(NO_WHOLE_ARCHIVE)
endif
ifeq ($(OS), Darwin)
SHLIB_EXT := dylib
-OSLIBS += -framework CoreFoundation $(LIBUNWIND)
+OSLIBS += -framework CoreFoundation
WHOLE_ARCHIVE := -Xlinker -all_load
NO_WHOLE_ARCHIVE :=
JLDFLAGS :=
diff --git Makefile Makefile
index 96f58b9aec4e..23d1bd5208f7 100644
--- Makefile
+++ Makefile
@@ -181,6 +181,11 @@ endif
ifeq ($(USE_LLVM_SHLIB),1)
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-9jl
endif
+ifeq ($(OS),Darwin)
+JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libosxunwind
+else
+JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libunwind
+endif
ifeq ($(USE_SYSTEM_LIBM),0)
JL_PRIVATE_LIBS-$(USE_SYSTEM_OPENLIBM) += libopenlibm
diff --git deps/Makefile deps/Makefile
index e6a975ba1873..90e231f30e85 100644
--- deps/Makefile
+++ deps/Makefile
@@ -157,7 +157,11 @@ ifneq ($(OS), WINNT)
DEP_LIBS += libwhich
endif
-DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper osxunwind,$(DEP_LIBS)) # unlist targets that have not been converted to use the staged-install
+# unlist targets that have not been converted to use the staged-install
+DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper,$(DEP_LIBS))
+ifneq ($(USE_BINARYBUILDER_LIBUNWIND),1)
+DEP_LIBS_STAGED := $(filter-out osxunwind,$(DEP_LIBS))
+endif
## Common build target prefixes
diff --git deps/unwind.mk deps/unwind.mk
index f44917c28981..08d8990a720e 100644
--- deps/unwind.mk
+++ deps/unwind.mk
@@ -109,7 +109,7 @@ UNWIND_BB_NAME := LibUnwind.v$(UNWIND_VER)
$(eval $(call bb-install,unwind,UNWIND,false))
-OSXUNWIND_BB_URL_BASE := https://github.com/JuliaPackaging/Yggdrasil/releases/download/LibOSXUnwind-$(OSXUNWIND_VER)-$(OSXUNWIND_BB_REL)
+OSXUNWIND_BB_URL_BASE := https://github.com/JuliaBinaryWrappers/LibOSXUnwind_jll.jl/releases/download/LibOSXUnwind-v$(OSXUNWIND_VER)+$(OSXUNWIND_BB_REL)
OSXUNWIND_BB_NAME := LibOSXUnwind.v$(OSXUNWIND_VER)
$(eval $(call bb-install,osxunwind,OSXUNWIND,false))
diff --git src/Makefile src/Makefile
index 3153c0178d0a..7d8db3740209 100644
--- src/Makefile
+++ src/Makefile
@@ -120,7 +120,7 @@ CLANG_LDFLAGS += -Wl,-undefined,dynamic_lookup
endif
-COMMON_LIBS := -L$(build_shlibdir) -L$(build_libdir) $(LIBUV) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LLVMLINK) $(OSLIBS) $(LIBUNWIND)
+COMMON_LIBS := -L$(build_shlibdir) -L$(build_libdir) $(LIBUV) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(LLVMLINK) $(OSLIBS)
DEBUG_LIBS := $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp-debug.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport-debug.a $(COMMON_LIBS)
RELEASE_LIBS := $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport.a $(COMMON_LIBS)