diff options
authorHongxu Jia <>2013-03-11 07:04:17 (GMT)
committerRichard Purdie <>2013-04-23 12:00:52 (GMT)
commita5bdceea552ed7fde095b69082f5527dd22d4539 (patch)
parenta3dfd0dc1b116603a072ec4627df4eb2093909e3 (diff)
populate_sdk_base.bbclass:fix toolchain relocation issues
When run "autoreconf" in toolchain, there is an error if the host's perl's version is not the same as the one in the SDK, the error says that the executable perl mismatches the perl lib's version. This is because most of the autotools' scripts use the "#!/usr/bin/perl -w" which is host perl, but the gnu-configize uses "#! /usr/bin/env perl" which invokes the perl wrapper in the SDK, and the wrapper will set the PERL5LIB to the SDK which causes the mismatch. We can make all the perl scripts to use the host perl or the SDK perl to fix this problem. Cherry-pick commit aeb53bd78991af9fbb60d64176ec864cfc2ddbb9 [YOCTO #3984] (From OE-Core rev: 9c10356bde6d303d84daadb8c1170e08e774f5af) Signed-off-by: Hongxu Jia <> Signed-off-by: Richard Purdie <>
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 5e4ed51..55285d9 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -183,6 +183,13 @@ fi
183# replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc 183# replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc
184find $native_sysroot -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':' -f1|xargs sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" 184find $native_sysroot -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':' -f1|xargs sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g"
185 185
186# find out all perl scripts in $native_sysroot and modify them replacing the
187# host perl with SDK perl.
188for perl_script in $(grep "^#!.*perl" -rls $native_sysroot); do
189 sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \
190 "s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script
186# change all symlinks pointing to ${SDKPATH} 193# change all symlinks pointing to ${SDKPATH}
187for l in $(find $native_sysroot -type l); do 194for l in $(find $native_sysroot -type l); do
188 ln -sfn $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l 195 ln -sfn $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l