Skip to content

Commit

Permalink
build: make libunwind linked dynamically (#36697)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vtjnash authored Jul 27, 2020
1 parent bb90d64 commit 9267bbf
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 :=
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))

This comment has been minimized.

Copy link
@staticfloat

staticfloat Sep 21, 2020

Member

@vtjnash Just checking that this is a typo and that this should be:

-DEP_LIBS_STAGED := $(filter-out osxunwind,$(DEP_LIBS))
+DEP_LIBS_STAGED := $(filter-out osxunwind,$(DEP_LIBS_STAGED))

This comment has been minimized.

Copy link
@staticfloat

staticfloat Sep 21, 2020

Member

Ah, yes, I see that was updated in a future commit. Nevermind me.

endif


## Common build target prefixes
Expand Down
2 changes: 1 addition & 1 deletion deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OPENLIBM_VER = 0.7.0
OPENLIBM_BB_REL = 0
UNWIND_VER = 1.3.1
UNWIND_BB_REL = 4
OSXUNWIND_VER = 0.0.5
OSXUNWIND_VER = 0.0.6
OSXUNWIND_BB_REL = 0
GMP_VER = 6.2.0
GMP_BB_REL = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
57ee184943cd407bcb0d19d0f8616565
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b46997d83216da569a2337e4ff7da60e3332c9323b60ce2d9352ea0f84aff1b5d7cc849e20c5de387c422d9cb07b4d064b73a278f11d9dadfa6d2f9b28c5fde2
1 change: 0 additions & 1 deletion deps/checksums/libosxunwind-0.0.5.tar.gz/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/libosxunwind-0.0.5.tar.gz/sha512

This file was deleted.

1 change: 1 addition & 0 deletions deps/checksums/libosxunwind-0.0.6.tar.gz/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
62ce12eb88867fe3974904dbf06fb8e9
1 change: 1 addition & 0 deletions deps/checksums/libosxunwind-0.0.6.tar.gz/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
901d1d0e9826b9e691991932897dac3185cd72e668658a319ba71a7f4ab6ac7ae328aa7e67d4c5cbce1a1b7a306d98a754544e8a7530a82d00406e9e42761425
2 changes: 1 addition & 1 deletion deps/unwind.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,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)

Expand Down

4 comments on commit 9267bbf

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt

Please sign in to comment.