From d749cbb98acc1a43cb4293536ed5cccde16893b2 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 6 Apr 2016 08:51:38 -0500 Subject: [PATCH 01/14] rust: drop unnecessary data layout targets Since Rust 1.3.0 (rust-lang/rust@958d5638254958ea42652de7444b63f2e67e7fe3) it has been unnecessary to provide the data layout in targets. Additionally the data layouts in this repo created LLVM IR on x86_64 that was differing from other x86_64 builds of Rust. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 7a1cfd2..0316417 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -93,35 +93,31 @@ def llvm_features_from_tune(d): return ','.join(f) ## arm-unknown-linux-gnueabihf -DATA_LAYOUT[arm] = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32" LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" TARGET_ENDIAN[arm] = "little" TARGET_POINTER_WIDTH[arm] = "32" FEATURES[arm] = "+v6,+vfp2" PRE_LINK_ARGS[arm] = "-Wl,--as-needed" -DATA_LAYOUT[aarch64] = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-n32:64-S128" +## aarch64-unknown-linux-gnu LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu" TARGET_ENDIAN[aarch64] = "little" TARGET_POINTER_WIDTH[aarch64] = "64" PRE_LINK_ARGS[aarch64] = "-Wl,--as-needed" ## x86_64-unknown-linux-gnu -DATA_LAYOUT[x86_64] = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" LLVM_TARGET[x86_64] = "x86_64-unknown-linux-gnu" TARGET_ENDIAN[x86_64] = "little" TARGET_POINTER_WIDTH[x86_64] = "64" PRE_LINK_ARGS[x86_64] = "-Wl,--as-needed -m64" ## i686-unknown-linux-gnu -DATA_LAYOUT[i686] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" LLVM_TARGET[i686] = "i686-unknown-linux-gnu" TARGET_ENDIAN[i686] = "little" TARGET_POINTER_WIDTH[i686] = "32" PRE_LINK_ARGS[i686] = "-Wl,--as-needed -m32" ## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-gnu above -DATA_LAYOUT[i586] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" LLVM_TARGET[i586] = "i586-unknown-linux-gnu" TARGET_ENDIAN[i586] = "little" TARGET_POINTER_WIDTH[i586] = "32" @@ -213,9 +209,6 @@ def rust_gen_target(d, thing, wd): prefix = prefix_for(d, thing) o = open(wd + sys + '.json', 'w') - data_layout = d.getVarFlag('DATA_LAYOUT', arch, True) - if not data_layout: - bb.utils.fatal("DATA_LAYOUT[{}] required but not set for {}".format(arch, thing)) llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) endian = d.getVarFlag('TARGET_ENDIAN', arch, True) @@ -233,7 +226,6 @@ def rust_gen_target(d, thing, wd): post_link_args = post_link_args_for(d, thing, arch) o.write('''{{ - "data-layout": "{}", "llvm-target": "{}", "target-endian": "{}", "target-word-size": "{}", @@ -252,7 +244,6 @@ def rust_gen_target(d, thing, wd): "pre-link-args": {}, "post-link-args": {} }}'''.format( - data_layout, llvm_target, endian, target_pointer_width, From 8982df0b5cdea00db9e73510fb09162c3ae6d946 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 6 Apr 2016 09:18:14 -0500 Subject: [PATCH 02/14] rust: drop adding --enable-new-dtags --enable-new-dtags is the default since Rust 1.7.0 due to rust-lang/rust#30378. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 0316417..5ade758 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -123,12 +123,9 @@ TARGET_ENDIAN[i586] = "little" TARGET_POINTER_WIDTH[i586] = "32" PRE_LINK_ARGS[i586] = "-Wl,--as-needed -m32" -# enable-new-dtags causes rpaths to be inserted as DT_RUNPATH (as well as -# DT_RPATH), which lets LD_LIBRARY_PATH override them -RPATH_LDFLAGS = "-Wl,--enable-new-dtags" -TARGET_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" -BUILD_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}" -HOST_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +TARGET_PRE_LINK_ARGS = "${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +BUILD_PRE_LINK_ARGS = "${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +HOST_PRE_LINK_ARGS = "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" # These LDFLAGS have '-L' options in them. We need these to come last so they # don't screw up the link order and pull in the wrong rust build/version. From 5f701adec8c2f41e5ff2717534e1b611a3f03c30 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 6 Apr 2016 13:22:37 -0500 Subject: [PATCH 03/14] rust: fix bad line in patch This needs to be properly escaped. Signed-off-by: Doug Goldstein --- .../files/rust/0007-mk-install-use-disable-rewrite-paths.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-devtools/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch b/recipes-devtools/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch index 0b78467..24135ec 100644 --- a/recipes-devtools/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch +++ b/recipes-devtools/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch @@ -20,7 +20,7 @@ index af6f3ff..430add7 100644 --libdir="$(DESTDIR)$(CFG_LIBDIR)" \ - --mandir="$(DESTDIR)$(CFG_MANDIR)" + --mandir="$(DESTDIR)$(CFG_MANDIR)" \ -+ "$(MAYBE_DISABLE_VERIFY)" ++ "$(MAYBE_DISABLE_VERIFY)" \ + --disable-rewrite-paths install: From 91b165427c7ac78407e4a28e9e7063cf645ccd6e Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 6 Apr 2016 11:39:47 -0500 Subject: [PATCH 04/14] rust: use rust-installer's way of disabling ldconfig Instead of patching in a disable ldconfig argument, just use the way exposed by the rust-installer scripts to disable running ldconfig. Signed-off-by: Doug Goldstein --- .../rust/0008-install-disable-ldconfig.patch | 28 ------------------- recipes-devtools/rust/rust-source.bb | 1 - recipes-devtools/rust/rust.inc | 3 ++ 3 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 recipes-devtools/rust/files/rust/0008-install-disable-ldconfig.patch diff --git a/recipes-devtools/rust/files/rust/0008-install-disable-ldconfig.patch b/recipes-devtools/rust/files/rust/0008-install-disable-ldconfig.patch deleted file mode 100644 index d4cc69a..0000000 --- a/recipes-devtools/rust/files/rust/0008-install-disable-ldconfig.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 2e6a496cb978e3bf885e4e2c3032a02b418c790d Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 12:09:36 -0400 -Subject: [PATCH 8/9] install: disable ldconfig - ---- - mk/install.mk | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index 430add7..6735dc7 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -13,8 +13,9 @@ RUN_INSTALLER = cd tmp/empty_dir && \ - --prefix="$(DESTDIR)$(CFG_PREFIX)" \ - --libdir="$(DESTDIR)$(CFG_LIBDIR)" \ - --mandir="$(DESTDIR)$(CFG_MANDIR)" \ -- "$(MAYBE_DISABLE_VERIFY)" -- --disable-rewrite-paths -+ "$(MAYBE_DISABLE_VERIFY)" \ -+ --disable-rewrite-paths \ -+ --disable-ldconfig - - install: - ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER))) --- -2.4.10 - diff --git a/recipes-devtools/rust/rust-source.bb b/recipes-devtools/rust/rust-source.bb index 893a145..1e9b099 100644 --- a/recipes-devtools/rust/rust-source.bb +++ b/recipes-devtools/rust/rust-source.bb @@ -19,7 +19,6 @@ SRC_URI_append = "\ file://rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ file://rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ file://rust/0007-mk-install-use-disable-rewrite-paths.patch \ - file://rust/0008-install-disable-ldconfig.patch \ file://rust/0009-Remove-crate-metadata-from-symbol-hashing.patch \ file://rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch \ file://rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch \ diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 5ade758..c3c5e7a 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -335,6 +335,9 @@ do_rust_arch_fixup[dirs] += "${WORKDIR}/mk-cfg" llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" +# prevent the rust-installer scripts from calling ldconfig +export CFG_DISABLE_LDCONFIG="notempty" + do_configure () { # Note: when we adjust the generated targets, rust doesn't rebuild (even # when it should), so for now we need to remove the build dir to keep From 8f25a92000f37420090a3b41110b829f085e0b1f Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 6 Apr 2016 14:00:08 -0500 Subject: [PATCH 05/14] rust: drop duplicate variable assignment prefix_for() and the deleted line are identical. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index c3c5e7a..f0173f1 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -209,7 +209,6 @@ def rust_gen_target(d, thing, wd): llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) endian = d.getVarFlag('TARGET_ENDIAN', arch, True) - prefix = d.getVar('{}_PREFIX'.format(thing), True) ccache = d.getVar('CCACHE', True) linker = "{}{}gcc".format(ccache, prefix) objcopy = "{}objcopy".format(prefix) From 95af734ac1b0d1d5622c4856a9d90315882af05a Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 6 Apr 2016 14:14:21 -0500 Subject: [PATCH 06/14] rust: use Python JSON instead of string handling The code previously wrote out a JSON file but used basic string handling instead of the Python JSON library. Its cleaner to use the Python JSON library. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 78 +++++++++++----------------------- 1 file changed, 25 insertions(+), 53 deletions(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index f0173f1..7e38eca 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -166,18 +166,6 @@ def arch_to_rust_target_arch(arch): else: return arch -def as_json(list_): - a = '[' - for e in list_: - if type(e) == str: - a += '"{}",'.format(e) - else: - raise Exception - if len(list_): - a = a[:-1] - a += ']' - return a - def post_link_args_for(d, thing, arch): post_link_args = (d.getVar('{}_POST_LINK_ARGS'.format(thing), True) or "").split() post_link_args.extend((d.getVarFlag('POST_LINK_ARGS', arch, True) or "").split()) @@ -201,57 +189,41 @@ TARGET_LLVM_FEATURES_class-cross = "${@llvm_features_from_tune(d)}" TARGET_LLVM_FEATURES_class-native = "" def rust_gen_target(d, thing, wd): + import json arch = arch_for(d, thing) sys = sys_for(d, thing) prefix = prefix_for(d, thing) - o = open(wd + sys + '.json', 'w') - - llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) - target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) - endian = d.getVarFlag('TARGET_ENDIAN', arch, True) - ccache = d.getVar('CCACHE', True) - linker = "{}{}gcc".format(ccache, prefix) - objcopy = "{}objcopy".format(prefix) features = "" if thing is "TARGET": features = d.getVar('TARGET_LLVM_FEATURES', True) or "" features = features or d.getVarFlag('FEATURES', arch, True) or "" - pre_link_args = pre_link_args_for(d, thing, arch) - post_link_args = post_link_args_for(d, thing, arch) + # build tspec + tspec = {} + tspec['llvm-target'] = d.getVarFlag('LLVM_TARGET', arch, True) + tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) + tspec['target-word-size'] = tspec['target-pointer-width'] + tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch, True) + tspec['arch'] = arch_to_rust_target_arch(arch) + tspec['os'] = "linux" + tspec['linker'] = "{}{}gcc".format(d.getVar('CCACHE', True), prefix) + tspec['objcopy'] = "{}objcopy".format(prefix) + if features is not "": + tspec['features'] = features + tspec['dynamic-linking'] = True + tspec['executables'] = True + tspec['morestack'] = True + tspec['linker-is-gnu'] = True + tspec['has-rpath'] = True + tspec['position-independent-executables'] = True + tspec['pre-link-args'] = pre_link_args_for(d, thing, arch) + tspec['post-link-args'] = post_link_args_for(d, thing, arch) + + # write out the target spec json file + with open(wd + sys + '.json', 'w') as f: + json.dump(tspec, f) - o.write('''{{ - "llvm-target": "{}", - "target-endian": "{}", - "target-word-size": "{}", - "target-pointer-width": "{}", - "arch": "{}", - "os": "linux", - "linker": "{}", - "objcopy": "{}", - "features": "{}", - "dynamic-linking": true, - "executables": true, - "morestack": true, - "linker-is-gnu": true, - "has-rpath": true, - "position-independent-executables": true, - "pre-link-args": {}, - "post-link-args": {} - }}'''.format( - llvm_target, - endian, - target_pointer_width, - target_pointer_width, - arch_to_rust_target_arch(arch), - linker, - objcopy, - features, - as_json(pre_link_args), - as_json(post_link_args), - )) - o.close() python do_rust_gen_targets () { wd = d.getVar('WORKDIR', True) + '/targets/' From 0fb90a149c67d2671bbddfd846a6ad489e638db8 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 7 Apr 2016 08:46:45 -0500 Subject: [PATCH 07/14] rust: fix target generation add 'env' This field defaults to the empty string but for all of our targets it should be set to GNU. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 7e38eca..5b88f63 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -207,6 +207,7 @@ def rust_gen_target(d, thing, wd): tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch, True) tspec['arch'] = arch_to_rust_target_arch(arch) tspec['os'] = "linux" + tspec['env'] = "gnu" tspec['linker'] = "{}{}gcc".format(d.getVar('CCACHE', True), prefix) tspec['objcopy'] = "{}objcopy".format(prefix) if features is not "": From 2fb76952f783543bb919d7c13019d68f27b74d1c Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 7 Apr 2016 08:47:38 -0500 Subject: [PATCH 08/14] rust: fix target generation add 'has-elf-tls' This field defaults to false but for all of our targets it should be true. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 5b88f63..ca4d32d 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -217,6 +217,7 @@ def rust_gen_target(d, thing, wd): tspec['morestack'] = True tspec['linker-is-gnu'] = True tspec['has-rpath'] = True + tspec['has-elf-tls'] = True tspec['position-independent-executables'] = True tspec['pre-link-args'] = pre_link_args_for(d, thing, arch) tspec['post-link-args'] = post_link_args_for(d, thing, arch) From ba16b5c39e3a23452a98a88d1ca58da0448f97f0 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 7 Apr 2016 09:31:59 -0500 Subject: [PATCH 09/14] rust: generate an appropriate cpu for targets This generates an appropriate CPU value for the targets. For ARM it leaves the default of 'generic' since we build up all the different CPU differences in the 'features' field but for x86/x86_64 we need to pass an appropriate CPU value. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index ca4d32d..5ac86a1 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -166,6 +166,23 @@ def arch_to_rust_target_arch(arch): else: return arch +# generates our target CPU value +def llvm_cpu(d): + cpu = d.getVar('TUNE_PKGARCH', True) + target = d.getVar('TRANSLATED_TARGET_ARCH', True) + + trans = {} + trans['corei7-64'] = "corei7" + trans['core2-32'] = "core2" + trans['x86-64'] = "x86-64" + trans['i686'] = "i686" + trans['i586'] = "i586" + + try: + return trans[cpu] + except: + return trans.get(target, "generic") + def post_link_args_for(d, thing, arch): post_link_args = (d.getVar('{}_POST_LINK_ARGS'.format(thing), True) or "").split() post_link_args.extend((d.getVarFlag('POST_LINK_ARGS', arch, True) or "").split()) @@ -181,11 +198,14 @@ def ldflags_for(d, thing, arch): a.extend(post_link_args_for(d, thing, arch)) return a +TARGET_LLVM_CPU="${@llvm_cpu(d)}" TARGET_LLVM_FEATURES = "${@llvm_features_from_tune(d)}" +TARGET_LLVM_CPU_class-cross="${@llvm_cpu(d)}" TARGET_LLVM_FEATURES_class-cross = "${@llvm_features_from_tune(d)}" # class-native implies TARGET=HOST, and TUNE_FEATURES only describes the real # (original) target. +TARGET_LLVM_CPU="${@llvm_cpu(d)}" TARGET_LLVM_FEATURES_class-native = "" def rust_gen_target(d, thing, wd): @@ -210,6 +230,7 @@ def rust_gen_target(d, thing, wd): tspec['env'] = "gnu" tspec['linker'] = "{}{}gcc".format(d.getVar('CCACHE', True), prefix) tspec['objcopy'] = "{}objcopy".format(prefix) + tspec['cpu'] = d.getVar('TARGET_LLVM_CPU', True) if features is not "": tspec['features'] = features tspec['dynamic-linking'] = True From b13e266124a4dc1568749405e23fbd3260dcb92e Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 7 Apr 2016 10:44:18 -0500 Subject: [PATCH 10/14] rust: add support for x86 features The existing feature parsing is specific to ARM so we need to add support for x86. This is a little more generic since the variable we parse is changed if we're building for the host, cross or actual target. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 39 +++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 5ac86a1..8e08adf 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -92,6 +92,39 @@ def llvm_features_from_tune(d): return ','.join(f) +# TARGET_CC_ARCH changes from build/cross/target so it'll do the right thing +# this should go away when https://github.com/rust-lang/rust/pull/31709 is +# stable (1.9.0?) +def llvm_features_from_cc_arch(d): + f = [] + feat = d.getVar('TARGET_CC_ARCH', True) + if not feat: + return "" + feat = frozenset(feat.split()) + + if '-mmmx' in feat: + f.append("+mmx") + if '-msse' in feat: + f.append("+sse") + if '-msse2' in feat: + f.append("+sse2") + if '-msse3' in feat: + f.append("+sse3") + if '-mssse3' in feat: + f.append("+ssse3") + if '-msse4.1' in feat: + f.append("+sse4.1") + if '-msse4.2' in feat: + f.append("+sse4.2") + if '-msse4a' in feat: + f.append("+sse4a") + if '-mavx' in feat: + f.append("+avx") + if '-mavx2' in feat: + f.append("+avx2") + + return ','.join(f) + ## arm-unknown-linux-gnueabihf LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" TARGET_ENDIAN[arm] = "little" @@ -199,14 +232,14 @@ def ldflags_for(d, thing, arch): return a TARGET_LLVM_CPU="${@llvm_cpu(d)}" -TARGET_LLVM_FEATURES = "${@llvm_features_from_tune(d)}" +TARGET_LLVM_FEATURES = "${@llvm_features_from_tune(d)} ${@llvm_features_from_cc_arch(d)}" TARGET_LLVM_CPU_class-cross="${@llvm_cpu(d)}" -TARGET_LLVM_FEATURES_class-cross = "${@llvm_features_from_tune(d)}" +TARGET_LLVM_FEATURES_class-cross = "${@llvm_features_from_tune(d)} ${@llvm_features_from_cc_arch(d)}" # class-native implies TARGET=HOST, and TUNE_FEATURES only describes the real # (original) target. TARGET_LLVM_CPU="${@llvm_cpu(d)}" -TARGET_LLVM_FEATURES_class-native = "" +TARGET_LLVM_FEATURES_class-native = "${@llvm_features_from_cc_arch(d)}" def rust_gen_target(d, thing, wd): import json From 5ced950596835aca8873c4fd5449eca4c5f3d652 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 7 Apr 2016 11:48:24 -0500 Subject: [PATCH 11/14] rust: add missing 'ar' to target spec We need to make sure we're using the cross compiling ar instead of the system one. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 8e08adf..c494050 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -263,6 +263,7 @@ def rust_gen_target(d, thing, wd): tspec['env'] = "gnu" tspec['linker'] = "{}{}gcc".format(d.getVar('CCACHE', True), prefix) tspec['objcopy'] = "{}objcopy".format(prefix) + tspec['ar'] = "{}ar".format(prefix) tspec['cpu'] = d.getVar('TARGET_LLVM_CPU', True) if features is not "": tspec['features'] = features From 825bf74a2eec3574c1080f3a2c7c420d72427021 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Fri, 8 Apr 2016 12:26:18 -0500 Subject: [PATCH 12/14] rust: update to the proper snapshot Rust 1.7.0 uses a snapshot from 2015-12-18 and not 2015-08-11. Without this change Rust will fetch the snapshot during the build process which will fail on Yocto builds that disable network outside of the fetch phase. Signed-off-by: Doug Goldstein --- ...hot-2015-08-11.inc => rust-snapshot-2015-12-18.inc} | 10 +++++----- recipes-devtools/rust/rust.inc | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename recipes-devtools/rust/{rust-snapshot-2015-08-11.inc => rust-snapshot-2015-12-18.inc} (51%) diff --git a/recipes-devtools/rust/rust-snapshot-2015-08-11.inc b/recipes-devtools/rust/rust-snapshot-2015-12-18.inc similarity index 51% rename from recipes-devtools/rust/rust-snapshot-2015-08-11.inc rename to recipes-devtools/rust/rust-snapshot-2015-12-18.inc index ff1c466..a970791 100644 --- a/recipes-devtools/rust/rust-snapshot-2015-08-11.inc +++ b/recipes-devtools/rust/rust-snapshot-2015-12-18.inc @@ -1,14 +1,14 @@ ## snapshot info taken from rust/src/snapshots.txt ## TODO: find a way to add additional SRC_URIs based on the contents of an ## earlier SRC_URI. -RS_DATE = "2015-08-11" -RS_SRCHASH = "1af31d4" +RS_DATE = "2015-12-18" +RS_SRCHASH = "3391630" # linux-x86_64 RS_ARCH = "linux-x86_64" -RS_HASH = "7df8ba9dec63ec77b857066109d4b6250f3d222f" +RS_HASH = "97e2a5eb8904962df8596e95d6e5d9b574d73bf4" RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2" -SRC_URI[rust-snapshot.md5sum] = "53b2e1f553eaeb88e8d60d5380670283" -SRC_URI[rust-snapshot.sha256sum] = "5936f5ec4327d41f3aa9f98cbedebb6fd3d72715f8df578e0c9a669154c80bc3" +SRC_URI[rust-snapshot.md5sum] = "5c29eb06c8b6ce6ff52f544f31efabe1" +SRC_URI[rust-snapshot.sha256sum] = "a8dc5203673ce43f47316beb02ee0c427edb7bbde2ab5fc662a06b52db2950e7" diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index c494050..e59beab 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -2,7 +2,7 @@ inherit rust inherit rust-installer require rust-shared-source.inc -require rust-snapshot-2015-08-11.inc +require rust-snapshot-2015-12-18.inc LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=9c5a05eab0ffc3590e50db38c51d1425" From fe8b755da09448838c3a0056ea2fc18deefc5959 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Fri, 8 Apr 2016 15:04:47 -0500 Subject: [PATCH 13/14] rust: remove --enable-debuginfo Without this we cannot set 'eliminate-frame-pointer' in our target spec. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index e59beab..917fdfb 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -408,7 +408,6 @@ do_configure () { "--disable-docs" \ "--disable-manage-submodules" \ "--disable-debug" \ - "--enable-debuginfo" \ "--enable-optimize" \ "--enable-optimize-cxx" \ "--disable-llvm-version-check" \ From d477a68dba084f27df34cae4aaf547a9fcb35a9f Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sun, 10 Apr 2016 22:56:22 -0500 Subject: [PATCH 14/14] rust: set our release channel appropriately We're always building a stable release so we should be setting our release channel appropriately. Signed-off-by: Doug Goldstein --- recipes-devtools/rust/rust.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 917fdfb..730e9de 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -413,6 +413,7 @@ do_configure () { "--disable-llvm-version-check" \ "--llvm-root=${llvmdir}" \ "--enable-optimize-tests" \ + "--release-channel=stable" \ "--prefix=${prefix}" \ "--target=${TARGET_SYS}" \ "--host=${HOST_SYS}" \