diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2022-07-10 13:43:00 -0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-28 11:07:33 +0100 |
| commit | 5204de3f8df8273ee52f4b23061b695c77466b0b (patch) | |
| tree | ae581c1eb05ddae0e8f7ea26f77a8122aa3572b7 | |
| parent | 6749e29082043e4e71849e80e058fa45988c62a5 (diff) | |
| download | poky-5204de3f8df8273ee52f4b23061b695c77466b0b.tar.gz | |
cargo-cross-canadian: Use SDK's flags during target linking
(From OE-Core rev: abb1f3f12b4a02d644414b1af0623894984bb4cd)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/cargo/cargo-cross-canadian.inc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/meta/recipes-devtools/cargo/cargo-cross-canadian.inc b/meta/recipes-devtools/cargo/cargo-cross-canadian.inc index 7fc22a4128..01ba151d0a 100644 --- a/meta/recipes-devtools/cargo/cargo-cross-canadian.inc +++ b/meta/recipes-devtools/cargo/cargo-cross-canadian.inc | |||
| @@ -39,6 +39,18 @@ do_compile:prepend () { | |||
| 39 | PKG_CONFIG_PATH="${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}" | 39 | PKG_CONFIG_PATH="${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}" |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | create_sdk_wrapper () { | ||
| 43 | file="$1" | ||
| 44 | shift | ||
| 45 | |||
| 46 | cat <<- EOF > "${file}" | ||
| 47 | #!/bin/sh | ||
| 48 | \$$1 \$@ | ||
| 49 | EOF | ||
| 50 | |||
| 51 | chmod +x "$file" | ||
| 52 | } | ||
| 53 | |||
| 42 | do_install () { | 54 | do_install () { |
| 43 | SYS_BINDIR=$(dirname ${D}${bindir}) | 55 | SYS_BINDIR=$(dirname ${D}${bindir}) |
| 44 | install -d "${SYS_BINDIR}" | 56 | install -d "${SYS_BINDIR}" |
| @@ -47,6 +59,9 @@ do_install () { | |||
| 47 | chrpath -r "\$ORIGIN/../lib" ${i} | 59 | chrpath -r "\$ORIGIN/../lib" ${i} |
| 48 | done | 60 | done |
| 49 | 61 | ||
| 62 | # Uses SDK's CC as linker so linked binaries works out of box. | ||
| 63 | create_sdk_wrapper "${SYS_BINDIR}/target-rust-ccld" "CC" | ||
| 64 | |||
| 50 | ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d | 65 | ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d |
| 51 | mkdir "${ENV_SETUP_DIR}" | 66 | mkdir "${ENV_SETUP_DIR}" |
| 52 | ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh" | 67 | ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh" |
| @@ -58,7 +73,10 @@ do_install () { | |||
| 58 | touch "\$CARGO_HOME/config" | 73 | touch "\$CARGO_HOME/config" |
| 59 | echo "[build]" >> "\$CARGO_HOME/config" | 74 | echo "[build]" >> "\$CARGO_HOME/config" |
| 60 | echo 'target = "'${TARGET_SYS}'"' >> "\$CARGO_HOME/config" | 75 | echo 'target = "'${TARGET_SYS}'"' >> "\$CARGO_HOME/config" |
| 61 | fi | 76 | echo '# TARGET_SYS' >> "\$CARGO_HOME/config" |
| 77 | echo '[target.'${TARGET_SYS}']' >> "\$CARGO_HOME/config" | ||
| 78 | echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config" | ||
| 79 | fi | ||
| 62 | 80 | ||
| 63 | # Keep the below off as long as HTTP/2 is disabled. | 81 | # Keep the below off as long as HTTP/2 is disabled. |
| 64 | export CARGO_HTTP_MULTIPLEXING=false | 82 | export CARGO_HTTP_MULTIPLEXING=false |
