diff options
-rw-r--r-- | meta-vitis-tc/files/toolchain-shar-extract.sh | 4 | ||||
-rw-r--r-- | meta-vitis-tc/files/toolchain-shar-relocate.sh | 25 |
2 files changed, 20 insertions, 9 deletions
diff --git a/meta-vitis-tc/files/toolchain-shar-extract.sh b/meta-vitis-tc/files/toolchain-shar-extract.sh index ec2008c8..a04d9046 100644 --- a/meta-vitis-tc/files/toolchain-shar-extract.sh +++ b/meta-vitis-tc/files/toolchain-shar-extract.sh | |||
@@ -169,7 +169,9 @@ else | |||
169 | fi | 169 | fi |
170 | 170 | ||
171 | # limit the length for target_sdk_dir, ensure the relocation behaviour in relocate_sdk.py has right result. | 171 | # limit the length for target_sdk_dir, ensure the relocation behaviour in relocate_sdk.py has right result. |
172 | if [ ${#target_sdk_dir} -gt 2048 ]; then | 172 | # This is due to ELF interpreter being set to 'a'*1024 in |
173 | # meta/recipes-core/meta/uninative-tarball.bb | ||
174 | if [ ${#target_sdk_dir} -gt 1024 ]; then | ||
173 | echo "Error: The target directory path is too long!!!" | 175 | echo "Error: The target directory path is too long!!!" |
174 | exit 1 | 176 | exit 1 |
175 | fi | 177 | fi |
diff --git a/meta-vitis-tc/files/toolchain-shar-relocate.sh b/meta-vitis-tc/files/toolchain-shar-relocate.sh index 0c396e6d..9e07bbda 100644 --- a/meta-vitis-tc/files/toolchain-shar-relocate.sh +++ b/meta-vitis-tc/files/toolchain-shar-relocate.sh | |||
@@ -1,11 +1,14 @@ | |||
1 | if ! xargs --version > /dev/null 2>&1; then | 1 | for cmd in xargs file; do |
2 | echo "xargs is required by the relocation script, please install it first. Abort!" | 2 | if ! command -v $cmd > /dev/null 2>&1; then |
3 | exit 1 | 3 | echo "The command '$cmd' is required by the relocation script, please install it first. Abort!" |
4 | fi | 4 | exit 1 |
5 | fi | ||
6 | done | ||
5 | 7 | ||
6 | # fix dynamic loader paths in all ELF SDK binaries | 8 | # fix dynamic loader paths in all ELF SDK binaries |
9 | # allow symlinks to be accessed via the find command too | ||
7 | native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"') | 10 | native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"') |
8 | dl_path=$($SUDO_EXEC find $native_sysroot/lib -maxdepth 1 -name "ld-linux*") | 11 | dl_path=$($SUDO_EXEC find $native_sysroot/lib/ -maxdepth 1 -name "ld-linux*") |
9 | if [ "$dl_path" = "" ] ; then | 12 | if [ "$dl_path" = "" ] ; then |
10 | echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!" | 13 | echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!" |
11 | exit 1 | 14 | exit 1 |
@@ -51,13 +54,19 @@ if [ $relocate = 1 -o $relocate = 2 ] ; then | |||
51 | fi | 54 | fi |
52 | fi | 55 | fi |
53 | if [ $relocate = 2 ] ; then | 56 | if [ $relocate = 2 ] ; then |
54 | $SUDO_EXEC ${PYTHON} ${env_setup_script%/*}/relocate-wrapper.py $target_sdk_dir > relocate.log 2>&1 | 57 | tdir=`mktemp -d` |
58 | if [ x$tdir = x ] ; then | ||
59 | echo "SDK relocate failed, could not create a temporary directory" | ||
60 | exit 1 | ||
61 | fi | ||
62 | $SUDO_EXEC ${PYTHON} ${env_setup_script%/*}/relocate-wrapper.py $target_sdk_dir > $tdir/relocate.log 2>&1 | ||
55 | if [ $? -ne 0 ]; then | 63 | if [ $? -ne 0 ]; then |
56 | cat relocate.log | 64 | cat $tdir/relocate.log |
57 | echo "SDK could not be set up. Runtime-Relocate script failed. Abort!" | 65 | echo "SDK could not be set up. Runtime-Relocate script failed. Abort!" |
66 | rm -rf $tdir | ||
58 | exit 1 | 67 | exit 1 |
59 | fi | 68 | fi |
60 | rm -f relocate.log | 69 | rm -rf $tdir |
61 | 70 | ||
62 | for env_setup_scripts in `ls $target_sdk_dir/environment-setup-*`; do | 71 | for env_setup_scripts in `ls $target_sdk_dir/environment-setup-*`; do |
63 | cat << EOF > ${env_setup_scripts}.new | 72 | cat << EOF > ${env_setup_scripts}.new |