Bug 10338 - perl-native embeds host-dependent variables in sysroot
Summary: perl-native embeds host-dependent variables in sysroot
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.2
Hardware: All Multiple
: Medium+ normal
Target Milestone: 2.3 M2
Assignee: Aníbal Limón
QA Contact: David Lopez Barriba
URL: http://errors.yoctoproject.org/Errors...
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-09-28 08:47 UTC by Joshua Lock
Modified: 2017-01-17 14:01 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Lock 2016-09-28 08:47:18 UTC
When building the build-appliance on the autobuilder for current master-next (7acd5a5d2af3ca0becb5360103f930abad6560cb) libxml-parser-perl-native fails in do_compile:

ERROR: libxml-parser-perl-native-2.44-r0 do_compile: oe_runmake failed
ERROR: libxml-parser-perl-native-2.44-r0 do_compile: Function failed: do_compile (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/work/x86_64-linux/libxml-parser-perl-native/2.44-r0/temp/log.do_compile.4709)
ERROR: Logfile of failure stored in: /home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/work/x86_64-linux/libxml-parser-perl-native/2.44-r0/temp/log.do_compile.4709
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 16 PASTHRU_INC=-isystem/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe LD=gcc
| ERROR: oe_runmake failed
| make[1]: Entering directory '/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/work/x86_64-linux/libxml-parser-perl-native/2.44-r0/XML-Parser-2.44/Expat'
| "/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/x86_64-linux/usr/bin/perl-native/perl" "/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/x86_64-linux/usr/lib/perl-native/perl/5.22.1/ExtUtils/xsubpp" -noprototypes -typemap "/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/x86_64-linux/usr/lib/perl-native/perl/5.22.1/ExtUtils/typemap" -typemap "typemap"  Expat.xs > Expat.xsc && mv Expat.xsc Expat.c
| cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
| Running Mkbootstrap for XML::Parser::Expat ()
| cp Parser/Style/Subs.pm blib/lib/XML/Parser/Style/Subs.pm
| cp Parser/Style/Objects.pm blib/lib/XML/Parser/Style/Objects.pm
| cp Parser/Encodings/iso-8859-5.enc blib/lib/XML/Parser/Encodings/iso-8859-5.enc
| cp Parser/Style/Tree.pm blib/lib/XML/Parser/Style/Tree.pm
| cp Parser/Encodings/koi8-r.enc blib/lib/XML/Parser/Encodings/koi8-r.enc
| cp Parser/Encodings/x-sjis-cp932.enc blib/lib/XML/Parser/Encodings/x-sjis-cp932.enc
| cp Parser/Encodings/iso-8859-4.enc blib/lib/XML/Parser/Encodings/iso-8859-4.enc
| cp Parser/Encodings/iso-8859-3.enc blib/lib/XML/Parser/Encodings/iso-8859-3.enc
| cp Parser.pm blib/lib/XML/Parser.pm
| cp Parser/Style/Debug.pm blib/lib/XML/Parser/Style/Debug.pm
| cp Parser/Encodings/euc-kr.enc blib/lib/XML/Parser/Encodings/euc-kr.enc
| cp Parser/Encodings/x-sjis-jdk117.enc blib/lib/XML/Parser/Encodings/x-sjis-jdk117.enc
| cp Parser/Encodings/windows-1251.enc blib/lib/XML/Parser/Encodings/windows-1251.enc
| cp Parser/Encodings/big5.enc blib/lib/XML/Parser/Encodings/big5.enc
| cp Parser/Encodings/iso-8859-9.enc blib/lib/XML/Parser/Encodings/iso-8859-9.enc
| cp Parser/Encodings/iso-8859-2.enc blib/lib/XML/Parser/Encodings/iso-8859-2.enc
| cp Parser/Encodings/windows-1255.enc blib/lib/XML/Parser/Encodings/windows-1255.enc
| cp Parser/LWPExternEnt.pl blib/lib/XML/Parser/LWPExternEnt.pl
| cp Parser/Style/Stream.pm blib/lib/XML/Parser/Style/Stream.pm
| cp Parser/Encodings/ibm866.enc blib/lib/XML/Parser/Encodings/ibm866.enc
| cp Parser/Encodings/windows-1250.enc blib/lib/XML/Parser/Encodings/windows-1250.enc
| cp Parser/Encodings/iso-8859-8.enc blib/lib/XML/Parser/Encodings/iso-8859-8.enc
| cp Parser/Encodings/Japanese_Encodings.msg blib/lib/XML/Parser/Encodings/Japanese_Encodings.msg
| cp Parser/Encodings/x-euc-jp-unicode.enc blib/lib/XML/Parser/Encodings/x-euc-jp-unicode.enc
| cp Parser/Encodings/x-euc-jp-jisx0221.enc blib/lib/XML/Parser/Encodings/x-euc-jp-jisx0221.enc
| cp Parser/Encodings/windows-1252.enc blib/lib/XML/Parser/Encodings/windows-1252.enc
| cp Parser/Encodings/x-sjis-jisx0221.enc blib/lib/XML/Parser/Encodings/x-sjis-jisx0221.enc
| cp Parser/Encodings/x-sjis-unicode.enc blib/lib/XML/Parser/Encodings/x-sjis-unicode.enc
| cp Parser/Encodings/README blib/lib/XML/Parser/Encodings/README
| cp Parser/Encodings/iso-8859-7.enc blib/lib/XML/Parser/Encodings/iso-8859-7.enc
| chmod 644 "Expat.bs"
| gcc  -c -isystem/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/x86_64-linux/usr/include -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.44\" -DXS_VERSION=\"2.44\" -fPIC "-I/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/x86_64-linux/usr/lib/perl-native/perl/5.22.1/CORE"   Expat.c
| gcc: error: unrecognized command line option ‘-fstack-protector-strong’
| Makefile:323: recipe for target 'Expat.o' failed
| make[1]: *** [Expat.o] Error 1
| make[1]: Leaving directory '/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/work/x86_64-linux/libxml-parser-perl-native/2.44-r0/XML-Parser-2.44/Expat'
| Makefile:594: recipe for target 'subdirs' failed
| make: *** [subdirs] Error 2
| WARNING: /home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/work/x86_64-linux/libxml-parser-perl-native/2.44-r0/temp/run.do_compile.4709:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/work/x86_64-linux/libxml-parser-perl-native/2.44-r0/temp/log.do_compile.4709)
NOTE: recipe libxml-parser-perl-native-2.44-r0: task do_compile: Failed
ERROR: Task (virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb:do_compile) failed with exit code '1'
Comment 1 Ross Burton 2016-09-28 11:54:10 UTC
So what happens here is that perl-native compiles on a machine with a host GCC that supports -fstack-protector=strong, and it embeds that option into usr/lib/perl-native/perl/config.sh (and more) in the native sysroot.  One of these files is then used by makemaker to determine what options to use when building.  This failure happens if perl-native comes from sstate via a machine which supports -fstack-protector=strong but the machine building say libperl-parser-xml-native has an older GCC release which does not support it.

I guess we should strip these options out post-configure in native builds?

Frantically reassigning to Anibal as he is the perl maintainer.
Comment 2 Aníbal Limón 2016-12-01 16:00:08 UTC
I hit this error on local AB, i will try to fix avoiding usage of -fstack-protector=strong or add a test to review if it's supported.
Comment 3 Aníbal Limón 2016-12-01 16:33:22 UTC
Patch sent for review,

http://lists.openembedded.org/pipermail/openembedded-core/2016-December/129528.html
Comment 4 Aníbal Limón 2016-12-13 17:59:07 UTC
There is other patch that also fixes the problem but currently brokes eSDK so waiting to be merge,

http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128510.html
Comment 5 Aníbal Limón 2017-01-09 16:33:03 UTC
This patch [1] solves the issue because the sstate generated is different in gcc < 4.9 and > 4.9.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c21cec84886d9c70396e9be0ceb9a8ef300b54be