perl: Fix various nativesdk build issues
The config.sh lists -fstack-protector but this isn't in LDFLAGS. This can result in perl compilation failures due to the mismatch. Adding the flag to LDFLAGS solves makes all the flags consistent and avoids build failures from missing symbols.
It was also found that the path substitutions made by the sed statement can conflict with each other and you can end up with $prefix$prefix type expressions in config.sh-X which can break the build in unusual ways. This patch anchors the expressions to ensure only true matches are replaced.
---
meta/recipes-devtools/perl/perl_5.14.2.bb +6 -4
@@ -90,6 +90,8 @@ export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/" # LDFLAGS for shared libraries export LDDLFLAGS = "${LDFLAGS} -shared" +LDFLAGS_append = " -fstack-protector" + # We're almost Debian, aren't we? CFLAGS += "-DDEBIAN"
@@ -148,10 +150,10 @@ do_configure() { -e 's,@ARCH@-thread-multi,,g' \ -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \ -e 's,@STAGINGDIR@,${STAGING_DIR_HOST},g' \ - -e "s%/usr/include%${STAGING_INCDIR}%g" \ - -e 's,/usr/lib/,${libdir}/,g' \ - -e 's,/usr/,${exec_prefix}/,g' \ - -e 's,/perl5,/perl,g' \ + -e "s%\([ \"^\',=]\+\)/usr/include%\1${STAGING_INCDIR}%g" \ + -e "s%\([ \"^\',=]\+\)/usr/lib/%\1${libdir}/%g" \ + -e "s%\([ \"^\',=]\+\)/usr/%\1${exec_prefix}/%g" \ + -e "s%/perl5%/perl%g" \ config.sh-${TARGET_ARCH}-${TARGET_OS} case "${TARGET_ARCH}" in
Op 31 aug. 2012, om 01:36 heeft Richard Purdie <[email protected]> het volgende geschreven:
Quoted 5 lines
The
config.shlists -fstack-protector but this isn't in LDFLAGS. This can result in perl compilation failures due to the mismatch. Adding the flag to LDFLAGS solves makes all the flags consistent and avoids build failures from missing symbols.
Quoted 7 lines
It was also found that the path substitutions made by the sed statement can conflict with each other and you can end up with $prefix$prefix type expressions in config.sh-X which can break the build in unusual ways. This patch anchors the expressions to ensure only true matches are replaced.
Signed-off-by Richard Purdie <[email protected]>
I'm not entirely sure, but since this has a potential impact on the build output, shouldn't there be a PR bump?
Quoted 17 lines
---
meta/recipes-devtools/perl/perl_5.14.2.bb +0
-0@@ -90,6 +90,8 @@ export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/" # LDFLAGS for shared librariesexport LDDLFLAGS = "${LDFLAGS} -shared"
meta/recipes-devtools/perl/perl_5.14.2.bb +2
-0+LDFLAGS_append = " -fstack-protector" +# We're almost Debian, aren't we?
CFLAGS += "-DDEBIAN"meta/recipes-devtools/perl/perl_5.14.2.bb +0
-0@@ -148,10 +150,10 @@ do_configure() { -e 's,@ARCH@-thread-multi,,g' \ -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
meta/recipes-devtools/perl/perl_5.14.2.bb do_configure() { · line 157
Quoted 10 lines
meta/recipes-devtools/perl/perl_5.14.2.bb +4
-4-e 's,@STAGINGDIR@,${STAGING_DIR_HOST},g' \ - -e "s%/usr/include%${STAGING_INCDIR}%g" \ - -e 's,/usr/lib/,${libdir}/,g' \ - -e 's,/usr/,${exec_prefix}/,g' \ - -e 's,/perl5,/perl,g' \ + -e "s%\([ \"^\',=]\+\)/usr/include%\1${STAGING_INCDIR}%g" \ + -e "s%\([ \"^\',=]\+\)/usr/lib/%\1${libdir}/%g" \ + -e "s%\([ \"^\',=]\+\)/usr/%\1${exec_prefix}/%g" \ + -e "s%/perl5%/perl%g" \ config.sh-${TARGET_ARCH}-${TARGET_OS}
Whitespace issue in the first line