Skip to contentSkip to conversation

fix toolchain relocation issues

PATCH In review Hongxu Jia 2 participants 5 messages Mar 6, 2013 – Mar 7, 2013

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover fix toolchain relocation issues

Rebase to danny.

[YOCTO #3984]

The following changes since commit e89f812a0af56beda951c1dce6113a61d6db8cda:

bitbake: knotty.py: fix unknown event bb.event.DiskFull (2013-03-04 10:17:20 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-toolchain-relocation-danny
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-toolchain-relocation-danny

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.2.bb |    8 +++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.10.4
author
#1 lore raw

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 #3984]

---
 meta/recipes-devtools/perl/perl_5.14.2.bb |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/perl/perl_5.14.2.bb +7 -1
index d3f6ffd..e456f31 100644
@@ -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 = "r12"
+PR = "r13"
 
 # 5.10.1 has Module::Build built-in
 PROVIDES += "libmodule-build-perl"
@@ -214,6 +214,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 () {
@@ -245,6 +250,7 @@ perl_package_preprocess () {
 PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
             perl-module-cpan perl-module-cpanplus perl-module-unicore"
 FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV}"
+FILES_${PN}_append_class-nativesdk = " ${bindir}/perl.real"
 FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
 FILES_${PN}-lib = "${libdir}/libperl.so* \
                    ${libdir}/perl5 \
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 2/2 populate_sdk_base.bbclass:fix toolchain relocation issues

In reply to Hongxu Jia

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.

[YOCTO #3984]

---
 meta/classes/populate_sdk_base.bbclass |    7 +++++++
 1 file changed, 7 insertions(+)
meta/classes/populate_sdk_base.bbclass +7 -0
index 6eb6726..6a34e58 100644
@@ -174,6 +174,13 @@ fi
 # replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc
 find $native_sysroot -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':' -f1|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 $(grep "^#!.*perl" -rl $native_sysroot); do
+	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 $(find $native_sysroot -type l); do
 	ln -sf $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
Signature · 1 line
1.7.10.4
#3 lore raw
In reply to Hongxu Jia

Hi Hongxu,

Quoted 8 lines · Hongxu Jia

Rebase to danny.

[YOCTO #3984]

The following changes since commit e89f812a0af56beda951c1dce6113a61d6db8cda:

bitbake: knotty.py: fix unknown event bb.event.DiskFull (2013-03-04 10:17:20 +0000)

Quoted 9 lines

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-toolchain-relocation-danny
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-toolchain-relocation-danny

Hongxu Jia (2):
perl-nativesdk:fix toolchain relocation issues populate_sdk_base.bbclass:fix toolchain relocation issues

while at it, may you please also cherry-pick e7a21cd69a326ab7e2d0e410db28f24956f61208
which is "toolchain-scripts.bbclass: add PYTHONHOME variable to environment-setup"

as the problem described in [YOCTO #3839] is also present in danny.

Thanks
Eric

author
#4 lore raw
Quoted 27 lines · Eric Bénard

Hi Hongxu,

Quoted 8 lines · Hongxu Jia

Rebase to danny.

[YOCTO #3984]

The following changes since commit e89f812a0af56beda951c1dce6113a61d6db8cda:

   bitbake: knotty.py: fix unknown event bb.event.DiskFull (2013-03-04 10:17:20 +0000)
Quoted 9 lines

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-toolchain-relocation-danny
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-toolchain-relocation-danny

Hongxu Jia (2):
perl-nativesdk:fix toolchain relocation issues populate_sdk_base.bbclass:fix toolchain relocation issues

while at it, may you please also cherry-pick e7a21cd69a326ab7e2d0e410db28f24956f61208
which is "toolchain-scripts.bbclass: add PYTHONHOME variable to environment-setup"

Quoted 4 lines

as the problem described in [YOCTO #3839] is also present in danny.

Thanks
Eric

Ok, I will handle it and resend the patch later.

Thanks,
Hongxu