diff options
Diffstat (limited to 'poky/meta/files')
-rw-r--r-- | poky/meta/files/rust-ccld-wrapper.c | 29 | ||||
-rw-r--r-- | poky/meta/files/toolchain-shar-extract.sh | 3 | ||||
-rw-r--r-- | poky/meta/files/toolchain-shar-relocate.sh | 4 |
3 files changed, 33 insertions, 3 deletions
diff --git a/poky/meta/files/rust-ccld-wrapper.c b/poky/meta/files/rust-ccld-wrapper.c new file mode 100644 index 000000000..6bc9958b9 --- /dev/null +++ b/poky/meta/files/rust-ccld-wrapper.c @@ -0,0 +1,29 @@ +/* + * Copyright 2021 Richard Purdie + * + * SPDX-License-Identifier: GPL-2.0-only + */ + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +/* + * Run the original script (argv[0] + ".real") with LD_LIBRARY_PATH unset + * This avoids issues where cargo is running a wrapper script using /bin/sh from the host + * which links to something which has an incompatible version in in recipe-sysroot-native + * such as libtinfo on centos 7. + */ + +int main(int argc, char* argv[]) { + char *real = malloc(strlen(argv[0] + 5)); + strcpy(real, argv[0]); + strcpy(real + strlen(argv[0]), ".real"); + putenv("LD_LIBRARY_PATH="); + if(execv(real, argv) == -1) { + printf("Wrapper failed to execute, error: %s\n", strerror(errno)); + return -1; + } +} diff --git a/poky/meta/files/toolchain-shar-extract.sh b/poky/meta/files/toolchain-shar-extract.sh index dd9342758..4386b985b 100644 --- a/poky/meta/files/toolchain-shar-extract.sh +++ b/poky/meta/files/toolchain-shar-extract.sh @@ -56,7 +56,8 @@ if ! xz -V > /dev/null 2>&1; then exit 1 fi -DEFAULT_INSTALL_DIR="@SDKPATH@" +SDK_BUILD_PATH="@SDKPATH@" +DEFAULT_INSTALL_DIR="@SDKPATHINSTALL@" SUDO_EXEC="" EXTRA_TAR_OPTIONS="" target_sdk_dir="" diff --git a/poky/meta/files/toolchain-shar-relocate.sh b/poky/meta/files/toolchain-shar-relocate.sh index 543374129..3ece04db0 100644 --- a/poky/meta/files/toolchain-shar-relocate.sh +++ b/poky/meta/files/toolchain-shar-relocate.sh @@ -61,7 +61,7 @@ done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \ -e "$target_sdk_dir/post-relocate-setup" \ -e "$target_sdk_dir/${0##*/}" | \ xargs -n100 $SUDO_EXEC sed -i \ - -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \ + -e "s:$SDK_BUILD_PATH:$target_sdk_dir:g" \ -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \ -e "s: /usr/bin/perl: /usr/bin/env perl:g" @@ -72,7 +72,7 @@ fi # change all symlinks pointing to @SDKPATH@ for l in $($SUDO_EXEC find $native_sysroot -type l); do - $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l + $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$SDK_BUILD_PATH:$target_sdk_dir:") $l if [ $? -ne 0 ]; then echo "Failed to setup symlinks. Relocate script failed. Abort!" exit 1 |