Skip to content

Commit

Permalink
build: make libunwind linked dynamically [CI skip]
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 committed Jul 20, 2020
1 parent 35f120f commit 104ba90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 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
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 104ba90

Please sign in to comment.