* [Buildroot] fenv.h not found
@ 2013-05-20 16:20 Charles Musser
2013-05-20 18:13 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Charles Musser @ 2013-05-20 16:20 UTC (permalink / raw)
To: buildroot
I had to jump through some hoops to cross-compile the "libsodium" cryptography library using Buildroot (version 2013.02) and I want to know if there's a better way. The build system is x86_64-linux-gnu and the target is mipsel-linux. The compilation failed partway through when one of the source files included <fenv.h> and it couldn't be found.
libsodium's compilation is managed with GNU autoconf, and I configured it as follows. Note that the "${BR}" in the examples below is a stand in for the Buildroot root directory, in order to make the paths clearer.:
./configure --host mipsel-linux --prefix ${BR}/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/ CFLAGS="-std=c99"
I found the fenv.h files here:
${BR}/output/toolchain/uClibc-0.9.33.2/include/fenv.h
${BR}/output/toolchain/uClibc-0.9.33.2/include/bits/fenv.h
But the compiler (or preprocessor) expected them in these locations:
${BR}/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include/fenv.h
${BR}/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/fenv.h
Copying the two files from the "toolchain" area to the "sysroot" area allowed the compilation to succeed, but this doesn't seem like the
right way to get things to work. I'm not sure I understand the distinction between the two areas. The include directories have similar, but not identical, sets of files. Is there a technique that obviates the need to manually copy files around in the Buildroot installation?
Thanks,
Chuck
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Buildroot] fenv.h not found
2013-05-20 16:20 [Buildroot] fenv.h not found Charles Musser
@ 2013-05-20 18:13 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2013-05-20 18:13 UTC (permalink / raw)
To: buildroot
Dear Charles Musser,
On Mon, 20 May 2013 09:20:25 -0700, Charles Musser wrote:
> I had to jump through some hoops to cross-compile the "libsodium"
> cryptography library using Buildroot (version 2013.02) and I want to
> know if there's a better way. The build system is x86_64-linux-gnu
> and the target is mipsel-linux. The compilation failed partway
> through when one of the source files included <fenv.h> and it
> couldn't be found.
>
> libsodium's compilation is managed with GNU autoconf, and I
> configured it as follows. Note that the "${BR}" in the examples below
> is a stand in for the Buildroot root directory, in order to make the
> paths clearer.:
>
> ./configure --host mipsel-linux --prefix
> ${BR}/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/
> CFLAGS="-std=c99"
You should rather create a Buildroot package for it. It will make the
cross-compilation process easier.
> I found the fenv.h files here:
>
> ${BR}/output/toolchain/uClibc-0.9.33.2/include/fenv.h
> ${BR}/output/toolchain/uClibc-0.9.33.2/include/bits/fenv.h
>
> But the compiler (or preprocessor) expected them in these locations:
>
> ${BR}/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include/fenv.h
> ${BR}/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/fenv.h
>
> Copying the two files from the "toolchain" area to the "sysroot" area
> allowed the compilation to succeed, but this doesn't seem like the
> right way to get things to work. I'm not sure I understand the
> distinction between the two areas. The include directories have
> similar, but not identical, sets of files. Is there a technique that
> obviates the need to manually copy files around in the Buildroot
> installation?
As you guessed, doing this copy is really wrong.
${BR}/output/toolchain/uClibc-0.9.33.2/ contains the source code of
uClibc. If it hasn't installed fenv.h into the sysroot folder, it's for
a good reason: you haven't enabled fenv support in uClibc. So, while
copying the header manually makes the build "work", it will miserably
fail at runtime.
Instead, you should enable fenv support. To do so:
make clean
make uclibc-menuconfig
# enable fenv support in uClibc configuration
make
The fenv support is not enabled in our default uClibc configurations,
that why you have to enable it manually:
toolchain/uClibc/uClibc-0.9.31.config:# UCLIBC_HAS_FENV is not set
toolchain/uClibc/uClibc-0.9.32.config:# UCLIBC_HAS_FENV is not set
toolchain/uClibc/uClibc-0.9.33.config:# UCLIBC_HAS_FENV is not set
toolchain/uClibc/uClibc-snapshot.config:# UCLIBC_HAS_FENV is not set
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-20 18:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-20 16:20 [Buildroot] fenv.h not found Charles Musser
2013-05-20 18:13 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox