From 8b8fa11c26f29a451537ff65e2ac18dbad85eacc Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 12 Jun 2017 21:44:00 -0700 Subject: [PATCH 1/2] Avoid setting the RPATH for LLVM --- deps/libgit2.mk | 5 ++++- deps/libssh2.mk | 4 ++++ deps/mbedtls.mk | 4 ++++ deps/tools/common.mk | 10 ++++------ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/deps/libgit2.mk b/deps/libgit2.mk index 11d5bcbee196b..2d518cf2ac9c0 100644 --- a/deps/libgit2.mk +++ b/deps/libgit2.mk @@ -37,7 +37,10 @@ LIBGIT2_OPTS += -DCURL_INCLUDE_DIRS=$(build_includedir) -DCURL_LIBRARIES="-L$(bu endif ifeq ($(OS),Linux) -LIBGIT2_OPTS += -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON +LIBGIT2_OPTS += -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON -DCMAKE_INSTALL_RPATH="\$$ORIGIN" +endif +ifeq ($(OS),FreeBSD) +LIBGIT2_OPTS += -DCMAKE_INSTALL_RPATH="\$$ORIGIN" endif # We need to bundle ca certs on linux now that we're using libgit2 with ssl diff --git a/deps/libssh2.mk b/deps/libssh2.mk index ea77379988ac0..e0f91a1b6f21f 100644 --- a/deps/libssh2.mk +++ b/deps/libssh2.mk @@ -20,6 +20,10 @@ else LIBSSH2_OPTS += -DCRYPTO_BACKEND=mbedTLS -DENABLE_ZLIB_COMPRESSION=OFF endif +ifneq (,$(findstring $(OS),Linux FreeBSD)) +LIBSSH2_OPTS += -DCMAKE_INSTALL_RPATH="\$$ORIGIN" +endif + $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/libssh2-encryptedpem.patch-applied: $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/source-extracted cd $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libssh2-encryptedpem.patch echo 1 > $@ diff --git a/deps/mbedtls.mk b/deps/mbedtls.mk index 9ebc0c071dbdd..894551a790927 100644 --- a/deps/mbedtls.mk +++ b/deps/mbedtls.mk @@ -15,6 +15,10 @@ ifeq ($(BUILD_OS),WINNT) MBEDTLS_OPTS += -G"MSYS Makefiles" endif +ifneq (,$(findstring $(OS),Linux FreeBSD)) +MBEDTLS_OPTS += -DCMAKE_INSTALL_RPATH="\$$ORIGIN" +endif + $(SRCDIR)/srccache/$(MBEDTLS_SRC).tgz: | $(SRCDIR)/srccache $(JLDOWNLOAD) $@ $(MBEDTLS_URL) diff --git a/deps/tools/common.mk b/deps/tools/common.mk index edab53c5f7682..2a3b735beeac5 100644 --- a/deps/tools/common.mk +++ b/deps/tools/common.mk @@ -40,16 +40,14 @@ CMAKE_COMMON += -DCMAKE_RC_COMPILER="$$(which $(CROSS_COMPILE)windres)" endif endif -ifneq (,$(findstring $(OS),Linux FreeBSD)) -INSTALL_RPATH := "\$$ORIGIN" -# Part of the FreeBSD libgcc_s kludge +# NOTE: Do not make RPATH changes in CMAKE_COMMON on platforms other than FreeBSD, since +# it will make its way into the LLVM build flags, and LLVM is picky about RPATH (though +# apparently not on FreeBSD). Ref PR #22352 ifeq ($(OS),FreeBSD) ifneq ($(GCCPATH),) -INSTALL_RPATH := "\$$ORIGIN:$(GCCPATH)" +CMAKE_COMMON += -DCMAKE_INSTALL_RPATH="\$$ORIGIN:$(GCCPATH)" endif endif -CMAKE_COMMON += -DCMAKE_INSTALL_RPATH=$(INSTALL_RPATH) -endif # Linux or FreeBSD # For now this is LLVM specific, but I expect it won't be in the future ifeq ($(LLVM_USE_CMAKE),1) From 9e37db0d7ddde2ae8ae81b8142771a3694a0dc91 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 13 Jun 2017 01:01:01 -0400 Subject: [PATCH 2/2] Declare LLVM Make variables as simply-expanded, not recursively expanded --- deps/llvm.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deps/llvm.mk b/deps/llvm.mk index 79b5d6f8d4969..351bb38908348 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -60,6 +60,12 @@ else LLVM_TARGETS := host;NVPTX endif +LLVM_CFLAGS := +LLVM_CXXFLAGS := +LLVM_CPPFLAGS := +LLVM_LDFLAGS := +LLVM_CMAKE := + # Allow adding LLVM specific flags LLVM_CFLAGS += $(CFLAGS) LLVM_CXXFLAGS += $(CXXFLAGS)