The SDK fails to build with a dependency error:
Problem: package packagegroup-rust-cross-canadian-qemux86 requires rust-cross-canadian-x86-64, but none of the providers can be installed
- conflicting requests
- nothing provides libc.so.6(GLIBC_2.34)(64bit)
- nothing provides libstdc++.so.6(GLIBCXX_3.4.29)(64bit)
Rust 1.49.0 needed the 0001-rustc_target-Fix-dash-vs-underscore-mismatches-in-op.patch
patch and newer versions not.
Signed-off-by: Ralf Anton Beier <ralf_beier@me.com>
The rust patches for riscv64 have been upstreamed
and are not needed anymore.
The riscv64 patches for libstd-rs need to be
applied to libc-0.2.93 to work. Some slight
modifications are necessary.
Signed-off-by: Ralf Anton Beier <ralf_beier@me.com>
* Convert to new override syntax
This is the result of automated script (0.9.0) conversion:
oe-core/scripts/contrib/convert-overrides.py .
converting the metadata to use ":" as the override character instead of "_".
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* Manually fix the conversion
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* layer.conf: Update layer compatibility with only dunfell and newer.
Add honister to mark the layers as compatible with honister now that it uses
the new override syntax.
Drop zeus and older which are missing a support for newer override syntax which
was backported only to 1.46 branch (used by dunfell) and newer, e.g.:
https://git.openembedded.org/bitbake/commit/?h=1.46&id=c5418eae56cc50dbae7951c055434a0c456c53a4
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* CI: use YOCTO_BRANCH instead of yocto-${YOCTO_VERSION} for poky checkout
* using latest revision in branch is often better than sticking to
some point releases
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* CI: switch to hardknott branch
* gatesgarth is already EOL, better to use something supported
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* nativesdk: Add some tools in a separate recipe
This brings ATM:
- clippy
- rustfmt
Another approach might be to include these into the existing rust recipe,
but as we can't really use PACKAGECONFIG here it might just overload it.
This way, the tools will be built in parallel and still can be excluded
from the packgae group, if desired.
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This mimics what rustup packages into the toolchain contents. The
presence of the sources for the exact std lib can be useful for the
development and IDE integration.
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
* workflows: Refactor yml to improve build time and reduce size
- Split out the build configuration job
- Use the official sstate mirror
- Disable more of unnecessary features
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Recent versions of cargo support always showing the progress indicator.
By default the progress indicator is hidden if the output is not a tty.
For bitbake builds, the output is redirected to a file and not a tty.
However, if we tell cargo to always show the progress indicator, bitbake
can parse it and will show the user how the rust build is progressing.
This addition closes#236 requesting the SDK support. The implementation
consists on a yet minimum set of worky functionality;
- Includes rustc, rustdoc and cargo.
- Includes libstd and accompanying lib archives for host and for target.
- Integrates with the standard environment setup script.
- Integrates configurations automatically build for target.
The supported build host is still AMD64 only.
Note that there's no need on introducing crosssdk package as the
official snapshot package serves same way as a non SDK build.
Possible future directions:
- Offline build:
- Support pre-cached set of crates that can be vendored.
- Support pre-filled cargo registry.
- Support further tools like cargo-fmt, cargo-clippy, GDB support and so
on.
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Needed when compiling with options such as "-C profile-generate" or
"-Z instrument-coverage", e.g. when generating coverage reports or doing
profile guided optimization.
Building for "+v8.1a" breaks on (at least) Cortex A53 (Armv8-A) on
startup with `Illegal instruction`.
Fixes: 26609f46d9 ("rust.inc: use 'v8.1a' feature when building for aarch64 instead of 'v8'")
* get rid of annoying
'+v8' is not a recognized feature for this target (ignoring feature)
messages in aarch64 builds, they are shown in the log very often:
$ grep -c 'is not a recognized feature for this target (ignoring feature)' cargo/1.49.0-r0/temp/log.do_compile.76960
3824
and sometimes the formatting looks strange as well e.g.:
| ''+v8' is not a recognized feature for this target (ignoring feature)
| +v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| ''+v8+v8' is not a recognized feature for this target' is not a recognized feature for this target (ignoring feature)
| (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| ''''''+v8+v8+v8+v8+v8' is not a recognized feature for this target' is not a recognized feature for this target' is not a recognized feature for this target' is not a recognized feature for this target' is not a recognized feature for this target+v8 (ignoring feature)
| (ignoring feature)
| (ignoring feature)
| (ignoring feature)
| (ignoring feature)
| ' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| '+v8' is not a recognized feature for this target (ignoring feature)
| ''+v8+v8' is not a recognized feature for this target' is not a recognized feature for this target (ignoring feature)
| (ignoring feature)
* not sure when it was changed (if 'v8' ever was valid feature for aarch64)
but with 1.49.0 rustc (from gentoo) I see following cpu and feature options
for arm and aarch64 (and v8 is listed only for arm, for aarch64 only v8.[123456]a)
# rustc --target=arm-unknown-linux-gnueabihf --print target-cpus
Available CPUs for this target:
arm1020e
arm1020t
arm1022e
arm10e
arm10tdmi
arm1136j-s
arm1136jf-s
arm1156t2-s
arm1156t2f-s
arm1176j-s
arm1176jz-s
arm1176jzf-s
arm710t
arm720t
arm7tdmi
arm7tdmi-s
arm8
arm810
arm9
arm920
arm920t
arm922t
arm926ej-s
arm940t
arm946e-s
arm966e-s
arm968e-s
arm9e
arm9tdmi
cortex-a12
cortex-a15
cortex-a17
cortex-a32
cortex-a35
cortex-a5
cortex-a53
cortex-a55
cortex-a57
cortex-a7
cortex-a72
cortex-a73
cortex-a75
cortex-a76
cortex-a76ae
cortex-a77
cortex-a78
cortex-a8
cortex-a9
cortex-m0
cortex-m0plus
cortex-m1
cortex-m23
cortex-m3
cortex-m33
cortex-m35p
cortex-m4
cortex-m55
cortex-m7
cortex-r4
cortex-r4f
cortex-r5
cortex-r52
cortex-r7
cortex-r8
cortex-x1
cyclone
ep9312
exynos-m3
exynos-m4
exynos-m5
generic
iwmmxt
krait
kryo
mpcore
mpcorenovfp
neoverse-n1
sc000
sc300
strongarm
strongarm110
strongarm1100
strongarm1110
swift
xscale
# rustc --target=aarch64-unknown-linux-gnu --print target-cpus
Available CPUs for this target:
a64fx
apple-a10
apple-a11
apple-a12
apple-a13
apple-a7
apple-a8
apple-a9
apple-latest
apple-s4
apple-s5
carmel
cortex-a34
cortex-a35
cortex-a53
cortex-a55
cortex-a57
cortex-a65
cortex-a65ae
cortex-a72
cortex-a73
cortex-a75
cortex-a76
cortex-a76ae
cortex-a77
cortex-a78
cortex-x1
cyclone
exynos-m3
exynos-m4
exynos-m5
falkor
generic
kryo
neoverse-e1
neoverse-n1
saphira
thunderx
thunderx2t99
thunderx3t110
thunderxt81
thunderxt83
thunderxt88
tsv110
# rustc --target=arm-unknown-linux-gnueabihf --print target-features
Available features for this target:
32bit - Prefer 32-bit Thumb instrs.
8msecext - Enable support for ARMv8-M Security Extensions.
a12 - Cortex-A12 ARM processors.
a15 - Cortex-A15 ARM processors.
a17 - Cortex-A17 ARM processors.
a32 - Cortex-A32 ARM processors.
a35 - Cortex-A35 ARM processors.
a5 - Cortex-A5 ARM processors.
a53 - Cortex-A53 ARM processors.
a55 - Cortex-A55 ARM processors.
a57 - Cortex-A57 ARM processors.
a7 - Cortex-A7 ARM processors.
a72 - Cortex-A72 ARM processors.
a73 - Cortex-A73 ARM processors.
a75 - Cortex-A75 ARM processors.
a76 - Cortex-A76 ARM processors.
a77 - Cortex-A77 ARM processors.
a8 - Cortex-A8 ARM processors.
a9 - Cortex-A9 ARM processors.
aclass - Is application profile ('A' series).
acquire-release - Has v8 acquire/release (lda/ldaex etc) instructions.
aes - Enable AES support.
armv2 - ARMv2 architecture.
armv2a - ARMv2a architecture.
armv3 - ARMv3 architecture.
armv3m - ARMv3m architecture.
armv4 - ARMv4 architecture.
armv4t - ARMv4t architecture.
armv5t - ARMv5t architecture.
armv5te - ARMv5te architecture.
armv5tej - ARMv5tej architecture.
armv6 - ARMv6 architecture.
armv6-m - ARMv6m architecture.
armv6j - ARMv7a architecture.
armv6k - ARMv6k architecture.
armv6kz - ARMv6kz architecture.
armv6s-m - ARMv6sm architecture.
armv6t2 - ARMv6t2 architecture.
armv7-a - ARMv7a architecture.
armv7-m - ARMv7m architecture.
armv7-r - ARMv7r architecture.
armv7e-m - ARMv7em architecture.
armv7k - ARMv7a architecture.
armv7s - ARMv7a architecture.
armv7ve - ARMv7ve architecture.
armv8-a - ARMv8a architecture.
armv8-m.base - ARMv8mBaseline architecture.
armv8-m.main - ARMv8mMainline architecture.
armv8-r - ARMv8r architecture.
armv8.1-a - ARMv81a architecture.
armv8.1-m.main - ARMv81mMainline architecture.
armv8.2-a - ARMv82a architecture.
armv8.3-a - ARMv83a architecture.
armv8.4-a - ARMv84a architecture.
armv8.5-a - ARMv85a architecture.
armv8.6-a - ARMv86a architecture.
avoid-movs-shop - Avoid movs instructions with shifter operand.
avoid-partial-cpsr - Avoid CPSR partial update for OOO execution.
bf16 - Enable support for BFloat16 instructions.
cde - Support CDE instructions.
cdecp0 - Coprocessor 0 ISA is CDEv1.
cdecp1 - Coprocessor 1 ISA is CDEv1.
cdecp2 - Coprocessor 2 ISA is CDEv1.
cdecp3 - Coprocessor 3 ISA is CDEv1.
cdecp4 - Coprocessor 4 ISA is CDEv1.
cdecp5 - Coprocessor 5 ISA is CDEv1.
cdecp6 - Coprocessor 6 ISA is CDEv1.
cdecp7 - Coprocessor 7 ISA is CDEv1.
cheap-predicable-cpsr - Disable +1 predication cost for instructions updating CPSR.
cortex-a78 - Cortex-A78 ARM processors.
cortex-x1 - Cortex-X1 ARM processors.
crc - Enable support for CRC instructions.
crypto - Enable support for Cryptography extensions.
d32 - Extend FP to 32 double registers.
db - Has data barrier (dmb/dsb) instructions.
dfb - Has full data barrier (dfb) instruction.
disable-postra-scheduler - Don't schedule again after register allocation.
dont-widen-vmovs - Don't widen VMOVS to VMOVD.
dotprod - Enable support for dot product instructions.
dsp - Supports DSP instructions in ARM and/or Thumb2.
execute-only - Enable the generation of execute only code..
expand-fp-mlx - Expand VFP/NEON MLA/MLS instructions.
exynos - Samsung Exynos processors.
fp-armv8 - Enable ARMv8 FP.
fp-armv8d16 - Enable ARMv8 FP with only 16 d-registers.
fp-armv8d16sp - Enable ARMv8 FP with only 16 d-registers and no double precision.
fp-armv8sp - Enable ARMv8 FP with no double precision.
fp16 - Enable half-precision floating point.
fp16fml - Enable full half-precision floating point fml instructions.
fp64 - Floating point unit supports double precision.
fpao - Enable fast computation of positive address offsets.
fpregs - Enable FP registers.
fpregs16 - Enable 16-bit FP registers.
fpregs64 - Enable 64-bit FP registers.
fullfp16 - Enable full half-precision floating point.
fuse-aes - CPU fuses AES crypto operations.
fuse-literals - CPU fuses literal generation operations.
hwdiv - Enable divide instructions in Thumb.
hwdiv-arm - Enable divide instructions in ARM mode.
i8mm - Enable Matrix Multiply Int8 Extension.
iwmmxt - ARMv5te architecture.
iwmmxt2 - ARMv5te architecture.
krait - Qualcomm Krait processors.
kryo - Qualcomm Kryo processors.
lob - Enable Low Overhead Branch extensions.
long-calls - Generate calls via indirect call instructions.
loop-align - Prefer 32-bit alignment for loops.
m3 - Cortex-M3 ARM processors.
mclass - Is microcontroller profile ('M' series).
mp - Supports Multiprocessing extension.
muxed-units - Has muxed AGU and NEON/FPU.
mve - Support M-Class Vector Extension with integer ops.
mve.fp - Support M-Class Vector Extension with integer and floating ops.
mve1beat - Model MVE instructions as a 1 beat per tick architecture.
mve2beat - Model MVE instructions as a 2 beats per tick architecture.
mve4beat - Model MVE instructions as a 4 beats per tick architecture.
nacl-trap - NaCl trap.
neon - Enable NEON instructions.
neon-fpmovs - Convert VMOVSR, VMOVRS, VMOVS to NEON.
neonfp - Use NEON for single precision FP.
no-branch-predictor - Has no branch predictor.
no-movt - Don't use movt/movw pairs for 32-bit imms.
no-neg-immediates - Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding..
noarm - Does not support ARM mode execution.
nonpipelined-vfp - VFP instructions are not pipelined.
perfmon - Enable support for Performance Monitor extensions.
prefer-ishst - Prefer ISHST barriers.
prefer-vmovsr - Prefer VMOVSR.
prof-unpr - Is profitable to unpredicate.
r4 - Cortex-R4 ARM processors.
r5 - Cortex-R5 ARM processors.
r52 - Cortex-R52 ARM processors.
r7 - Cortex-R7 ARM processors.
ras - Enable Reliability, Availability and Serviceability extensions.
rclass - Is realtime profile ('R' series).
read-tp-hard - Reading thread pointer from register.
reserve-r9 - Reserve R9, making it unavailable as GPR.
ret-addr-stack - Has return address stack.
sb - Enable v8.5a Speculation Barrier.
sha2 - Enable SHA1 and SHA256 support.
slow-fp-brcc - FP compare + branch is slow.
slow-load-D-subreg - Loading into D subregs is slow.
slow-odd-reg - VLDM/VSTM starting with an odd register is slow.
slow-vdup32 - Has slow VDUP32 - prefer VMOV.
slow-vgetlni32 - Has slow VGETLNi32 - prefer VMOV.
slowfpvfmx - Disable VFP / NEON FMA instructions.
slowfpvmlx - Disable VFP / NEON MAC instructions.
soft-float - Use software floating point features..
splat-vfp-neon - Splat register from VFP to NEON.
strict-align - Disallow all unaligned memory access.
swift - Swift ARM processors.
thumb-mode - Thumb mode.
thumb2 - Enable Thumb2 instructions.
trustzone - Enable support for TrustZone security extensions.
use-misched - Use the MachineScheduler.
v4t - Support ARM v4T instructions.
v5t - Support ARM v5T instructions.
v5te - Support ARM v5TE, v5TEj, and v5TExp instructions.
v6 - Support ARM v6 instructions.
v6k - Support ARM v6k instructions.
v6m - Support ARM v6M instructions.
v6t2 - Support ARM v6t2 instructions.
v7 - Support ARM v7 instructions.
v7clrex - Has v7 clrex instruction.
v8 - Support ARM v8 instructions.
v8.1a - Support ARM v8.1a instructions.
v8.1m.main - Support ARM v8-1M Mainline instructions.
v8.2a - Support ARM v8.2a instructions.
v8.3a - Support ARM v8.3a instructions.
v8.4a - Support ARM v8.4a instructions.
v8.5a - Support ARM v8.5a instructions.
v8.6a - Support ARM v8.6a instructions.
v8m - Support ARM v8M Baseline instructions.
v8m.main - Support ARM v8M Mainline instructions.
vfp2 - Enable VFP2 instructions.
vfp2sp - Enable VFP2 instructions with no double precision.
vfp3 - Enable VFP3 instructions.
vfp3d16 - Enable VFP3 instructions with only 16 d-registers.
vfp3d16sp - Enable VFP3 instructions with only 16 d-registers and no double precision.
vfp3sp - Enable VFP3 instructions with no double precision.
vfp4 - Enable VFP4 instructions.
vfp4d16 - Enable VFP4 instructions with only 16 d-registers.
vfp4d16sp - Enable VFP4 instructions with only 16 d-registers and no double precision.
vfp4sp - Enable VFP4 instructions with no double precision.
virtualization - Supports Virtualization extension.
vldn-align - Check for VLDn unaligned access.
vmlx-forwarding - Has multiplier accumulator forwarding.
vmlx-hazards - Has VMLx hazards.
wide-stride-vfp - Use a wide stride when allocating VFP registers.
xscale - ARMv5te architecture.
zcz - Has zero-cycle zeroing instructions.
Rust-specific features:
crt-static - Enables libraries with C Run-time Libraries(CRT) to be statically linked.
Use +feature to enable a feature, or -feature to disable it.
For example, rustc -C -target-cpu=mycpu -C target-feature=+feature1,-feature2
# rustc --target=aarch64-unknown-linux-gnu --print target-features
Available features for this target:
a35 - Cortex-A35 ARM processors.
a53 - Cortex-A53 ARM processors.
a55 - Cortex-A55 ARM processors.
a57 - Cortex-A57 ARM processors.
a64fx - Fujitsu A64FX processors.
a65 - Cortex-A65 ARM processors.
a72 - Cortex-A72 ARM processors.
a73 - Cortex-A73 ARM processors.
a75 - Cortex-A75 ARM processors.
a76 - Cortex-A76 ARM processors.
a77 - Cortex-A77 ARM processors.
aes - Enable AES support.
aggressive-fma - Enable Aggressive FMA for floating-point..
alternate-sextload-cvt-f32-pattern - Use alternative pattern for sextload convert to f32.
altnzcv - Enable alternative NZCV format for floating point comparisons.
am - Enable v8.4-A Activity Monitors extension.
amvs - Enable v8.6-A Activity Monitors Virtualization support.
apple-a10 - Apple A10.
apple-a11 - Apple A11.
apple-a12 - Apple A12.
apple-a13 - Apple A13.
apple-a7 - Apple A7 (the CPU formerly known as Cyclone).
arith-bcc-fusion - CPU fuses arithmetic+bcc operations.
arith-cbz-fusion - CPU fuses arithmetic + cbz/cbnz operations.
balance-fp-ops - balance mix of odd and even D-registers for fp multiply(-accumulate) ops.
bf16 - Enable BFloat16 Extension.
bti - Enable Branch Target Identification.
call-saved-x10 - Make X10 callee saved..
call-saved-x11 - Make X11 callee saved..
call-saved-x12 - Make X12 callee saved..
call-saved-x13 - Make X13 callee saved..
call-saved-x14 - Make X14 callee saved..
call-saved-x15 - Make X15 callee saved..
call-saved-x18 - Make X18 callee saved..
call-saved-x8 - Make X8 callee saved..
call-saved-x9 - Make X9 callee saved..
carmel - Nvidia Carmel processors.
ccdp - Enable v8.5 Cache Clean to Point of Deep Persistence.
ccidx - Enable v8.3-A Extend of the CCSIDR number of sets.
ccpp - Enable v8.2 data Cache Clean to Point of Persistence.
complxnum - Enable v8.3-A Floating-point complex number support.
cortex-a78 - Cortex-A78 ARM processors.
cortex-x1 - Cortex-X1 ARM processors.
crc - Enable ARMv8 CRC-32 checksum instructions.
crypto - Enable cryptographic instructions.
custom-cheap-as-move - Use custom handling of cheap instructions.
disable-latency-sched-heuristic - Disable latency scheduling heuristic.
dit - Enable v8.4-A Data Independent Timing instructions.
dotprod - Enable dot product support.
ecv - Enable enhanced counter virtualization extension.
ete - Enable Embedded Trace Extension.
exynos-cheap-as-move - Use Exynos specific handling of cheap instructions.
exynosm3 - Samsung Exynos-M3 processors.
exynosm4 - Samsung Exynos-M4 processors.
f32mm - Enable Matrix Multiply FP32 Extension.
f64mm - Enable Matrix Multiply FP64 Extension.
falkor - Qualcomm Falkor processors.
fgt - Enable fine grained virtualization traps extension.
fmi - Enable v8.4-A Flag Manipulation Instructions.
force-32bit-jump-tables - Force jump table entries to be 32-bits wide except at MinSize.
fp-armv8 - Enable ARMv8 FP.
fp16fml - Enable FP16 FML instructions.
fptoint - Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int.
fullfp16 - Full FP16.
fuse-address - CPU fuses address generation and memory operations.
fuse-aes - CPU fuses AES crypto operations.
fuse-arith-logic - CPU fuses arithmetic and logic operations.
fuse-crypto-eor - CPU fuses AES/PMULL and EOR operations.
fuse-csel - CPU fuses conditional select operations.
fuse-literals - CPU fuses literal generation operations.
harden-sls-blr - Harden against straight line speculation across BLR instructions.
harden-sls-retbr - Harden against straight line speculation across RET and BR instructions.
i8mm - Enable Matrix Multiply Int8 Extension.
jsconv - Enable v8.3-A JavaScript FP conversion instructions.
kryo - Qualcomm Kryo processors.
lor - Enables ARM v8.1 Limited Ordering Regions extension.
lse - Enable ARMv8.1 Large System Extension (LSE) atomic instructions.
lsl-fast - CPU has a fastpath logical shift of up to 3 places.
mpam - Enable v8.4-A Memory system Partitioning and Monitoring extension.
mte - Enable Memory Tagging Extension.
neon - Enable Advanced SIMD instructions.
neoversee1 - Neoverse E1 ARM processors.
neoversen1 - Neoverse N1 ARM processors.
no-neg-immediates - Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding..
nv - Enable v8.4-A Nested Virtualization Enchancement.
pa - Enable v8.3-A Pointer Authentication extension.
pan - Enables ARM v8.1 Privileged Access-Never extension.
pan-rwv - Enable v8.2 PAN s1e1R and s1e1W Variants.
perfmon - Enable ARMv8 PMUv3 Performance Monitors extension.
pmu - Enable v8.4-A PMU extension.
predictable-select-expensive - Prefer likely predicted branches over selects.
predres - Enable v8.5a execution and data prediction invalidation instructions.
rand - Enable Random Number generation instructions.
ras - Enable ARMv8 Reliability, Availability and Serviceability Extensions.
rasv8_4 - Enable v8.4-A Reliability, Availability and Serviceability extension.
rcpc - Enable support for RCPC extension.
rcpc-immo - Enable v8.4-A RCPC instructions with Immediate Offsets.
rdm - Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions.
reserve-x1 - Reserve X1, making it unavailable as a GPR.
reserve-x10 - Reserve X10, making it unavailable as a GPR.
reserve-x11 - Reserve X11, making it unavailable as a GPR.
reserve-x12 - Reserve X12, making it unavailable as a GPR.
reserve-x13 - Reserve X13, making it unavailable as a GPR.
reserve-x14 - Reserve X14, making it unavailable as a GPR.
reserve-x15 - Reserve X15, making it unavailable as a GPR.
reserve-x18 - Reserve X18, making it unavailable as a GPR.
reserve-x2 - Reserve X2, making it unavailable as a GPR.
reserve-x20 - Reserve X20, making it unavailable as a GPR.
reserve-x21 - Reserve X21, making it unavailable as a GPR.
reserve-x22 - Reserve X22, making it unavailable as a GPR.
reserve-x23 - Reserve X23, making it unavailable as a GPR.
reserve-x24 - Reserve X24, making it unavailable as a GPR.
reserve-x25 - Reserve X25, making it unavailable as a GPR.
reserve-x26 - Reserve X26, making it unavailable as a GPR.
reserve-x27 - Reserve X27, making it unavailable as a GPR.
reserve-x28 - Reserve X28, making it unavailable as a GPR.
reserve-x3 - Reserve X3, making it unavailable as a GPR.
reserve-x30 - Reserve X30, making it unavailable as a GPR.
reserve-x4 - Reserve X4, making it unavailable as a GPR.
reserve-x5 - Reserve X5, making it unavailable as a GPR.
reserve-x6 - Reserve X6, making it unavailable as a GPR.
reserve-x7 - Reserve X7, making it unavailable as a GPR.
reserve-x9 - Reserve X9, making it unavailable as a GPR.
saphira - Qualcomm Saphira processors.
sb - Enable v8.5 Speculation Barrier.
sel2 - Enable v8.4-A Secure Exception Level 2 extension.
sha2 - Enable SHA1 and SHA256 support.
sha3 - Enable SHA512 and SHA3 support.
slow-misaligned-128store - Misaligned 128 bit stores are slow.
slow-paired-128 - Paired 128 bit loads and stores are slow.
slow-strqro-store - STR of Q register with register offset is slow.
sm4 - Enable SM3 and SM4 support.
spe - Enable Statistical Profiling extension.
specrestrict - Enable architectural speculation restriction.
ssbs - Enable Speculative Store Bypass Safe bit.
strict-align - Disallow all unaligned memory access.
sve - Enable Scalable Vector Extension (SVE) instructions.
sve2 - Enable Scalable Vector Extension 2 (SVE2) instructions.
sve2-aes - Enable AES SVE2 instructions.
sve2-bitperm - Enable bit permutation SVE2 instructions.
sve2-sha3 - Enable SHA3 SVE2 instructions.
sve2-sm4 - Enable SM4 SVE2 instructions.
tagged-globals - Use an instruction sequence for taking the address of a global that allows a memory tag in the upper address bits.
thunderx - Cavium ThunderX processors.
thunderx2t99 - Cavium ThunderX2 processors.
thunderx3t110 - Marvell ThunderX3 processors.
thunderxt81 - Cavium ThunderX processors.
thunderxt83 - Cavium ThunderX processors.
thunderxt88 - Cavium ThunderX processors.
tlb-rmi - Enable v8.4-A TLB Range and Maintenance Instructions.
tme - Enable Transactional Memory Extension.
tpidr-el1 - Permit use of TPIDR_EL1 for the TLS base.
tpidr-el2 - Permit use of TPIDR_EL2 for the TLS base.
tpidr-el3 - Permit use of TPIDR_EL3 for the TLS base.
tracev8.4 - Enable v8.4-A Trace extension.
trbe - Enable Trace Buffer Extension.
tsv110 - HiSilicon TS-V110 processors.
uaops - Enable v8.2 UAO PState.
use-aa - Use alias analysis during codegen.
use-experimental-zeroing-pseudos - Hint to the compiler that the MOVPRFX instruction is merged with destructive operations.
use-postra-scheduler - Schedule again after register allocation.
use-reciprocal-square-root - Use the reciprocal square root approximation.
v8.1a - Support ARM v8.1a instructions.
v8.2a - Support ARM v8.2a instructions.
v8.3a - Support ARM v8.3a instructions.
v8.4a - Support ARM v8.4a instructions.
v8.5a - Support ARM v8.5a instructions.
v8.6a - Support ARM v8.6a instructions.
vh - Enables ARM v8.1 Virtual Host extension.
zcm - Has zero-cycle register moves.
zcz - Has zero-cycle zeroing instructions.
zcz-fp - Has zero-cycle zeroing instructions for FP registers.
zcz-fp-workaround - The zero-cycle floating-point zeroing instruction has a bug.
zcz-gp - Has zero-cycle zeroing instructions for generic registers.
Rust-specific features:
crt-static - Enables libraries with C Run-time Libraries(CRT) to be statically linked.
Use +feature to enable a feature, or -feature to disable it.
For example, rustc -C -target-cpu=mycpu -C target-feature=+feature1,-feature2
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Normally all *-native packages needs to depend on cargo-native in order
to be able to use cargo. When building cargo-native however, this is not
available and we use a snapshot.
Fixes#302.
* move common stuff from rust-source to rust.inc and from rust-snapshot to rust-target.inc
* 1.34.2 checksums were changed because unified SRC_URI is using tar.xz
for this version as well (instead of tar.gz used before here)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* rust-llvm.inc sets LICENSE and corresponding LIC_FILES_CHKSUM
for Apache-2.0-with-LLVM-exception, but the recipes which include
rust-llvm-ncsa.inc need to change it to NCSA.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This reverts commit 5dda6c427a.
This breaks rust-llvm builds with:
ERROR: QA Issue: rust-llvm-native: LIC_FILES_CHKSUM points to an invalid file: TOPDIR/BUILD/work/x86_64-linux/rust-llvm-native/1.47.0-r0/rustc-1.47.0-src/src/llvm-project/llvm/COPYRIGHT [license-checksum]
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
If the libstd-rs recipe is not correctly embedding LVM bitcode in its
output, then it can produce a toolchain that appears to work until you
try building a project that requests LTO:
error: failed to get bitcode from object file for LTO (Bitcode section not found in object file)
Enable LTO for rust-hello-world to give us an easy watch to catch such
problems.
Fixes dependency loop
These are usually caused by circular dependencies and any circular dependency chains found will be printed below. Increase the debug level to see a list of unbuildable tasks.
Identifying dependency loops (this may take a short while)...
ERROR:
Dependency loop #1 found:
Task virtual:native:/mnt/b/yoe/master/sources/meta-rust/recipes-devtools/cargo/cargo_1.47.0.bb:do_compile (dependent Tasks ['cargo_1.47.0.bb:do_configure'])
Task virtual:native:/mnt/b/yoe/master/sources/meta-rust/recipes-devtools/cargo/cargo_1.47.0.bb:do_install (dependent Tasks ['cargo_1.47.0.bb:do_compile'])
Task virtual:native:/mnt/b/yoe/master/sources/meta-rust/recipes-devtools/cargo/cargo_1.47.0.bb:do_populate_sysroot (dependent Tasks ['cargo_1.47.0.bb:do_install'])
Task virtual:native:/mnt/b/yoe/master/sources/meta-rust/recipes-devtools/cargo/cargo_1.47.0.bb:do_prepare_recipe_sysroot (dependent Tasks ['cargo_1.47.0.bb:do_populate_sysroot', 'openssl_1.1.1i.bb:do_populate_sysroot', 'curl_7.74.0.bb:do_populate_sysroot', 'rust_1.47.0.bb:do_populate_sysroot', 'zlib_1.2.11.bb:do_populate_sysroot', 'ca-certificates_20210119.bb:do_populate_sysroot', 'libssh2_1.9.0.bb:do_populate_sysroot', 'cargo_1.47.0.bb:do_fetch'])
Task virtual:native:/mnt/b/yoe/master/sources/meta-rust/recipes-devtools/cargo/cargo_1.47.0.bb:do_configure (dependent Tasks ['cargo_1.47.0.bb:do_prepare_recipe_sysroot', 'cargo_1.47.0.bb:do_patch', 'cargo_1.47.0.bb:do_rust_create_wrappers', 'cargo_1.47.0.bb:do_cargo_setup_snapshot'])
ERROR: Command execution failed: 1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Because rust-llvm-ncsa.inc requires rust-llvm.inc we do not want that
the latter overrides the license checksum set in the former.
Signed-off-by: Florin Sarbu <florin@balena.io>
Place generated artifacts in the directory suggested by bitbake (${B})
instead of directly in the source directory. This has multiple
advantages such as the ability to share source directory between
multiple machine types without risking cross contamination.
arm-unknown-linux-gnueabihf was incorrectly used as llvm-target instead
of armv7-unknown-linux-gnueabihf when building for some Cortex A SoCs.
This may cause segfaults in non trivial rust applications on ARMv7
when e.g. +a7 is passed to LLVM. It seems to differ between different
versions of the compiler and LLVM versions.
* BB_NUMBER_THREADS is number of bitbake tasks running in
parallel, not parallelization inside individual tasks
* use oe.utils.parallel_make_argument to make sure it
works even when people add e.g. "-l 10" in PARALLEL_MAKE
* with the recent improvements for rust-native build time, I wanted
to rerun some build time tests from
https://github.com/shr-project/test-oe-build-time
here are the results on AMD Threadripper 3970x with 128GB ram:
BB is BB_NUMBER_THREADS
PM is PARALLEL_MAKE
TIME BB PM Description
20:50 * * zeus based build with 1.37 rust (BB/PM has no impact)
14:50 8 32,48,64 dunfell, 1.43 as in d2ff87ca55 (PM has no impact, because bootstrap uses BB)
9:50 8 32,48,64 dunfell, 1.43 with this patch applied, it doesn't get faster after some threashold of PM
13:32 8 64 dunfell, 1.43 with this patch applied and "rust.inc: cut build time in half" (afcb58e5b9) reverted
13:30 8 64 dunfell, 1.43 with "rust.inc: cut build time in half" (afcb58e5b9) as well as "rust.inc: run bootstrap.py in parallel" (40a6bd8a8d) reverted to see if 1.43 builds faster without any meta-rust improvements compared to 1.37
94:47 1 64 dunfell, 1.43 as in d2ff87ca55 (either something went wrong or explicit "-j 1" disables some parallelism done by default already
13:40 * * zeus based build with 1.39 rust (BB/PM has no impact)
10:50 8 64 zeus based build with 1.39 rust as proposed in jansa/new-zeus-branch
80:51 8 1 zeus based build with 1.39 rust as proposed in jansa/new-zeus-branch with "-j 1" PARALLEL_MAKE
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
d55cce6b8b6b510bf4905f19b949f7995af57a4d added a use of
BB_NUMBER_THREADS which is not whitelisted in Poky. This caused machines
with a different number of CPUs to have different sstate for
rust-native.
As a string this was actually being ignored. It mostly didn't matter
because max-atomic-width falls back to target-pointer-size, and they are
usually the same. However, at least on i586, 64-bit atomics are
supported with a 32-bit pointer size.
The whole point of rust-native is that it should be common for all
targets. If we reference TARGET variables during the build of
rust-native, then bitbake will build a different version for different
TARGETS.
Since ac83d22eb5
The armvX arch definition is not present in TUNE_FEATURES but is now in
MACHINEOVERRIDES. Improve parsing so that MACHINEOVERRIDES is also checked.
Fixes#240
Tested on raspberrypi3 with balenaOS which uses rust.
Signed-off-by: Zubair Lutfullah Kakakhel <zubair@balena.io>
This solves SSL CA cert errors.
When a sstate-cache is used sometimes the certificates are not available
at the compile time path anymore. The required certificates are
available in sysroot-native and can be selected with the cainfo
configuration.
Since 1.31.0 cargo requires curl to support http2. Enabling http2 in
curl results in a dependency loop. This commit disables the use of
multiplexing and http2.
The source of cargo used in a release is shipped with the rust source.
Use this instead of the source from github to make sure cargo and rust
are always kept in sync.
This also makes updating rust version a bit easier.
ARM_INSTRUCTION_SET, and therefore ARM_THUMB_OPT also, expect to only be
used in conjunction with the thumb TUNE_FEATURES. So thumb-mode should only
be added if thumb is in TUNE_FEATURES and ARM_THUMB_OPT is thumb.
The commit https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/conf/machine/include/arm/arch-armv7a.inc?id=3e7d26e31a724009e69788460737e07163a14051
caused armv7a.inc to set ARM_INSTRUCTION_SET to thumb and the commit
message explicitly states that the change should have no effect unless
TUNE_FEATURES also includes thumb. This change to rust will allow that
assumption to continue to be true.
musl builds need libunwind.a to be in sysroot for libstd-rs to build
unwinding support into it. This also means we need to compile libunwind
with --enable-static in oe-core
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This forces the use of libssh2 by exporting the
LIBSSH2_SYS_USE_PKG_CONFIG environment variable.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
We were already trying to disable assertions, but it wasn't working.
rust-llvm now configures assertions based on the CMAKE_BUILD_TYPE.
Setting that to "Release" causes assertions to be disabled, which is
what we want.
Before the flag was stabilized, it required two arguments of the form
"from=<from_path>" and "to=<to_path>" respectively. The stabilized
version uses one argument of the form "<from_path>=<to_path>".
Unfortunately the old format is still parsed successfully, but results
in attempting to replace the literal paths "from" and "to".
https://github.com/rust-lang/rust/issues/41555#issuecomment-320951103
Further changes needed for musl to work.
env needs to be set to "musl" for unwinding work properly.
Also the llvm target should end with "-musl" and not "-gnu".
Put rust-llvm into a directory of it's own. This avoids conflicts
between the official llvm and rusts temporary one. It solves
interoperability issues with meta-clang.
Use /usr/lib/llvm-rust/ as prefix because that matches what llvm does
themselves on debian and ubuntu.
Remove these recipes as I do not believe they are functional since the
fixes for #126 were done (removing the modifications to the compiler to
allow them to be used). #197 additionally points out that rand-rs has
not had a valid commit hash and most of these in some way depend on that
so these cannot possibly work in their current form. Removing per #102.
Fixes#102.
Because devtool inhibits all the normal bitbake fetchers, we can't mask crates.io.
Use EXTERNALSRC to detect if we're being built with devtool, and only mask
crates.io if we're not.
Fixes#195
When yocto is searching for lib dependencies it uses SONAMES and RPATHS to find
the right one. When we compile a rust package which dynamically links to rust's
libstd, yocto will not be able to find the matching dependency in shlib and
will complain with a warning. Even worse, if you have compiled go-runtime, the
build will find go-runtime as provider of libstd and will complain that you
missed a RDEPENDS to go-runtime - this is completely wrong obviously.
This patch adds SONAME to rust's stdlib. In this way yocto will create the
required provider and packages dynamically linking to it will be able to find
libstd-rs as a provider of stdlib.
Signed-off-by: Andrei Gherzan <andrei@resin.io>
Support for mips32 big (mips) and little endian (mipsel) for mips32
and mips32r2 cpus. The big endian target can be verified with the
qemumips machine.
The "target_c_int_width field is added to librustc_back since rust
1.22.0 because not all rust targets (e.g. msp430-none-elf, avr)
have 32-bit int types any more.
0.8.2 is the last version before the breaking "flags" keyword change.
For now, no_std crates need to be rlibs because rustc complains about
missing lang items on dylibs even though it would eventually be resolved
in the final link.
Ignore pub_use_of_private_extern_crate as there exists no version with
this fixed that uses the old API.
Patchelf should be reserved for when the ELF cannot be generated
correctly in the first place. This is not the case here because we have
control over the linker flags. The limitation is that -C link-args can
only be specified once, so consolidate the generation of link-args. Also
introduce some new intermediate variables in link-args generation for
customization.
Patchelf was running only in ${PKGD} because patching the ELF in ${D}
would cause objcopy to fail when splitting the debug sections. This is
not a problem when setting it correctly in the linker. The benefit is
that the rpath is correct in the sysroot as well.
This also switches the rpaths to be relative so that they work in both
the sysroot and the target in the same way.
Signed-off-by: Tyler Hall <tyler.hall@lexmark.com>
Signed-off-by: Steven Walter <swalter@lexmark.com>
Commit 864fe95 ("classes: create proper compiler and linker wrappers")
introduced wrapper scripts for the OE toolchain. Specifying the sysroot
manually ceased to function in rust-bin, so use the wrapper where rustc
is called directly.
This should be more reliable than trying to repeat what OE puts in the
$CC variable.
Since commit 06a138a ("rust: drop custom target finding patch"), rustc
is no longer self-sufficient in finding its target specifications. Any
usage of rustc needs RUST_TARGET_PATH set in the environment.
Move the declaration to rust-common.bbclass and add the export to
rust-bin where rustc is invoked.
Switch the build process to using Rust's new build system called
rustbuild. At the same time stop using jemalloc on all platforms and
switch to the system allocator since that was simplier to do.
We'll need the prior version of cargo to boot strap ourselves going
forward so include the version info so we can support multiple versions
in the tree.
rustbuild is a cargo based way to build Rust but all of our helper bits
in cargo.bbclass would create a chicken/egg issue with dependencies
since we pull down pre-built binaries and use those for boot strapping.
Generate the Cargo recipe with cargo-bitbake instead of having a
handcrafted recipe. This should make future version bumps easier.
Three known issues:
- license checksum of the Apache license is a generateme value
due to the license file having a difference name then what's in
Cargo.toml.
- branch= value was wrong for tags. Pointed to HEAD instead of the
branch that the underlying tag commit came from.
- Use https protocol when the repo is publicly accessible.
There was a bbnote that showed the path to the rustc and cargo binaries
being used but this was not necessarily correct since it didn't use the
exact variables used.
For similar reasons to the C and linker wrappers, using rustbuild
requires a C++ wrapper to ensure that the right flags that Yocto needs
are passed to the underlying compiler.
Technically these dependencies change between versions. It just happens
that these two versions didn't change the dependencies but future
versions will so preemptively make the adjustment.
The path to the rust source changes from 1.15 so preemptively make
changes to prepare for that.
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
The crate_hash flag is no longer accepted on rust 1.14. Additionally,
due to the use of wrapper scripts by cargo, we were no longer able to
link correctly due to some link flags getting dropped. Fix that as well
The way LLVM builds its native utilities is not safe (it runs a
recursive cmake in the same work directory as the main instance). To
prevent those instances from stepping on each other, we'll build the two
native utilities separately before starting the main build.
Fixes issue #143
This is a fast case if the slave has a local checkout available so that
it doesn't have to do a full clone. The check unfortunately didn't take
into account all cases and failed on the new slave.
This patches handle changing the directories that things are installed
in but appear to be unused. They were likely used before rust-cross was
split out to not install files.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Not sure what version this patch appears to have become unnecessary but
I verified it by checking the output in
build/tmp/sstate-control/manifest-x86_64-rust-native.populate_sysroot
and the installed files and their paths didn't change with and without
this patch.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Fix building a toolchain installer with bitbake
-c populate_sdk in packages compiler-rt,
compiler-rt-dev and compiler-rt-staticdev.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
(cherry picked from commit fcbebdf58f)
The -C crate_hash option does not work if multiple versions of the same
crate are being linked into a binary. This can happen if different
dependencies depend on different versions of the same crate. The -C
crate_hash argument causes all versions of a given crate to have the
same crate hash which in turn causes the compiler to select the wrong
one internally and crash. This works around issue #126 for Cargo builds
but does not fix the underlying cause.
Reworked the source redirection to use directory source redirection like
I've done for Gentoo. This allows us to specify all crate dependencies
in the bitbake SRC_URI and have Yocto fetch them down using our crate
fetcher and then Cargo will build without reaching out to the network.
Redid how compiler-rt is built by using the Rust makefiles to build it
instead of compiler-rt's build system. Rust itself deviated from using
compiler-rt's build system and provided their own rules requiring the
source tree to be configured to use them.
We need the Rust snapshot (stage0) for the build environment not the
host environment. This is not affecting us currently because we are only
building native versions of this today but should improve the behavior
of #81 or if any Rust components are built for the target machine.
Since we no longer use shared source we can modify the source directory
as we build. This drops another patch we need to build and simplifies
the addition of Rust 1.12.1 in #97.
Don't supply the linker arguments via rustflags and then mangle with the
RUSTFLAGS environment variable. This is also a parial reversion of
4e1bda643e and 5afc0cc471. These changes are reverted since it assumed
people would build with cargo and not directly with rustc. ref #116.
We don't use the native Rust triples but instead use the Yocto triples
so we need to provide this override properly. This typo was introduced
in 5afc0cc471.
Firstly, HOST_CC_ARCH and TOOLCHAIN_OPTIONS are included in CC so them
being passed in are redundant now (due to the wrapper). The RUST_CFLAGS
variable doesn't need to be exported since its not actually used by
rustc/gcc-rs/cargo. Since its redundant and doesn't need to be exported,
remove it and simplify.
Firstly, BUILD_CC_ARCH is included in BUILD_CC (hence why we actually
need a BUILD_CC wrapper because it produces the space), so its
redundant (now with the wrapper using BUILD_CC). The RUST_BUILD_CFLAGS
variable doesn't need to be exported since its not actually used by
rustc/gcc-rs/cargo. Since its redundant and doesn't need to be
exported remove it and simplify.
Rust builds (custom build.rs and gcc-rs users) expect to have the
compiler and the linker available to them as a single command with no
white space trailing. Yocto unfortunately does not conform to that. The
build compiler and linker almost always have a trailing space due to
how the variables are composed and the target compiler and linker are
almost always more than a single command. Then if you throw ccache into
the mix you'll get another command. As a result to handle all these
cases properly there need to be wrappers created. This change creates
wrappers for both build and target and both the linker and compiler.
This likely fixes#76.
Provide documentation behind what the triples mean for Yocto and Rust
since they have different meanings of BUILD, TARGET, and HOST. Namely
Rust uses HOST when Yocto means BUILD. In our current supported cases
HOST and TARGET from Yocto mean the same thing.
The RUSTFLAGS env var overrides the rustflags specified in the cargo
config so we need to take anything passed in the environment variable
and put it in the config.
Supply the linker and the linker args via rustflags which should make it
not necessary to specify them via target JSONs. We explicitly cannot use
the RUSTFLAGS environment variable do to the way cargo parses arguments
and passes them to rustc.
I don't think we really need much structure, but in many cases
establishing the version of meta-rust which contains the issue is very
helpful in resolving it.
This makes it so the issue-reporter is at least given a field which
asks for the version.
I'm honestly not sure what this patch does since everything appears to
build the same with and without it. I did a `tree` of the sysroots and
images and I don't see any file differences. Something like this used to
be necessary in Gentoo but I dropped it a few releases back.
The host system where things are being built really should control what
toolchain is used for stage0. This in theory should improve #23 but I'm
not sure how to specify a hash per host sys.
This drops the ability to supply your own rust through the PACKAGECONFIG
local-rust option. This isn't tested and we really need to better expand
support for build arches. At the same time this simplifies how the rust
stage0 snapshot is extracted and used by the build system.
Pin the versions of different Rust component packages to the same
version to ensure smooth upgrades. Not sure how to hook the compiler
together with the shared library. Likely rust-cross will need to provide
some kind of dependency to make this happen.
Avoid issues with non-native builds by splitting up the packages a
little closer to how they should be while still leaving the main package
containing everything Rust uses. This makes it possible to build
rust-llvm for the target, hopefully improving issue #81.
Future versions of LLVM require cmake to build so it will be easier to
prove that out on a known good build and to allow future versions to use
this as common code.
This whitespace in here causes rust to not be happy with the features
and throw warnings about a feature such as ' +sse3' being unsupported
when '+sse3' works just fine. Amazingly will cause rustc to abort when
you try to resolve the features to valid configs with the `--print` arg
to rustc.
The data layout changed for Rust 1.10. I noticed this because I got a
crash when using rust-native to build rust. The assertion that hit was
saying data layout mismatch and caused me to check the values in the
Rust sources.
Convert libstd-rs to not use the shared source setup and instead use
its own extracted directory. Include the version info in the bitbake
file so that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
Convert compiler-rt to not use the shared source setup and instead use
its own extracted directory. Include the version info in the bitbake
file so that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
Convert rust to not use the shared source setup and instead use its own
extracted directory. Include the version info in the bitbake file so
that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
Convert rust-llvm to not use the shared source setup and instead use its
own extracted directory. Include the version info in the bitbake file so
that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
This includes a basic test that attempts to compile the rustfmt crate.
Ensures that the workspace is always removed at the end of the build. It
utilizes available caches to speed up the build process and parallelizes
the build across i386, x86_64, arm32, and arm64 targets.
Signed-off-by: Derek Straka <derek@asterius.io>
This script can be extended in the future but it uses the containerize
script to ensure we run inside of a working build environment. This
script can be extended to build additional targets for testing.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
So that we can use the meta-rust layer as the final layer with some
configuration (for the purposes of testing). These configs should be not
used by actual end users.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
meta-rust has some layers it depends on and this script ensures it
fetches them down appropriately so that the poky directory can be used
as the source.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
The containerize script fetches down a Docker container and wires up the
current directory inside so that you can use a known good environment
for compiling Yocto that has all the dependencies.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
rustllvm ships some c++ code that we need to ensure is built with the
flags we want. Abuse an existing variable to make this happen.
This should fix our issues with the libstdc++ cxx11 abi (_GLIBCXX_USE_CXX11_ABI).
When rust's build system builds llvm itself, it uses these flags. Avoid
them interfering with other things by cleaning their usage out of the
platform cfg mk file.
The old cargo.bbclass had no users in meta-rust and had lots of
problems (not least of which was lots of duplicated lines with
cargo_util.bbclass). Delete the old cargo.bbclass and replace it
entirely wiht cargo_util
It's forbidden to access the network during the build phase in bitbake.
Since this version of cargo does not yet support source-replacement, we
must patch out the behavior instead.
OE-Core rev aeb653861a0ec39ea7a014c0622980edcbf653fa (between jethro and
krogoth) removed -e from the default flags in EXTRA_OEMAKE. Without
this, the makefile will default to gcc for CC.
The local registry is a more future-proof way to prevent cargo from
accessing the network during the build. Unfortunately, this is only
used during the build of cargo-native for now. The snapshot used while
building cargo-native supports using a local registry ("source
replacement") however the version of cargo supported by rust 1.10 does
not.
Until we can build a new-enough version of cargo that supports
source-replacement, we'll have to patch cargo directly to prevent it
from accessing the network. Once we do have a new-enough cargo, we can
stop populating cargo_home/registry and only create cargo_registry.
Instead of building a full compiler, we can use rust-native to
cross-compile. All we need is a cross-compiled standard library, which
libstd-rs builds, and a compiler spec file. rust-cross is now just used
to generate the json spec file for cross-compiling, which is naturally
much faster.
This is the compatible version shipped with Rust 1.10.0. Use the git
hash from the release TOML file so there is no ambiguity.
Update git2 and curl dependencies and patches to match those in
Cargo.lock.
Rust does something fairly different than in 1.7. Instead of just
expecting the tarball to exist, it either expects an already extracted
and ready toolchain, or else it does everything itself.
To work with that, we'll always pass --use-local-rust to ./configure so
that bootstrap.py doesn't try to download anything. We'll either
download and setup a snapshot ourselves, or use the system rust, based
on PACKAGECONFIG[local-rust] as before
The oe-core/poky change 'base.bbclass wipe ${S} before unpacking
source' (poky: a56fb90dc3805494eeaf04c60538425e8d52efc5, oe-core:
eccae514b71394ffaed8fc45dea7942152a334a1) wipes ${S} in do_unpack prior
to unpacking. This breaks our shared source as we set ${S} to the shared
location, and don't actually unpack anything (the result is we try to
build rustc without any source code, which fails predictably)
Avoid this by clearing do_unpack[cleandirs].
At the same time take pieces of gcc-shared-source.inc and note how & why
we differ from how gcc operates.
This is a bit of a hack, and only happens to work because we know the
exact method that do_unpack uses to clear ${S}, and using python()
happens to get called at the "right time".
RUSTFLAGS is used by Cargo and always passed to the compiler. Put our
non-standard crate_hash argument there because it is required for
reproducible builds.
Add the rpath option to avoid having to patch Cargo.toml for this and
remove the function that does so.
Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
rust-bin.bbclass now only contains what is necessary to build crates
using the rust compiler directly and rust.bbclass contains information
shared between rust-bin and cargo.
Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
If this dependency is missing its possible that openssl won't be built
before libgit2 is built and then we won't have git support over SSL
which leaves out a lot of git repos.
The August snapshot is no longer new enough for rust 1.7.0. Without the
update rust's build process still tries to download its own snapshot,
which rather defeats the point of this.
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 <cardoe@cardoe.com>
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 <cardoe@cardoe.com>
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 <cardoe@cardoe.com>
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 <cardoe@cardoe.com>
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 <cardoe@cardoe.com>
Since Rust 1.3.0
(rust-lang/rust@958d563825) 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 <cardoe@cardoe.com>
- Building rust-native, rust-cross, rust-hello-world, cargo-native
-Running/using all of these (including rust-hello-world)
-Building `rust-native` and `cargo-native`
- Building Rust based projects with Cargo for the TARGET
-e.g. `rustfmt` which is used by the CI system
-`-buildsdk` and `-crosssdk` packages
## What doesn't:
-Probably some of the untested things
-Using anything but x86_64 as the build environment
- rust (built for target) [issue #81](https://github.com/meta-rust/meta-rust/issues/81)
## What's untested:
-rust (built for target)
- Other TARGETs
-cargo (built for target)
## Common issues when packaging things using cargo
## Building a rust package
You may run into errors similar to:
When building a rust package in bitbake, it's usually easiest to build with
cargo using cargo.bbclass. If the package already has a Cargo.toml file (most
rust packages do), then it's especially easy. Otherwise you should probably
get the code building in cargo first.
```
| src/lib.rs:12:1: 12:35 error: can't find crate for `ffi`
| src/lib.rs:12 extern crate "openssl-sys" as ffi;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Once your package builds in cargo, you can use
[cargo-bitbake](https://github.com/meta-rust/cargo-bitbake) to generate a bitbake
recipe for it. This allows bitbake to fetch all the necessary dependent
crates, as well as a pegged version of the crates.io index, to ensure maximum
reproducibility.
Where a "-sys" crate (or other crate) is not found. These are typically caused
by a crate's Cargo.toml including triplet-specific dependencies and then using
the crate based on a feature (most often, `#[cfg(unix)]`). Until cargo and it's
ecosystem get their act together, you'll need to supply patches to the
misbehaving packages. See `recipies/cargo/cargo_*.bb` for an example of how to
do this.
NOTE: You will have to edit the generated recipe based on the comments
contained within it
## TODO
- -crosssdk and -buildsdk packages
- Upstream local rustc patches for libdir and bindir support
- add bitbake fetch support for crates.io
- add required cargo package registry clones in SRC_URI to prevent the need
for network when building.
## Pitfalls
- TARGET_SYS _must_ be different from BUILD_SYS. This is due to the way configuration options are tracked for different targets.
- TARGET_SYS _must_ be different from BUILD_SYS. This is due to the way Rust configuration options are tracked for different targets. This is the reason we use the Yocto triples instead of the native Rust triples. See [rust-lang/cargo#3349](https://github.com/rust-lang/cargo/issues/3349).
## Dependencies
On the host:
unknown
- Any `-sys` packages your project might need must have RDEPENDs for
the native library.
On the target:
unknown
- Any `-sys` packages your project might need must have RDEPENDs for
the native library.
## Maintainer(s) & Patch policy
Open a Pull Request.
Generally, I try to support the latest master of poky. I'm happy to support
older versions too by applying backwards compat patches as long as I don't need
to maintain a seperate branch. Of course, others are welcome to create forks to
support their individual needs.
The master branch supports the latest master of poky. When poky creates releases, we will create a branch with the same name as the poky release. This release branch should always work with that poky release. Note that these release branches will typically be less tested than the master branch.
All new patches against rust, rust-llvm, and cargo must have referenced
upstream issues or PRs opened or an explanation why the patch cannot be
upstreamed. This corresponds to the OpenEmbedded policy for other meta layers.
## Due to how rust links, we need -fPIC. Without it,
#EXTRA_OECONF_append = " \
# --with-zlib \
# --enable-static \
# --enable-hidden-symbols \
#"
#BUILD_CFLAGS += "-fPIC"
#TARGET_CFLAGS += "-fPIC"
#| note: /usr/bin/ld: .../tmp/work/x86_64-linux/cargo-native/2014-11-07-r0/git/target/x86_64-unknown-linux-gnu/deps/libcurl-f3f9ef32955b72e6.rlib(r-curl-libcurl_la-openssl.o): undefined reference to symbol 'SSL_CTX_set_cipher_list'
#| /usr/lib/libssl.so.1.0.0: error adding symbols: DSO missing from command line
option(LLVM_BUILD_BENCHMARKS "Add LLVM benchmark targets to the list of default
targets. If OFF, benchmarks still could be built using Benchmarks target." OFF)
-option(LLVM_INCLUDE_BENCHMARKS "Generate benchmark targets. If OFF, benchmarks can't be built." ON)
+option(LLVM_INCLUDE_BENCHMARKS "Generate benchmark targets. If OFF, benchmarks can't be built." OFF)
option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.