Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Avoid setting the RPATH for LLVM #22352

Merged
merged 2 commits into from
Jun 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion deps/libgit2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions deps/libssh2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 > $@
Expand Down
6 changes: 6 additions & 0 deletions deps/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions deps/mbedtls.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 4 additions & 6 deletions deps/tools/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Copy link
Member Author

Choose a reason for hiding this comment

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

This actually ends up duplicating the RPATH specification on FreeBSD, though I nuked everything, rebuilt from scratch, and tested everything, and things are fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

image

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)
Expand Down