Bug 5221 - [autobuilder] perf build failures on meta-fsl-ppc
Summary: [autobuilder] perf build failures on meta-fsl-ppc
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.5
Hardware: x86 Multiple
: High critical
Target Milestone: 1.5 M5
Assignee: Otavio Salvador
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-09-17 23:51 UTC by Saul Wold
Modified: 2013-09-19 15:38 UTC (History)
5 users (show)

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


Attachments
Disable libpython (1.91 KB, patch)
2013-09-18 04:14 UTC, Otavio Salvador
no flags Details | Diff
Proposed patch (1.41 KB, patch)
2013-09-18 12:39 UTC, Otavio Salvador
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saul Wold 2013-09-17 23:51:17 UTC
This is an RC2 Blocker

 /srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/sysroots/x86_64-linux/usr/libexec/ppce500v2-poky-linux-gnuspe/gcc/powerpc-poky-linux-gnuspe/4.8.1/ld: /srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/sysroots/p1022ds/usr/lib/python2.7/config/libpython2.7.a(dynload_shlib.o): undefined reference to symbol 'dlopen@@GLIBC_2.1'
| /srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/sysroots/x86_64-linux/usr/libexec/ppce500v2-poky-linux-gnuspe/gcc/powerpc-poky-linux-gnuspe/4.8.1/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/sysroots/p1022ds/usr/lib/libdl.so so try adding it to the linker command line
| /srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/sysroots/p1022ds/usr/lib/libdl.so: could not read symbols: Invalid operation
| collect2: error: ld returned 1 exit status
| make: *** [/srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/work/p1022ds-poky-linux-gnuspe/perf/1.0-r8/perf-1.0/perf] Error 1
| make: Leaving directory `/srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/sysroots/p1022ds/usr/src/kernel/tools/perf'
| ERROR: oe_runmake failed
| WARNING: /srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/work/p1022ds-poky-linux-gnuspe/perf/1.0-r8/temp/run.do_compile.26959:1 exit 1 from
| exit 1
| ERROR: Function failed: do_compile (log file is located at /srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/build/tmp/work/p1022ds-poky-linux-gnuspe/perf/1.0-r8/temp/log.do_compile.26959)
ERROR: Task 2965 (/srv/home/pokybuild/yocto-autobuilder-new/yocto-slave/nightly-fsl-ppc/build/meta/recipes-kernel/perf/perf.bb, do_compile) failed with exit code '1'
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
Comment 1 Otavio Salvador 2013-09-18 04:14:32 UTC
Created attachment 1515 [details]
Disable libpython
Comment 2 Otavio Salvador 2013-09-18 04:15:45 UTC
It seems this has been done at:

commit d38ad3271829b2d282c973e69edd265ef52174c8
Author: Tom Zanussi <tom.zanussi@intel.com>
Date:   Fri Jan 14 16:33:05 2011 -0600

    linux-yocto: hard-code NO_LIBPERL/NO_LIBPYTHON
    
    ExtUtils::Embed ccopts is getting the host's -I/usr/local/include and
    using it to compile perf, which results in a compilation error that
    started appearing just recently.
    
    This turns the code that makes use of ExtUtils::Embed off and simply
    hard-codes NO_LIBPERL.
    
    It does the same for LIBPYTHON while we're at it, since it probably
    suffers from a similar underlying problem and just by chance hasn't
    broken anything yet.
    
    This will be re-enabled after I familiarize myself with the perf
    recipe and am able to create a proper fix.
    
    Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>

So this fix should be add in meta-fsl-ppc as well?
Comment 3 Zhenhua Luo 2013-09-18 05:16:17 UTC
Perf can be built successfully after disabling LIBPERL and LIBPYTHON, a patch will be submitted for meta-fsl-ppc.
Comment 4 Bruce Ashfield 2013-09-18 05:20:42 UTC
My suggestion is to hit the middle ground, I unfortunately can't test from
here, since fetches are failing and I need to see what's wrong with my
name resolution in the morning.

What I mean is that I have a patch, I'm about to send that does this:

--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -68,6 +68,7 @@ EXTRA_OEMAKE = \
                CC="${CC}" \
                AR="${AR}" \
                perfexecdir=${libexecdir} \
+               EXTRA_CFLAGS="-fno-var-tracking" \
                NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \

To fix build time issues with arm (and even x86), part of the patch 
that we recently did removes the full export of CFLAGS and LDFLAGS
to the perf build, and that's a good thing in my opinion.

But we don't want to fix this by patching the kernel, since that means all
kernel repos need to carry the fix, so my suggestion is to pass what we
used to have: 

  LDFLAGS = "-ldl -lutil"

or at least the -ldl, which is what is missing, to the build via 
EXTRA_CFLAGS, that way we are only extending, not overriding what
the makefiles are defining.
Comment 5 Zhenhua Luo 2013-09-18 05:51:39 UTC
(In reply to comment #4)
> My suggestion is to hit the middle ground, I unfortunately can't test from
> here, since fetches are failing and I need to see what's wrong with my
> name resolution in the morning.
> 
> What I mean is that I have a patch, I'm about to send that does this:
> 
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -68,6 +68,7 @@ EXTRA_OEMAKE = \
>                 CC="${CC}" \
>                 AR="${AR}" \
>                 perfexecdir=${libexecdir} \
> +               EXTRA_CFLAGS="-fno-var-tracking" \
>                 NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \
> 
> To fix build time issues with arm (and even x86), part of the patch 
> that we recently did removes the full export of CFLAGS and LDFLAGS
> to the perf build, and that's a good thing in my opinion.
> 
> But we don't want to fix this by patching the kernel, since that means all
> kernel repos need to carry the fix, so my suggestion is to pass what we
> used to have: 
> 
>   LDFLAGS = "-ldl -lutil"
> 
> or at least the -ldl, which is what is missing, to the build via 
> EXTRA_CFLAGS, that way we are only extending, not overriding what
> the makefiles are defining.

The suggestion makes sense, we can avoid applying the kernel patch in all kernel repos. 

According to my test result on p1022ds, both -ldl and -lutil are required to ensure the build pass. 

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 4a815ff..0ceccc4 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -68,6 +68,7 @@ EXTRA_OEMAKE = \
        CC="${CC}" \
        AR="${AR}" \
        perfexecdir=${libexecdir} \
+        EXTRA_CFLAGS="-fno-var-tracking" \
        NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \
        '

@@ -86,15 +87,17 @@ EXTRA_OEMAKE += "\

 PARALLEL_MAKE = ""

+LDFLAGS="-ldl -lutil"
+
 do_compile() {
    # Linux kernel build system is expected to do the right thing
-   unset CFLAGS LDFLAGS
+   unset CFLAGS
    oe_runmake all
 }

 do_install() {
    # Linux kernel build system is expected to do the right thing
-   unset CFLAGS LDFLAGS
+   unset CFLAGS
    oe_runmake DESTDIR=${D} install
    # we are checking for this make target to be compatible with older perf versions
    if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" -a $(grep install-python_ext ${S}/tools/perf/Makefile) = "0"]; then
Comment 6 Bruce Ashfield 2013-09-18 12:34:58 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > My suggestion is to hit the middle ground, I unfortunately can't test from
> > here, since fetches are failing and I need to see what's wrong with my
> > name resolution in the morning.
> > 
> > What I mean is that I have a patch, I'm about to send that does this:
> > 
> > --- a/meta/recipes-kernel/perf/perf.bb
> > +++ b/meta/recipes-kernel/perf/perf.bb
> > @@ -68,6 +68,7 @@ EXTRA_OEMAKE = \
> >                 CC="${CC}" \
> >                 AR="${AR}" \
> >                 perfexecdir=${libexecdir} \
> > +               EXTRA_CFLAGS="-fno-var-tracking" \
> >                 NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \
> > 
> > To fix build time issues with arm (and even x86), part of the patch 
> > that we recently did removes the full export of CFLAGS and LDFLAGS
> > to the perf build, and that's a good thing in my opinion.
> > 
> > But we don't want to fix this by patching the kernel, since that means all
> > kernel repos need to carry the fix, so my suggestion is to pass what we
> > used to have: 
> > 
> >   LDFLAGS = "-ldl -lutil"
> > 
> > or at least the -ldl, which is what is missing, to the build via 
> > EXTRA_CFLAGS, that way we are only extending, not overriding what
> > the makefiles are defining.
> 
> The suggestion makes sense, we can avoid applying the kernel patch in all
> kernel repos. 
> 
> According to my test result on p1022ds, both -ldl and -lutil are required to
> ensure the build pass. 
> 
> diff --git a/meta/recipes-kernel/perf/perf.bb
> b/meta/recipes-kernel/perf/perf.bb
> index 4a815ff..0ceccc4 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -68,6 +68,7 @@ EXTRA_OEMAKE = \
>         CC="${CC}" \
>         AR="${AR}" \
>         perfexecdir=${libexecdir} \
> +        EXTRA_CFLAGS="-fno-var-tracking" \
>         NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \
>         '
> 
> @@ -86,15 +87,17 @@ EXTRA_OEMAKE += "\
> 
>  PARALLEL_MAKE = ""
> 
> +LDFLAGS="-ldl -lutil"
> +
>  do_compile() {
>     # Linux kernel build system is expected to do the right thing
> -   unset CFLAGS LDFLAGS
> +   unset CFLAGS
>     oe_runmake all
>  }
> 
>  do_install() {
>     # Linux kernel build system is expected to do the right thing
> -   unset CFLAGS LDFLAGS
> +   unset CFLAGS
>     oe_runmake DESTDIR=${D} install
>     # we are checking for this make target to be compatible with older perf
> versions
>     if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" -a
> $(grep install-python_ext ${S}/tools/perf/Makefile) = "0"]; then


Great news. Thanks for the update and testing.

Otavio, can you confirm if your build continues to work with the changes listed above ?
Comment 7 Otavio Salvador 2013-09-18 12:39:01 UTC
Created attachment 1517 [details]
Proposed patch
Comment 8 Otavio Salvador 2013-09-18 12:55:10 UTC
Bruce found that we don't have EXTRA_LDFLAGS (as it would be expected) so I went and prepared a patch to re-add LDFLAGS and included a comment in the code so someone looking at it knows why it is there.

I am building it using 3.11 and if it works will send the patch.
Comment 9 Otavio Salvador 2013-09-18 13:52:07 UTC
I built it fine in imx23evk (with 3.11 kernel). I sent it to OE-Core for review.