fix toolchain relocation issues
cover fix toolchain relocation issues
[YOCTO #3338]
The following changes since commit d7b248e715d99766bf8602ff9f038f8b0afa5e78:
augeas: change SRC_URI (2013-02-26 08:02:29 -0800)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib hongxu/fix-toolchain-relocation
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-toolchain-relocation
Hongxu Jia (2):
perl-nativesdk:fix toolchain relocation issues populate_sdk_base.bbclass:fix toolchain relocation issues
meta/classes/populate_sdk_base.bbclass | 7 +++++++ meta/recipes-devtools/perl/perl_5.14.3.bb | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.10.4
PATCH 1/2 perl-nativesdk:fix toolchain relocation issues
1, Use create_wrapper to create perl wrapper in the SDK. 2, Add perl.real to perl-nativesdk package.
[YOCTO #3338]
--- meta/recipes-devtools/perl/perl_5.14.3.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/perl/perl_5.14.3.bb +7 -1
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \ # We need gnugrep (for -I) DEPENDS = "virtual/db grep-native" DEPENDS += "gdbm zlib" -PR = "r0" +PR = "r1" # 5.10.1 has Module::Build built-in PROVIDES += "libmodule-build-perl"
@@ -210,6 +210,11 @@ do_install() { } +do_install_append_class-nativesdk () { + create_wrapper ${D}${bindir}/perl \ + PERL5LIB='$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/${PV}' +} + PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess" perl_package_preprocess () {
@@ -247,6 +252,7 @@ FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \ ${libdir}/perl/${PV}/warnings \ ${libdir}/perl/${PV}/vars.pm \ " +FILES_${PN}_append_class-nativesdk = " ${bindir}/perl.real" RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \ perl-module-warnings-register" FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
Signature · 1 line
1.7.10.4
PATCH 2/2 populate_sdk_base.bbclass:fix toolchain relocation issues
In reply to Hongxu JiaWhen 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.
[YOCTO #3338]
--- meta/classes/populate_sdk_base.bbclass | 7 +++++++ 1 file changed, 7 insertions(+)
meta/classes/populate_sdk_base.bbclass +7 -0
@@ -274,6 +274,13 @@ fi # replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc $SUDO_EXEC find $native_sysroot -type f -exec file '{}' \;|grep ":.*\(ASCII\|script\|source\).*text"|cut -d':' -f1|$SUDO_EXEC xargs sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" +# find out all perl scripts in $native_sysroot and modify them replacing the +# host perl with SDK perl. +for perl_script in $($SUDO_EXEC grep "^#!.*perl" -rl $native_sysroot); do + $SUDO_EXEC sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \ + "s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script +done + # 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
Signature · 1 line
1.7.10.4