From a626e68cee2ef5533cd3334c272562d95123c49b Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 26 Aug 2015 12:17:28 -0400 Subject: [PATCH] rust-1.2.0: fix llvm link issue cause "multiple crates" error Fixes #6 (until something else comes along and adds another '-L') At the same time remove the no longer needed patch to tweak llvm version checking, we disable those checks in configure now. --- ...the-llvm-shipped-as-a-submodule-to-b.patch | 28 --------------- ...at-we-re-only-looking-for-native-lib.patch | 36 +++++++++++++++++++ ...the-llvm-shipped-as-a-submodule-to-b.patch | 28 --------------- recipes/rust/rust_1.2.0.bb | 2 +- 4 files changed, 37 insertions(+), 57 deletions(-) delete mode 100644 recipes/rust/files/rust-1.2.0/0010-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch create mode 100644 recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0011-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch diff --git a/recipes/rust/files/rust-1.2.0/0010-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch b/recipes/rust/files/rust-1.2.0/0010-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch deleted file mode 100644 index 92e7231..0000000 --- a/recipes/rust/files/rust-1.2.0/0010-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch +++ /dev/null @@ -1,28 +0,0 @@ -From dd270c83db48947a4719ca330d6353b8633a053d Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Fri, 7 Aug 2015 15:50:44 -0400 -Subject: [PATCH 10/10] configure: allow the llvm shipped as a submodule to be - used - ---- - configure | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index c07a517..4299e40 100755 ---- a/configure -+++ b/configure -@@ -943,8 +943,8 @@ then - LLVM_CONFIG="$CFG_LLVM_ROOT/bin/llvm-config" - LLVM_VERSION=$($LLVM_CONFIG --version) - -- case $LLVM_VERSION in -- (3.[5-6]*) -+ case ${LLVM_VERSION%svn} in -+ (3.[567]*) - msg "found ok version of LLVM: $LLVM_VERSION" - ;; - (*) --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch b/recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch new file mode 100644 index 0000000..a3e8f2f --- /dev/null +++ b/recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch @@ -0,0 +1,36 @@ +From 64679c95a8f1fcc27702a0ada730d1fd320ab307 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Wed, 26 Aug 2015 11:21:36 -0400 +Subject: [PATCH 10/10] mk: tell rustc that we're only looking for native libs + in the LLVM_LIBDIR + +This fixes the case where we try to re-build & re-install rust to the +same prefix (without uninstalling) while using an llvm-root that is the +same as the prefix. + +Without this, builds like that fail with: + 'error: multiple dylib candidates for `std` found' + +See https://github.com/jmesmon/meta-rust/issues/6 for some details. + +May also be related to #20342. +--- + mk/main.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mk/main.mk b/mk/main.mk +index 73fb58b..4075c24 100644 +--- a/mk/main.mk ++++ b/mk/main.mk +@@ -294,7 +294,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version) + LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir) + LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir) + LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir) +-LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))" ++LLVM_LIBDIR_RUSTFLAGS_$(1)=-L native="$$(LLVM_LIBDIR_$(1))" + LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS)) + LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags) + ifeq ($$(findstring freebsd,$(1)),freebsd) +-- +2.5.0 + diff --git a/recipes/rust/files/rust-1.2.0/0011-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch b/recipes/rust/files/rust-1.2.0/0011-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch deleted file mode 100644 index e9bcdde..0000000 --- a/recipes/rust/files/rust-1.2.0/0011-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch +++ /dev/null @@ -1,28 +0,0 @@ -From dc0e31730dbd22f457c65cac083c233d6fd9cd88 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Fri, 7 Aug 2015 15:50:44 -0400 -Subject: [PATCH 11/11] configure: allow the llvm shipped as a submodule to be - used - ---- - configure | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index c07a517..4299e40 100755 ---- a/configure -+++ b/configure -@@ -943,8 +943,8 @@ then - LLVM_CONFIG="$CFG_LLVM_ROOT/bin/llvm-config" - LLVM_VERSION=$($LLVM_CONFIG --version) - -- case $LLVM_VERSION in -- (3.[5-6]*) -+ case ${LLVM_VERSION%svn} in -+ (3.[567]*) - msg "found ok version of LLVM: $LLVM_VERSION" - ;; - (*) --- -2.5.0 - diff --git a/recipes/rust/rust_1.2.0.bb b/recipes/rust/rust_1.2.0.bb index cc8eec2..2339e1c 100644 --- a/recipes/rust/rust_1.2.0.bb +++ b/recipes/rust/rust_1.2.0.bb @@ -14,7 +14,7 @@ SRC_URI_append = "\ file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ file://${PP}/0008-install-disable-ldconfig.patch \ file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ - file://${PP}/0010-configure-allow-the-llvm-shipped-as-a-submodule-to-b.patch \ + file://${PP}/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch \ \ file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ "