Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 1 | |
| 2 | RUST_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" |
| 3 | |
| 4 | require rust.inc |
| 5 | |
| 6 | DEPENDS += "rust-llvm (=${PV})" |
| 7 | |
| 8 | inherit cross-canadian |
| 9 | |
| 10 | DEPENDS += " \ |
| 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. |
| 21 | EXCLUDE_FROM_SHLIBS_${RUSTLIB_TARGET_PN} = "1" |
| 22 | |
| 23 | DEBUG_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 | |
| 28 | LLVM_TARGET[x86_64] = "${RUST_HOST_SYS}" |
| 29 | python 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 | |
| 36 | INHIBIT_DEFAULT_RUST_DEPS = "1" |
| 37 | |
| 38 | export WRAPPER_TARGET_CC = "${CCACHE}${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}" |
| 39 | export WRAPPER_TARGET_CXX = "${CCACHE}${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}" |
| 40 | export WRAPPER_TARGET_CCLD = "${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}" |
| 41 | export WRAPPER_TARGET_LDFLAGS = "${TARGET_LDFLAGS}" |
| 42 | export WRAPPER_TARGET_AR = "${TARGET_PREFIX}ar" |
| 43 | |
| 44 | python 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 | |
| 49 | INSANE_SKIP:${RUSTLIB_TARGET_PN} = "file-rdeps arch ldflags" |
| 50 | SKIP_FILEDEPS:${RUSTLIB_TARGET_PN} = "1" |
| 51 | |
| 52 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
| 53 | INHIBIT_PACKAGE_STRIP = "1" |
| 54 | INHIBIT_SYSROOT_STRIP = "1" |
| 55 | |