From 94b93d5eeb1d42f53036172000c6363c38e5e73b Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 20 Nov 2014 17:57:06 -0500 Subject: [PATCH] fixup relative rpaths, remove unused func, fixup llc usage --- ...VM_TARGET-instead-of-plain-target-wh.patch | 26 +++++++++++++++++++ recipes/rust/rust.inc | 8 +++--- recipes/rust/rust_0.12.0+2014-11-19.bb | 1 + 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 recipes/rust/files/0070-mk-rt-use-CFG_LLVM_TARGET-instead-of-plain-target-wh.patch diff --git a/recipes/rust/files/0070-mk-rt-use-CFG_LLVM_TARGET-instead-of-plain-target-wh.patch b/recipes/rust/files/0070-mk-rt-use-CFG_LLVM_TARGET-instead-of-plain-target-wh.patch new file mode 100644 index 0000000..d88994b --- /dev/null +++ b/recipes/rust/files/0070-mk-rt-use-CFG_LLVM_TARGET-instead-of-plain-target-wh.patch @@ -0,0 +1,26 @@ +From 0f6c3e00618fae91987e7d5bf52dbd63ec291f99 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Thu, 20 Nov 2014 15:56:58 -0500 +Subject: [PATCH] mk/rt: use CFG_LLVM_TARGET instead of plain target when + calling llc + +--- + mk/rt.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mk/rt.mk b/mk/rt.mk +index a7d6a6e..38aec83 100644 +--- a/mk/rt.mk ++++ b/mk/rt.mk +@@ -75,7 +75,7 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \ + @mkdir -p $$(@D) + @$$(call E, compile: $$@) + $$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \ +- -filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$< ++ -filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$< + + $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS) + @mkdir -p $$(@D) +-- +2.1.3 + diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 654893f..4850864 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -67,7 +67,7 @@ HOST_CPPFLAGS ??= "${CPPFLAGS}" # relative ones so things work a bit better # # XXX: may need to restrict the -rpath flags to only BUILD & HOST -RELATIVE_LIB_FROM_BIN = "${@os.path.relpath('libdir', 'bindir')}" +RELATIVE_LIB_FROM_BIN = "${@os.path.relpath('${libdir}', '${bindir}')}" RPATH_LDFLAGS = "-Wl,--enable-new-dtags -Wl,-rpath=$ORIGIN/${RELATIVE_LIB_FROM_BIN} -Wl,-rpath-link=$ORIGIN/${RELATIVE_LIB_FROM_BIN}" TARGET_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" BUILD_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}" @@ -240,6 +240,8 @@ def rust_gen_mk_cfg(d, thing): '-e', '/^CFG_GCCISH_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), '-e', '/^CFG_GCCISH_CXXFLAGS/ s;$; {};'.format(cxxflags_for(d, thing)), '-e', '/^CFG_GCCISH_LINK_FLAGS/ s;$; {};'.format(ldflags), + + # May need to add: CFG_LLC_FLAGS_{} ], stdout=o, stdin=i) if r: raise Exception @@ -252,10 +254,6 @@ python do_rust_arch_fixup () { addtask rust_arch_fixup before do_configure after do_patch do_rust_arch_fixup[dirs] = "${S}/mk/cfg" -def rel_bin_to_lib(bindir, libdir): - os.path.relpath(libdir, bindir) - - do_configure () { # FIXME: target_prefix vs prefix, see cross.bbclass diff --git a/recipes/rust/rust_0.12.0+2014-11-19.bb b/recipes/rust/rust_0.12.0+2014-11-19.bb index 542f375..393b6e8 100644 --- a/recipes/rust/rust_0.12.0+2014-11-19.bb +++ b/recipes/rust/rust_0.12.0+2014-11-19.bb @@ -18,4 +18,5 @@ SRC_URI_append = "\ file://0059-rustdoc-avoid-supplying-a-bad-default-sysroot-so-the.patch \ file://0060-src-etc-install.sh-use-LIBDIR-and-BINDIR-RELATIVE.patch \ file://0061-configure-silence-warning-about-LOCAL_RUST_ROOT-bein.patch \ + file://0070-mk-rt-use-CFG_LLVM_TARGET-instead-of-plain-target-wh.patch \ "