From 040c196a2f8e6406a58f68d6ee8acbfcf1b4252f Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 16 Jul 2020 15:23:20 -0400 Subject: [PATCH] build: make libunwind linked dynamically 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. --- Make.inc | 6 +++--- Makefile | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Make.inc b/Make.inc index e91461514463c..615cdc59032f6 100644 --- a/Make.inc +++ b/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 diff --git a/Makefile b/Makefile index cad588c148d42..02e7b161ef197 100644 --- a/Makefile +++ b/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