Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | SUMMARY = "Rust compiler and runtime libaries" |
| 2 | HOMEPAGE = "http://www.rust-lang.org" |
| 3 | SECTION = "devel" |
| 4 | LICENSE = "(MIT | Apache-2.0) & Unicode-TOU" |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=c2cccf560306876da3913d79062a54b9" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 6 | |
| 7 | inherit rust |
| 8 | inherit cargo_common |
| 9 | |
| 10 | DEPENDS += "file-native python3-native" |
| 11 | DEPENDS:append:class-native = " rust-llvm-native" |
| 12 | DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm" |
| 13 | |
| 14 | DEPENDS += "rust-llvm (=${PV})" |
| 15 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 16 | RDEPENDS:${PN}:append:class-target = " gcc g++ binutils" |
| 17 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 18 | # Otherwise we'll depend on what we provide |
| 19 | INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" |
| 20 | # We don't need to depend on gcc-native because yocto assumes it exists |
| 21 | PROVIDES:class-native = "virtual/${TARGET_PREFIX}rust" |
| 22 | |
| 23 | S = "${RUSTSRC}" |
| 24 | |
| 25 | # Use at your own risk, accepted values are stable, beta and nightly |
| 26 | RUST_CHANNEL ?= "stable" |
| 27 | PV .= "${@bb.utils.contains('RUST_CHANNEL', 'stable', '', '-${RUST_CHANNEL}', d)}" |
| 28 | |
| 29 | export FORCE_CRATE_HASH="${BB_TASKHASH}" |
| 30 | |
| 31 | RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" |
| 32 | RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" |
| 33 | |
| 34 | # We don't want to use bitbakes vendoring because the rust sources do their |
| 35 | # own vendoring. |
| 36 | CARGO_DISABLE_BITBAKE_VENDORING = "1" |
| 37 | |
| 38 | # We can't use RUST_BUILD_SYS here because that may be "musl" if |
| 39 | # TCLIBC="musl". Snapshots are always -unknown-linux-gnu |
| 40 | setup_cargo_environment () { |
| 41 | # The first step is to build bootstrap and some early stage tools, |
| 42 | # these are build for the same target as the snapshot, e.g. |
| 43 | # x86_64-unknown-linux-gnu. |
| 44 | # Later stages are build for the native target (i.e. target.x86_64-linux) |
| 45 | cargo_common_do_configure |
| 46 | } |
| 47 | |
| 48 | inherit rust-target-config |
| 49 | |
| 50 | do_rust_setup_snapshot () { |
| 51 | for installer in "${WORKDIR}/rust-snapshot-components/"*"/install.sh"; do |
| 52 | "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig |
| 53 | done |
| 54 | |
| 55 | # Some versions of rust (e.g. 1.18.0) tries to find cargo in stage0/bin/cargo |
| 56 | # and fail without it there. |
| 57 | mkdir -p ${RUSTSRC}/build/${BUILD_SYS} |
| 58 | ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0 |
| 59 | |
| 60 | # Need to use uninative's loader if enabled/present since the library paths |
| 61 | # are used internally by rust and result in symbol mismatches if we don't |
| 62 | if [ ! -z "${UNINATIVE_LOADER}" -a -e "${UNINATIVE_LOADER}" ]; then |
| 63 | for bin in cargo rustc rustdoc; do |
| 64 | patchelf-uninative ${WORKDIR}/rust-snapshot/bin/$bin --set-interpreter ${UNINATIVE_LOADER} |
| 65 | done |
| 66 | fi |
| 67 | } |
| 68 | addtask rust_setup_snapshot after do_unpack before do_configure |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 69 | addtask do_test_compile after do_configure do_rust_gen_targets |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 70 | do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" |
| 71 | do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" |
| 72 | |
| 73 | python do_configure() { |
| 74 | import json |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 75 | import configparser |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 76 | |
| 77 | # toml is rather similar to standard ini like format except it likes values |
| 78 | # that look more JSON like. So for our purposes simply escaping all values |
| 79 | # as JSON seem to work fine. |
| 80 | |
| 81 | e = lambda s: json.dumps(s) |
| 82 | |
| 83 | config = configparser.RawConfigParser() |
| 84 | |
| 85 | # [target.ARCH-poky-linux] |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 86 | host_section = "target.{}".format(d.getVar('RUST_HOST_SYS')) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 87 | config.add_section(host_section) |
| 88 | |
| 89 | llvm_config_target = d.expand("${RUST_ALTERNATE_EXE_PATH}") |
| 90 | llvm_config_build = d.expand("${RUST_ALTERNATE_EXE_PATH_NATIVE}") |
| 91 | config.set(host_section, "llvm-config", e(llvm_config_target)) |
| 92 | |
| 93 | config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) |
| 94 | config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) |
| 95 | config.set(host_section, "linker", e(d.expand("${RUST_TARGET_CCLD}"))) |
| 96 | if "musl" in host_section: |
| 97 | config.set(host_section, "musl-root", e(d.expand("${STAGING_DIR_HOST}${exec_prefix}"))) |
| 98 | |
| 99 | # If we don't do this rust-native will compile it's own llvm for BUILD. |
| 100 | # [target.${BUILD_ARCH}-unknown-linux-gnu] |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 101 | build_section = "target.{}".format(d.getVar('RUST_BUILD_SYS')) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 102 | if build_section != host_section: |
| 103 | config.add_section(build_section) |
| 104 | |
| 105 | config.set(build_section, "llvm-config", e(llvm_config_build)) |
| 106 | |
| 107 | config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) |
| 108 | config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) |
| 109 | config.set(build_section, "linker", e(d.expand("${RUST_BUILD_CCLD}"))) |
| 110 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 111 | target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS')) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 112 | if target_section != host_section and target_section != build_section: |
| 113 | config.add_section(target_section) |
| 114 | |
| 115 | config.set(target_section, "llvm-config", e(llvm_config_target)) |
| 116 | |
| 117 | config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) |
| 118 | config.set(target_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) |
| 119 | config.set(target_section, "linker", e(d.expand("${RUST_TARGET_CCLD}"))) |
| 120 | |
| 121 | # [llvm] |
| 122 | config.add_section("llvm") |
| 123 | config.set("llvm", "static-libstdcpp", e(False)) |
| 124 | if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""): |
| 125 | config.set("llvm", "use-libcxx", e(True)) |
| 126 | |
| 127 | # [rust] |
| 128 | config.add_section("rust") |
| 129 | config.set("rust", "rpath", e(True)) |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 130 | config.set("rust", "remap-debuginfo", e(True)) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 131 | config.set("rust", "channel", e(d.expand("${RUST_CHANNEL}"))) |
| 132 | |
| 133 | # Whether or not to optimize the compiler and standard library |
| 134 | config.set("rust", "optimize", e(True)) |
| 135 | |
| 136 | # Emits extraneous output from tests to ensure that failures of the test |
| 137 | # harness are debuggable just from logfiles |
| 138 | config.set("rust", "verbose-tests", e(True)) |
| 139 | |
| 140 | # [build] |
| 141 | config.add_section("build") |
| 142 | config.set("build", "submodules", e(False)) |
| 143 | config.set("build", "docs", e(False)) |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 144 | config.set("build", "tools", ["rust-demangler",]) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 145 | |
| 146 | rustc = d.expand("${WORKDIR}/rust-snapshot/bin/rustc") |
| 147 | config.set("build", "rustc", e(rustc)) |
| 148 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 149 | cargo = d.expand("${WORKDIR}/rust-snapshot/bin/cargo") |
| 150 | config.set("build", "cargo", e(cargo)) |
| 151 | |
| 152 | config.set("build", "vendor", e(True)) |
| 153 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 154 | config.set("build", "target", e([d.getVar("RUST_TARGET_SYS")])) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 155 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 156 | config.set("build", "host", e([d.getVar("RUST_HOST_SYS")])) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 157 | |
| 158 | # We can't use BUILD_SYS since that is something the rust snapshot knows |
| 159 | # nothing about when trying to build some stage0 tools (like fabricate) |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 160 | config.set("build", "build", e(d.getVar("RUST_BUILD_SYS"))) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 161 | |
| 162 | # [install] |
| 163 | config.add_section("install") |
| 164 | # ./x.py install doesn't have any notion of "destdir" |
| 165 | # but we can prepend ${D} to all the directories instead |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 166 | config.set("install", "prefix", e(d.getVar("D") + d.getVar("prefix"))) |
| 167 | config.set("install", "bindir", e(d.getVar("D") + d.getVar("bindir"))) |
| 168 | config.set("install", "libdir", e(d.getVar("D") + d.getVar("libdir"))) |
| 169 | config.set("install", "datadir", e(d.getVar("D") + d.getVar("datadir"))) |
| 170 | config.set("install", "mandir", e(d.getVar("D") + d.getVar("mandir"))) |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 171 | config.set("install", "sysconfdir", e(d.getVar("D") + d.getVar("sysconfdir"))) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 172 | |
| 173 | with open("config.toml", "w") as f: |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 174 | f.write('change-id = 116881\n\n') |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 175 | config.write(f) |
| 176 | |
| 177 | # set up ${WORKDIR}/cargo_home |
| 178 | bb.build.exec_func("setup_cargo_environment", d) |
| 179 | } |
| 180 | |
| 181 | rust_runx () { |
| 182 | echo "COMPILE ${PN}" "$@" |
| 183 | |
| 184 | # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a |
| 185 | # wide range of targets (not just TARGET). Yocto's settings for them will |
| 186 | # be inappropriate, avoid using. |
| 187 | unset CFLAGS |
| 188 | unset LDFLAGS |
| 189 | unset CXXFLAGS |
| 190 | unset CPPFLAGS |
| 191 | |
| 192 | export RUSTFLAGS="${RUST_DEBUG_REMAP}" |
| 193 | |
| 194 | # Copy the natively built llvm-config into the target so we can run it. Horrible, |
| 195 | # but works! |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 196 | if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} -a ! -f ${RUST_ALTERNATE_EXE_PATH} ]; then |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 197 | mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}` |
| 198 | cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH} |
Patrick Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 199 | if [ -e ${STAGING_LIBDIR_NATIVE}/libc++.so.1 ]; then |
| 200 | chrpath -r \$ORIGIN/../../../../../`basename ${STAGING_DIR_NATIVE}`${libdir_native} ${RUST_ALTERNATE_EXE_PATH} |
| 201 | else |
| 202 | chrpath -d ${RUST_ALTERNATE_EXE_PATH} |
| 203 | fi |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 204 | fi |
| 205 | |
| 206 | oe_cargo_fix_env |
| 207 | |
| 208 | python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose |
| 209 | } |
| 210 | rust_runx[vardepsexclude] += "PARALLEL_MAKE" |
| 211 | |
| 212 | require rust-source.inc |
| 213 | require rust-snapshot.inc |
| 214 | |
| 215 | INSANE_SKIP:${PN}:class-native = "already-stripped" |
| 216 | FILES:${PN} += "${libdir}/rustlib" |
| 217 | FILES:${PN} += "${libdir}/*.so" |
| 218 | FILES:${PN}-dev = "" |
| 219 | |
| 220 | do_compile () { |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 221 | } |
| 222 | |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 223 | do_test_compile[dirs] = "${B}" |
| 224 | do_test_compile () { |
| 225 | rust_runx build src/tools/remote-test-server --target "${RUST_TARGET_SYS}" |
| 226 | } |
| 227 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 228 | ALLOW_EMPTY:${PN} = "1" |
| 229 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 230 | PACKAGES =+ "${PN}-rustdoc ${PN}-tools-clippy ${PN}-tools-rustfmt" |
| 231 | FILES:${PN}-rustdoc = "${bindir}/rustdoc" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 232 | FILES:${PN}-tools-clippy = "${bindir}/cargo-clippy ${bindir}/clippy-driver" |
| 233 | FILES:${PN}-tools-rustfmt = "${bindir}/rustfmt" |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 234 | RDEPENDS:${PN}-rustdoc = "${PN}" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 235 | RDEPENDS:${PN}-tools-clippy = "${PN}" |
| 236 | RDEPENDS:${PN}-tools-rustfmt = "${PN}" |
| 237 | |
| 238 | SUMMARY:${PN}-tools-clippy = "A collection of lints to catch common mistakes and improve your Rust code" |
| 239 | SUMMARY:${PN}-tools-rustfmt = "A tool for formatting Rust code according to style guidelines" |
| 240 | |
| 241 | do_install () { |
| 242 | rust_do_install |
| 243 | } |
| 244 | |
| 245 | rust_do_install() { |
| 246 | rust_runx install |
| 247 | } |
| 248 | |
| 249 | rust_do_install:class-nativesdk() { |
| 250 | export PSEUDO_UNLOAD=1 |
| 251 | rust_runx install |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 252 | rust_runx install clippy |
| 253 | rust_runx install rustfmt |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 254 | unset PSEUDO_UNLOAD |
| 255 | |
| 256 | install -d ${D}${bindir} |
| 257 | for i in cargo-clippy clippy-driver rustfmt; do |
| 258 | cp build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} |
| 259 | chrpath -r "\$ORIGIN/../lib" ${D}${bindir}/$i |
| 260 | done |
| 261 | |
| 262 | chown root:root ${D}/ -R |
| 263 | rm ${D}${libdir}/rustlib/uninstall.sh |
| 264 | rm ${D}${libdir}/rustlib/install.log |
| 265 | rm ${D}${libdir}/rustlib/manifest* |
| 266 | } |
| 267 | |
| 268 | EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt" |
| 269 | rust_do_install:class-target() { |
| 270 | export PSEUDO_UNLOAD=1 |
| 271 | rust_runx install |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 272 | rust_runx install clippy |
| 273 | rust_runx install rustfmt |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 274 | unset PSEUDO_UNLOAD |
| 275 | |
| 276 | install -d ${D}${bindir} |
| 277 | for i in ${EXTRA_TOOLS}; do |
| 278 | cp build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} |
| 279 | chrpath -r "\$ORIGIN/../lib" ${D}${bindir}/$i |
| 280 | done |
| 281 | |
| 282 | install -d ${D}${libdir}/rustlib/${RUST_HOST_SYS} |
| 283 | install -m 0644 ${WORKDIR}/rust-targets/${RUST_HOST_SYS}.json ${D}${libdir}/rustlib/${RUST_HOST_SYS}/target.json |
| 284 | |
| 285 | chown root:root ${D}/ -R |
| 286 | rm ${D}${libdir}/rustlib/uninstall.sh |
| 287 | rm ${D}${libdir}/rustlib/install.log |
| 288 | rm ${D}${libdir}/rustlib/manifest* |
| 289 | } |
| 290 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 291 | addtask do_update_snapshot after do_patch |
| 292 | do_update_snapshot[nostamp] = "1" |
| 293 | |
| 294 | # Run with `bitbake -c update_snapshot rust` to update `rust-snapshot.inc` |
| 295 | # with the checksums for the rust snapshot associated with this rustc-src |
| 296 | # tarball. |
| 297 | python do_update_snapshot() { |
| 298 | import json |
| 299 | import re |
| 300 | import sys |
| 301 | |
| 302 | from collections import defaultdict |
| 303 | |
| 304 | with open(os.path.join(d.getVar("S"), "src", "stage0.json")) as f: |
| 305 | j = json.load(f) |
| 306 | |
| 307 | config_dist_server = j['config']['dist_server'] |
| 308 | compiler_date = j['compiler']['date'] |
| 309 | compiler_version = j['compiler']['version'] |
| 310 | |
| 311 | src_uri = defaultdict(list) |
| 312 | for k, v in j['checksums_sha256'].items(): |
| 313 | m = re.search(f"dist/{compiler_date}/(?P<component>.*)-{compiler_version}-(?P<arch>.*)-unknown-linux-gnu\\.tar\\.xz", k) |
| 314 | if m: |
| 315 | component = m.group('component') |
| 316 | arch = m.group('arch') |
| 317 | src_uri[arch].append(f"SRC_URI[{component}-snapshot-{arch}.sha256sum] = \"{v}\"") |
| 318 | |
| 319 | snapshot = """\ |
| 320 | ## This is information on the rust-snapshot (binary) used to build our current release. |
| 321 | ## snapshot info is taken from rust/src/stage0.json |
| 322 | ## Rust is self-hosting and bootstraps itself with a pre-built previous version of itself. |
| 323 | ## The exact (previous) version that has been used is specified in the source tarball. |
| 324 | ## The version is replicated here. |
| 325 | |
| 326 | SNAPSHOT_VERSION = "%s" |
| 327 | |
| 328 | """ % compiler_version |
| 329 | |
| 330 | for arch, components in src_uri.items(): |
| 331 | snapshot += "\n".join(components) + "\n\n" |
| 332 | |
| 333 | snapshot += """\ |
| 334 | SRC_URI += " \\ |
| 335 | ${RUST_DIST_SERVER}/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ |
| 336 | ${RUST_DIST_SERVER}/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ |
| 337 | ${RUST_DIST_SERVER}/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ |
| 338 | " |
| 339 | |
| 340 | RUST_DIST_SERVER = "%s" |
| 341 | |
| 342 | RUST_STD_SNAPSHOT = "rust-std-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" |
| 343 | RUSTC_SNAPSHOT = "rustc-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" |
| 344 | CARGO_SNAPSHOT = "cargo-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" |
| 345 | """ % config_dist_server |
| 346 | |
| 347 | with open(os.path.join(d.getVar("THISDIR"), "rust-snapshot.inc"), "w") as f: |
| 348 | f.write(snapshot) |
| 349 | } |
| 350 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 351 | RUSTLIB_DEP:class-nativesdk = "" |
| 352 | |
| 353 | # musl builds include libunwind.a |
| 354 | INSANE_SKIP:${PN} = "staticdev" |
| 355 | |
| 356 | BBCLASSEXTEND = "native nativesdk" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 357 | |
| 358 | # Since 1.70.0 upgrade this fails to build with gold: |
| 359 | # http://errors.yoctoproject.org/Errors/Details/708196/ |
| 360 | # ld: error: version script assignment of to symbol __rust_alloc_error_handler_should_panic failed: symbol not defined |
| 361 | LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd', '', d)}" |