Go to file
James Hilliard b40a2cc391 package/pkg-cargo: ensure host/target rustflags are properly split
In Cargo, it is quite typical for "build scripts" to be written in Rust
and therefore they need to be compiled as part of the overall build. In
cross-compilation, that means a mixed host and target build.

Unfortunately, by default Cargo makes no distinction between the
RUSTFLAGS used for the host and the target. There is, however, an
unstable feature to make this distinction [1][2].

We already have CARGO_TARGET_APPLIES_TO_HOST="false". This makes sure
that any configuration that we make for the target doesn't automatically
apply to the host as well. However, this only applies for per-target
configuration, for example the setting of "cc" in the config.toml
generated by package/rust/rust.mk. Flags that are passed with RUSTFLAGS
still apply to both host and target. Therefore, we need to use the
CARGO_TARGET_<tuple>_RUSTFLAGS environment variable instead of plain
RUSTFLAGS.

This, however, doesn't allow us to specify flags that apply only to the
host. We could use CARGO_TARGET_<hosttuple>_RUSTFLAGS for that, but that
doesn't work in case the host and target tuple are the same. For this,
we need another unstable feature, enabled with
CARGO_UNSTABLE_HOST_CONFIG="true". With this enabled, we can specify
flags that apply only for the host build using CARGO_HOST_RUSTFLAGS.

Currently, we don't have any such flags, but we really should: we should
pass the proper link flags to point to $(HOST_DIR)/lib. Therefore, add
CARGO_HOST_RUSTFLAGS doing exactly that.

[1] https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config
[2] https://github.com/rust-lang/cargo/pull/10395

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2023-04-11 09:39:07 +02:00
arch arch/arch.mk.xtensa: relax check on overlay file to apply only to internal toolchains 2022-11-13 22:32:31 +01:00
board board/qemu/start-qemu.sh.in: support launching with host system's qemu 2023-04-10 23:16:57 +02:00
boot Merge branch 'next' 2023-03-12 22:45:36 +01:00
configs configs/olimex_a20_olinuxino_lime*: configure eth0 with DHCP 2023-04-10 19:32:38 +02:00
docs package/doc-asciidoc: allow docs to request a specific TOC depth 2023-04-10 21:49:22 +02:00
fs fs/cpio: allow users to provide their own dracut modules 2023-02-06 22:46:35 +01:00
linux linux: use BR2_MAKE 2023-04-10 17:24:15 +02:00
package package/pkg-cargo: ensure host/target rustflags are properly split 2023-04-11 09:39:07 +02:00
support Makefile: merge check-flake8 into check-package 2023-04-09 22:33:24 +02:00
system system: Warn if systemd is used with kernel < 4.15 2023-02-07 22:51:26 +01:00
toolchain toolchain/toolchain-external/toolchain-external-codescape-mti-mips: remove wrong MIPS32r5 and MIPS64r5 support 2023-02-15 22:00:05 +01:00
utils utils/check-package: drop six usage 2023-04-10 21:02:35 +02:00
.checkpackageignore .checkpackageignore: remove fixed board/qemu/post-image.sh 2023-04-11 08:59:08 +02:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8 Revert ".flake8: fix check for 80/132 columns" 2021-01-02 17:38:20 +01:00
.gitignore
.gitlab-ci.yml .gitlab-ci.yml: update Docker image to use 2023-02-07 18:15:00 +01:00
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES Update for 2022.02.11 2023-03-19 14:58:53 +01:00
Config.in toolchain: make paranoid check of library/header paths unconditional 2023-02-05 15:11:25 +01:00
Config.in.legacy Merge branch 'next' 2023-03-12 22:45:36 +01:00
COPYING
DEVELOPERS package/python-pep517: drop package 2023-04-09 23:11:41 +02:00
Makefile Makefile: merge check-flake8 into check-package 2023-04-09 22:33:24 +02:00
Makefile.legacy
README docs: move the IRC channel away from Freenode 2021-05-29 22:16:23 +02:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches