Bug 8011

Summary: When building only busybox and strace, strace fails on not finding bluetooth/bluetooth.h
Product: buildroot Reporter: Jaap Crezee <jaap>
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: minor CC: buildroot, yann.morin.1998
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: my configuration failing with busybox & strace
ct-ng toolchain configuration

Description Jaap Crezee 2015-04-11 15:09:36 UTC
When I am building a (very small cpio initramfs) buildroot configuration, strace fails if only busybox & strace are build.
Probably strace configure see my system bluetooth/bluetooth.h which is not present in sysroot.
Comment 1 Thomas Petazzoni 2015-04-11 16:01:38 UTC
Could you please indicate the Buildroot version you're using, and attach a minimal Buildroot .config that exhibits the problem?

I'm routinely building system with just Busybox and strace, and it just works fine for me, so there is probably something special in the configuration you're using.
Comment 2 Jaap Crezee 2015-04-11 16:09:11 UTC
Created attachment 5986 [details]
my configuration failing with busybox & strace
Comment 3 Jaap Crezee 2015-04-11 16:09:43 UTC
using buildroot from git merged today, commit id 53903a1520420ae92fc1a9b4ffa6df8efff266f4
Comment 4 Thomas Petazzoni 2015-04-11 17:27:49 UTC
You're using a custom external toolchain:

BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/cross/quark/toolchain"

So it's most likely this toolchain that is broken. Is this toolchain available somewhere?
Comment 5 Jaap Crezee 2015-04-11 18:40:50 UTC
Created attachment 5991 [details]
ct-ng toolchain configuration

I am using my own ct-ng build toolchain. See other comment.
Comment 6 Jaap Crezee 2015-04-11 18:44:00 UTC
We are working with an Intel Galileo gen2 board.
Intel states you should use Yocto.
The reason we are all still here (probably) is because we do NOT like Yocto, or at least I do not like it. I think it is way to bloated.
Because I could not find a suitable toolchain, I built one myself.

My guess would be that it is not the toolchain which is broken, it has no header files whatsoever regarding any bluetooth headers.

I am using the same toolchain for a "full-blown" rootfs (the one from this bug is only for initramfs); it works quite well there. But in that case I also enabled bluez5....
Comment 7 Yann E. MORIN 2015-04-11 21:03:43 UTC
So, I've tried to reproduce this here. Here's my defconfig:

    BR2_x86_64=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_PACKAGE_STRACE=y

Also, I do have bluetooth devel files installed on my host system:

    $ ls -l /usr/include/bluetooth/bluetooth.h
    -rw-r--r-- 1 root root 7588 Jan 28 22:19 /usr/include/bluetooth/bluetooth.h

But it is not present in the sysroot:

    $ find staging/ -name bluetooth.h
    [nothing]

And strace's log is like:

    checking bluetooth/bluetooth.h usability... no
    checking bluetooth/bluetooth.h presence... no
    checking for bluetooth/bluetooth.h... no

Can you try to reproduce from a clean environment?
Comment 8 Jaap Crezee 2015-04-12 12:06:46 UTC
Okay, I checked the build output:

<snip>
checking bluetooth/bluetooth.h usability... yes
checking bluetooth/bluetooth.h presence... no
configure: WARNING: bluetooth/bluetooth.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: bluetooth/bluetooth.h: proceeding with the compiler's result
checking for bluetooth/bluetooth.h... yes
</snip>

Any clue if I should look into the toolchain?

I might also try the buildroot toolchain generator once more later today. I could also build that once, store it in /opt/cross/ .. and just use that from buildroot, just like my current toolchain.
Comment 9 Yann E. MORIN 2015-04-12 12:15:45 UTC
Can you look at config.log in the strace build dir and see what
commands are run when checking for bluetooth.h ?
Comment 10 Jaap Crezee 2015-04-12 12:25:16 UTC
My strace/config.log

<snip>
configure:7337: checking bluetooth/bluetooth.h usability
configure:7337: /data/work/zupr/ZUPR-Embedded-Buildroot_initramfs/output/host/usr/bin/ccache /data/work/zupr/ZUPR-Embedded-Buildroot_initramfs/output/host/usr/bin/i586-unknown-linux-gnu-gcc -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c >&5
conftest.c:89:33: fatal error: bluetooth/bluetooth.h: No such file or directory
 #include <bluetooth/bluetooth.h>
                                 ^
compilation terminated.
configure:7337: $? = 1
</snip>

Seems rather normal. But, wait, I just did change two things:
- change default rootpw to ""
- did a make distclean

Now it seems to work as expected.

Could it have something to do with the above? Most likely number 2, I do not think changing a root pwd wil effect something like this.
Or maybe it is ccache ?
Comment 11 Yann E. MORIN 2015-04-12 12:46:11 UTC
It seems you did not start from a clean directory (e.g. you only
removed target/ or some such).

Buildroot does not try to track changes in the configuration, so
sometimes it is needed to clean the build directory and restart
from scratch.

Please have a look at the manual:
    http://buildroot.net/downloads/manual/manual.html#full-rebuild

and see if you where in a case explained there.

See also:
    http://buildroot.net/downloads/manual/manual.html#faq-no-binary-packages

which has a good explanation about (not) removing packages and
(not) tracking configuration changes.
Comment 12 Jaap Crezee 2015-04-17 13:02:57 UTC
I think it was my badness after all. I cloned the buildroot git archive and put several branches in it from which I develop my various images. Sometimes I git checkout <other_branch> and forget to do a make clean.
I changed my method of working to cloning the archive in multiple directories en never do git checkout <other_branch> in those directories.
It seems to work as expected now.

Closing the issue.