about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-11-17 02:21:20 +0000
committerbors <bors@rust-lang.org>2015-11-17 02:21:20 +0000
commit4bd302ee9f714fa8c98ee6218262cbc94094f77c (patch)
tree0f814e75ec693aae19da7e3213181881c0de9e9b
parenta7644b33d9fb411151c522adf258a7cfbf566ef3 (diff)
parent646b0b639228bcc5e506959e5e758f33fe6f4fff (diff)
downloadrust-4bd302ee9f714fa8c98ee6218262cbc94094f77c.tar.gz
rust-4bd302ee9f714fa8c98ee6218262cbc94094f77c.zip
Auto merge of #29794 - semarie:openbsd-stdcpp-path, r=alexcrichton
under openbsd, the library path of libstdc++ need to be explicit (due
to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9).

but when a recent LLVM is installed, rustc compilation pikes the bad
LLVM version (which live in /usr/local/lib, which is same directory of
libestdc++.so for gcc-4.9).

this patch move the libstdc++ path from RUST_FLAGS_<target> to special
variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in
arguments.

r? @alexcrichton
-rw-r--r--mk/platform.mk8
-rw-r--r--mk/target.mk5
-rw-r--r--mk/tests.mk7
3 files changed, 13 insertions, 7 deletions
diff --git a/mk/platform.mk b/mk/platform.mk
index b8058882f9d..9d27f6b2a67 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -214,9 +214,11 @@ define CFG_MAKE_TOOLCHAIN
   # On OpenBSD, we need to pass the path of libstdc++.so to the linker
   # (use path of libstdc++.a which is a known name for the same path)
   ifeq ($(OSTYPE_$(1)),unknown-openbsd)
-    RUSTC_FLAGS_$(1)=-L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
-        -print-file-name=lib$(CFG_STDCPP_NAME).a))" \
-        $(RUSTC_FLAGS_$(1))
+    STDCPP_LIBDIR_RUSTFLAGS_$(1)= \
+        -L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
+        -print-file-name=lib$(CFG_STDCPP_NAME).a))"
+  else
+    STDCPP_LIBDIR_RUSTFLAGS_$(1)=
   endif
 
   # On Bitrig, we need the relocation model to be PIC for everything
diff --git a/mk/target.mk b/mk/target.mk
index ae9fd9d1ada..a88f0a33c07 100644
--- a/mk/target.mk
+++ b/mk/target.mk
@@ -95,6 +95,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
 		$$(RUSTFLAGS_$(4)) \
 		$$(RUSTFLAGS$(1)_$(4)) \
 		$$(RUSTFLAGS$(1)_$(4)_T_$(2)) \
+		$$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \
 		--out-dir $$(@D) \
 		-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
 		$$<
@@ -128,7 +129,9 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
 		$$(TSREQ$(1)_T_$(2)_H_$(3)) \
 		| $$(TBIN$(1)_T_$(2)_H_$(3))/
 	@$$(call E, rustc: $$@)
-	$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4)
+	$$(STAGE$(1)_T_$(2)_H_$(3)) \
+		$$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \
+		-o $$@ $$< --cfg $(4)
 
 endef
 
diff --git a/mk/tests.mk b/mk/tests.mk
index 73aec5de8da..3a0aee77d68 100644
--- a/mk/tests.mk
+++ b/mk/tests.mk
@@ -393,7 +393,8 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
 	    $$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
 		-L "$$(RT_OUTPUT_DIR_$(2))" \
 		$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
-		$$(RUSTFLAGS_$(4))
+		$$(RUSTFLAGS_$(4)) \
+		$$(STDCPP_LIBDIR_RUSTFLAGS_$(2))
 
 endef
 
@@ -663,9 +664,9 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
         --android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
         --adb-path=$(CFG_ADB) \
         --adb-test-dir=$(CFG_ADB_TEST_DIR) \
-        --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
+        --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(3))" \
         --lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
-        --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
+        --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(2))" \
         $$(CTEST_TESTARGS)
 
 ifdef CFG_VALGRIND_RPASS