Bug 9851 - piglit fails to build on qemux86*
Summary: piglit fails to build on qemux86*
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: graphics (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.2 M4
Assignee: Jussi Kukkonen
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-06-29 15:10 UTC by Martin Jansa
Modified: 2016-09-15 06:36 UTC (History)
5 users (show)

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


Attachments
cmake: Link utils with xcb explicitly (1.63 KB, patch)
2016-07-05 08:20 UTC, Jussi Kukkonen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jansa 2016-06-29 15:10:11 UTC
It might be autodetecting something from host, because it fails for qemux86, but not for qemuarm on the same host.

It was reported multiple times in the status report on oe-core ML, here are latest logs:

http://errors.yoctoproject.org/Errors/Details/69790/
http://errors.yoctoproject.org/Errors/Details/69831/
Comment 1 Jussi Kukkonen 2016-06-30 10:43:46 UTC
It seems libxcb pkg-config now has stricter Requires rules and piglit has been abusing the over-linking that resulted from the more lax rules.

Will fix in my upcoming piglit upgrade branch.
Comment 2 Jussi Kukkonen 2016-07-05 08:20:37 UTC
Created attachment 3269 [details]
cmake: Link utils with xcb explicitly

I just can't reproduce this, which is weird because there's no autodetection tomfoolery that I can see. I've tried building a "qemux86 nodistro piglit" and it builds, whatever I do.

Looking at the linker flags it does seem like a missing "-lxcb", but it's weird that
 a) it links fine here (somewhat surprisingly)
 b) even in the failure logs gcc links fine, only g++ fails

Martin, feel free to test the patch if you have an easy way to do that. Otherwise I guess I'll send this patch and we'll see if it helps in your next build.
Comment 3 Martin Jansa 2016-07-24 12:07:39 UTC
Not the error got different:
| Scanning dependencies of target fbo-drawbuffers-arbfp
| /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc   -march=armv5te -mthumb  --sysroot=/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemuarm -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/jenkins/oe/world/shr-core/tmp-glibc/work/armv5te-oe-linux-gnueabi/piglit/1.0+gitrAUTOINC+c39e41a865-r0=/usr/src/debug/piglit/1.0+gitrAUTOINC+c39e41a865-r0 -fdebug-prefix-map=/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/x86_64-linux= -fdebug-prefix-map=/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemuarm= -Wall -std=gnu99 -Werror=vla -Werror=pointer-arith -Werror=variadic-macros -g  -march=armv5te -mthumb  --sysroot=/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemuarm  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed CMakeFiles/fbo-fragcoord.dir/fbo-fragcoord.c.o  -o ../../../../bin/fbo-fragcoord -rdynamic ../../../../lib/libpiglitutil_gl.so.0 -lGL ../../../../lib/libpiglitutil.so.0 -lrt -lpng -lz -lm -lEGL -lwaffle-1 -lX11 -lGL -Wl,-rpath,/home/jenkins/oe/world/shr-core/tmp-glibc/work/armv5te-oe-linux-gnueabi/piglit/1.0+gitrAUTOINC+c39e41a865-r0/build/lib:
| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to 'dlsym'
| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to 'dlerror'
| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to 'dlopen'
| collect2: error: ld returned 1 exit status
| make[2]: Leaving directory `/home/jenkins/oe/world/shr-core/tmp-glibc/work/armv5te-oe-linux-gnueabi/piglit/1.0+gitrAUTOINC+c39e41a865-r0/build'
| make -f target_api/gl/tests/fbo/CMakeFiles/fbo-drawbuffers-arbfp.dir/build.make target_api/gl/tests/fbo/CMakeFiles/fbo-drawbuffers-arbfp.dir/build

Are you using gold with nodistro? You might need to enable gold in order to reproduce this.
Comment 4 Ross Burton 2016-07-26 16:31:51 UTC
Hopefully fixed in oe-core 913149f269679bda87badb94e1de66646fdc5362.
Comment 5 Jussi Kukkonen 2016-07-26 18:02:04 UTC
Maybe the new failure should be a new bug ... but I'm reopening this based on Martins last comment: that must be with new piglit and won't be fixed with the xcb link patch.

(In reply to comment #3)
> Are you using gold with nodistro? You might need to enable gold in order to
> reproduce this.

This sounds like a really good guess: I wasn't using gold.

I'm now on holiday, back on August 12 or so. Maxin: if you want to try reproducing the build failure with ld-is-gold and then adding "-ldl" to the relevant linker flag, feel free.
Comment 6 Maxin B. John 2016-08-01 14:42:15 UTC
> 
> (In reply to comment #3)
> > Are you using gold with nodistro? You might need to enable gold in order to
> > reproduce this.
> 
> This sounds like a really good guess: I wasn't using gold.
> 
> I'm now on holiday, back on August 12 or so. Maxin: if you want to try
> reproducing the build failure with ld-is-gold and then adding "-ldl" to the
> relevant linker flag, feel free.

Recreated the build error with :
DISTRO_FEATURES_append = " ld-is-gold opengl"
in local.conf

| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to 'dlsym'
| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to 'dlerror'
| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to 'dlopen'
| collect2: error: ld returned 1 exit status

As you have mentioned, this fixes it:
LDFLAGS_append_qemux86 = " ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '-ldl', '', d)}"
Comment 7 Jussi Kukkonen 2016-08-16 08:57:26 UTC
The non-optimal fix was taken into master so builds should no longer break (and so the bugs doesn't really need to be medium+ anymore).


I'll keep the bug open though: LDFLAGS_append is not really the appropriate fix. I'll send a build system patch upstream soon along with the xcb link fix.
Comment 8 Jussi Kukkonen 2016-09-15 06:36:02 UTC
commit 2e8c59d059b21dce23c848e837bd98de5e21dafd
Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date:   Tue Sep 13 11:46:40 2016 +0300

    piglit: Backport linker flag patch
    
    Use the correct build system patch instead of adding linker flags
    in recipe. Also update upstream status for the other build patch.
    
    Fixes [YOCTO #9851].
    
    (From OE-Core rev: cd67959c4794b132cb9fd20a2a37cf862e172bed)