Bug 994 - Fix host infection in compile_perf
Summary: Fix host infection in compile_perf
Status: VERIFIED FIXED
Alias: None
Product: Kernel
Classification: Yocto Project Subprojects
Component: kernel-tooling (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: High major
Target Milestone: 1.1
Assignee: Tom Zanussi
QA Contact:
URL:
Whiteboard: Saul and Tom working, testing Tom's p...
Depends on:
Blocks:
 
Reported: 2011-04-17 21:28 UTC by Saul Wold
Modified: 2011-07-22 11:32 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saul Wold 2011-04-17 21:28:52 UTC
There is host infection with the usage of /usr/include/slang and /usr/include/elfutils.
Comment 1 Tom Zanussi 2011-04-17 22:01:52 UTC
Can you add slightly more detail about how to reproduce, as I am not seeing this in my builds.
Comment 2 Saul Wold 2011-04-18 08:45:59 UTC
do a bitbake -k world, or build the newt and slag packages.
Comment 3 Darren Hart 2011-04-18 09:50:02 UTC
Assigning to Tom as it's "tracing".
Comment 4 Tom Zanussi 2011-04-18 14:05:11 UTC
Running 'bitbake libnewt' produces the following error:

| NOTE: Checking autotools environment for common misconfiguration
| ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
| Rerun configure task after fixing this. The path was '/usr/local/test/intel-bsp/build/tmp/work/atom-poky-linux/slang-2.2.4-r5/slang-2.2.4'
| ERROR: Function 'do_qa_configure' failed
NOTE: package slang-2.2.4-r5: task do_configure: Failed
ERROR: Task 210 (/usr/local/test/intel-bsp/meta/recipes-extended/slang/slang_2.2.4.bb, do_configure) failed with exit code '1'
Waiting for 2 active tasks to finish:
0: gettext-0.17-r5 do_configure (pid 9910)
1: eglibc-2.12-r13 do_package (pid 4698)
Waiting for 1 active tasks to finish:
0: eglibc-2.12-r13 do_package (pid 4698)
NOTE: package gettext-0.17-r5: task do_configure: Succeeded
NOTE: package eglibc-2.12-r13: task do_package: Succeeded
ERROR: '/usr/local/test/intel-bsp/meta/recipes-extended/slang/slang_2.2.4.bb' failed

The cause of the failure is the use of /usr/lib:

/usr/local/test/intel-bsp/build/tmp/sysroots/x86_64-linux/usr/libexec/atom-poky-linux/gcc/i586-poky-linux/4.5.1/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation

libnewt DEPENDS on slang and recipes-extended/chkconfig/chkconfig_1.3.51.bb depends on libnewt.
Comment 5 Tom Zanussi 2011-04-18 23:20:41 UTC
I tried to reproduce this by building the kernel/perf for the sugarbay target, and didn't see the problem.  I also built the kernel/perf for crownbay and ran into the problem of bug #963, but got around that by pointing to a local clone of linux-yocto-2.6.37.  Again, there was no problem with compile_perf and host infection.

As I pointed out after the initial look, there does look like a problem with the perf Makefile hard-coding /usr/include/slang and /usr/include/elfutils, but there's no dependency in the perf recipe on libnewt/slang or elfutils - it skips those and builds without them if not found, and so far that's been the case and so those hard-coded paths haven't come into play.

But it looks like with the recent addition of libnewt, perf sometimes does find the libnewt/slang pulled in by the unrelated chkconfig recipe, and at that point tries to use it, exposing the hard-coded /usr/include/slang.

But since we now have libnewt available in the metadata, perf really should take advantage of it, so the hard-coded path should be fixed regardless, which I'll do.  So I'll try adding the libnewt dependency for per, which should legitimately trigger the problem - I need to be able to trigger it somehow anyway in order to verify the fix.  I'll also try getting perf to use elfutils, which is also available and should be getting used though it hasn't been so far, and is why the other hard-coded patch for elfutils hasn't come into play either.

But note also that the slang recipe that libnewt depends on seems to have unrelated host contamination issues of its own, independent of perf.
Comment 6 Tom Zanussi 2011-04-25 11:14:48 UTC
Fixed by commit:

ee2ff2ab53c4b26462fa2445b34c3ce09684a82c
Comment 8 Saul Wold 2011-07-22 11:32:11 UTC
build works without host infection