On Tue, 1 Nov 2022 at 10:17, Alexander Kanavin via
lists.openembedded.org <[email protected]>
wrote:
>
> Rust targets have the form of 'arch-unknown-linux-gnu' while
> oe's native targets are 'arch-linux-gnu', e.g. omit the vendor.
>
> The effect this has on rust-native builds is that rust first builds
> itself as stage0 for arch-unknown-linux-gnu, then builds itself
> again for arch-unknown-linux-gnu, then finally uses the compiler
> from second step to 'cross-compile' a compiler for 'arch-linux-gnu'.
>
> This last step is really not necessary, and we could save 4 minutes
> out of 12 if it is eliminated. Which is what this patch does
> by setting the target directly to 'arch-unknown-linux-gnu'; rust's
> build system then shortcuts the build process after the second step.

This begs the question of whether we can use the same 'unknown'
targets for actual cross builds, and the answer is that alas, we
cannot. Openembedded builds things differently (for the same target)
depending on whether they're intended for the build system ('native')
or for the target syste. One particular point where this matters is
whether the resulting binaries are linked with a uninative ELF loader,
or with a regular loader, and this difference is encoded in linker
wrapper scripts which are different and are associated with target
names.

Rust has no concept of host vs target: the only thing that defines a
build is the triplet string: 'arch-vendor-system'. There is no room
there to make a host vs. target distinction, if using only standard
targets. Which is why we have to continue with the custom targets, and
the replication of upstream definitions for various llvm settings - a
significant maintenance overhead.

Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#172375): 
https://lists.openembedded.org/g/openembedded-core/message/172375
Mute This Topic: https://lists.openembedded.org/mt/94705323/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to