Skip to content

Commit 9267bbf

Browse files
authored
build: make libunwind linked dynamically (#36697)
Not sure why this was first linked statically, as the commit that introduced this simply had the message "restoring stuff that seems to have been clobbered by the revert of the unintended merge to master". Nearly all other libraries that we use are linked dynamically.
1 parent bb90d64 commit 9267bbf

File tree

12 files changed

+22
-11
lines changed

12 files changed

+22
-11
lines changed

Make.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -940,17 +940,17 @@ LIBUNWIND:=
940940
else
941941
ifeq ($(USE_SYSTEM_LIBUNWIND), 1)
942942
ifneq ($(OS),Darwin)
943-
LIBUNWIND:=-lunwind-generic -lunwind
943+
LIBUNWIND:=-lunwind
944944
# Only for linux since we want to use not yet released libunwind features
945945
JCFLAGS+=-DSYSTEM_LIBUNWIND
946946
JCPPFLAGS+=-DSYSTEM_LIBUNWIND
947947
endif
948948
else
949949
ifeq ($(OS),Darwin)
950-
LIBUNWIND:=$(build_libdir)/libosxunwind.a
950+
LIBUNWIND:=-losxunwind
951951
JCPPFLAGS+=-DLIBOSXUNWIND
952952
else
953-
LIBUNWIND:=$(build_libdir)/libunwind-generic.a $(build_libdir)/libunwind.a
953+
LIBUNWIND:=-lunwind
954954
endif
955955
endif
956956
endif
@@ -1206,12 +1206,12 @@ OSLIBS += -lelf -lkvm -lrt -lpthread
12061206
OSLIBS += -lgcc_s
12071207

12081208
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \
1209-
$(NO_WHOLE_ARCHIVE) $(LIBUNWIND)
1209+
$(NO_WHOLE_ARCHIVE)
12101210
endif
12111211

12121212
ifeq ($(OS), Darwin)
12131213
SHLIB_EXT := dylib
1214-
OSLIBS += -framework CoreFoundation $(LIBUNWIND)
1214+
OSLIBS += -framework CoreFoundation
12151215
WHOLE_ARCHIVE := -Xlinker -all_load
12161216
NO_WHOLE_ARCHIVE :=
12171217
JLDFLAGS :=

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ endif
181181
ifeq ($(USE_LLVM_SHLIB),1)
182182
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-9jl
183183
endif
184+
ifeq ($(OS),Darwin)
185+
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libosxunwind
186+
else
187+
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libunwind
188+
endif
184189

185190
ifeq ($(USE_SYSTEM_LIBM),0)
186191
JL_PRIVATE_LIBS-$(USE_SYSTEM_OPENLIBM) += libopenlibm

deps/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ ifneq ($(OS), WINNT)
157157
DEP_LIBS += libwhich
158158
endif
159159

160-
DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper osxunwind,$(DEP_LIBS)) # unlist targets that have not been converted to use the staged-install
160+
# unlist targets that have not been converted to use the staged-install
161+
DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper,$(DEP_LIBS))
162+
ifneq ($(USE_BINARYBUILDER_LIBUNWIND),1)
163+
DEP_LIBS_STAGED := $(filter-out osxunwind,$(DEP_LIBS))
164+
endif
161165

162166

163167
## Common build target prefixes

deps/Versions.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ OPENLIBM_VER = 0.7.0
1313
OPENLIBM_BB_REL = 0
1414
UNWIND_VER = 1.3.1
1515
UNWIND_BB_REL = 4
16-
OSXUNWIND_VER = 0.0.5
16+
OSXUNWIND_VER = 0.0.6
1717
OSXUNWIND_BB_REL = 0
1818
GMP_VER = 6.2.0
1919
GMP_BB_REL = 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
57ee184943cd407bcb0d19d0f8616565
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b46997d83216da569a2337e4ff7da60e3332c9323b60ce2d9352ea0f84aff1b5d7cc849e20c5de387c422d9cb07b4d064b73a278f11d9dadfa6d2f9b28c5fde2

deps/checksums/libosxunwind-0.0.5.tar.gz/md5

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/checksums/libosxunwind-0.0.5.tar.gz/sha512

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
62ce12eb88867fe3974904dbf06fb8e9
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
901d1d0e9826b9e691991932897dac3185cd72e668658a319ba71a7f4ab6ac7ae328aa7e67d4c5cbce1a1b7a306d98a754544e8a7530a82d00406e9e42761425

deps/unwind.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ UNWIND_BB_NAME := LibUnwind.v$(UNWIND_VER)
109109

110110
$(eval $(call bb-install,unwind,UNWIND,false))
111111

112-
OSXUNWIND_BB_URL_BASE := https://github.com/JuliaPackaging/Yggdrasil/releases/download/LibOSXUnwind-$(OSXUNWIND_VER)-$(OSXUNWIND_BB_REL)
112+
OSXUNWIND_BB_URL_BASE := https://github.com/JuliaBinaryWrappers/LibOSXUnwind_jll.jl/releases/download/LibOSXUnwind-v$(OSXUNWIND_VER)+$(OSXUNWIND_BB_REL)
113113
OSXUNWIND_BB_NAME := LibOSXUnwind.v$(OSXUNWIND_VER)
114114

115115
$(eval $(call bb-install,osxunwind,OSXUNWIND,false))

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ CLANG_LDFLAGS += -Wl,-undefined,dynamic_lookup
121121
endif
122122

123123

124-
COMMON_LIBS := -L$(build_shlibdir) -L$(build_libdir) $(LIBUV) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LLVMLINK) $(OSLIBS) $(LIBUNWIND)
124+
COMMON_LIBS := -L$(build_shlibdir) -L$(build_libdir) $(LIBUV) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(LLVMLINK) $(OSLIBS)
125125
DEBUG_LIBS := $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp-debug.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport-debug.a $(COMMON_LIBS)
126126
RELEASE_LIBS := $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport.a $(COMMON_LIBS)
127127

0 commit comments

Comments
 (0)