blob: 827000f7bd1e605790ef497bdb2ad7c3f0062275 [file] [log] [blame]
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05001
2RUST_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config"
3
4require rust.inc
5
6DEPENDS += "rust-llvm (=${PV})"
7
8inherit cross-canadian
9
10DEPENDS += " \
11 virtual/${HOST_PREFIX}gcc-crosssdk \
12 virtual/nativesdk-libc rust-llvm-native \
13 virtual/${TARGET_PREFIX}compilerlibs \
14 virtual/nativesdk-${HOST_PREFIX}compilerlibs \
15 gcc-cross-${TARGET_ARCH} \
16 "
17
18# The host tools are likely not to be able to do the necessary operation on
19# the target architecturea. Alternatively one could check compatibility
20# between host/target.
21EXCLUDE_FROM_SHLIBS_${RUSTLIB_TARGET_PN} = "1"
22
23DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
24 -fdebug-prefix-map=${STAGING_DIR_HOST}= \
25 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
26 "
27
28LLVM_TARGET[x86_64] = "${RUST_HOST_SYS}"
29python do_rust_gen_targets () {
30 wd = d.getVar('WORKDIR') + '/targets/'
31 rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH'))
32 rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH'))
33 rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH'))
34}
35
36INHIBIT_DEFAULT_RUST_DEPS = "1"
37
38export WRAPPER_TARGET_CC = "${CCACHE}${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}"
39export WRAPPER_TARGET_CXX = "${CCACHE}${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}"
40export WRAPPER_TARGET_CCLD = "${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}"
41export WRAPPER_TARGET_LDFLAGS = "${TARGET_LDFLAGS}"
42export WRAPPER_TARGET_AR = "${TARGET_PREFIX}ar"
43
44python do_configure:prepend() {
45 targets = [d.getVar("TARGET_SYS", True), "{}-unknown-linux-gnu".format(d.getVar("HOST_ARCH", True))]
46 hosts = ["{}-unknown-linux-gnu".format(d.getVar("HOST_ARCH", True))]
47}
48
49INSANE_SKIP:${RUSTLIB_TARGET_PN} = "file-rdeps arch ldflags"
50SKIP_FILEDEPS:${RUSTLIB_TARGET_PN} = "1"
51
52INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
53INHIBIT_PACKAGE_STRIP = "1"
54INHIBIT_SYSROOT_STRIP = "1"
55