Cross-compiling Eglibc library with Linaro toolchain
michael.hope at linaro.org
Tue Jan 17 21:29:49 UTC 2012
On Wed, Jan 18, 2012 at 8:25 AM, Michael Hope <michael.hope at linaro.org> wrote:
> On Wed, Jan 18, 2012 at 1:22 AM, Amber Graner <amber.graner at linaro.org> wrote:
>> Hi all,
>> In my search for Linaro related news this morning, I saw a tweet from
>> Linuxquestions.org referencing a cross-compiling questions.
>> Here is the link to the post on Linuxquestions.org
>> - http://www.linuxquestions.org/questions/linux-embedded-78/cross-compiling-eglibc-with-linaro-toolchain-924192/
>> Thanks, I'll answer from the Linaro Tweeter account that it's been past to
>> the Linaro Developers.
> Hi Amber. Could you bounce them to ask.linaro.org or (even better)
> this list in the future? Note that how to build EGLIBC using our
> toolchain is fairly far removed from what we do as it's a building
> question, on a package that people hardly ever build, and one that
> needs care so that you don't toast your system.
Here's the command line we use in our automatic test builds:
../configure --host=arm-linux-gnueabi --prefix=$PWD/install --without-cvs \
--enable-add-ons=libidn,ports,nptl --enable-profile --without-selinux
This is based on the standard Ubuntu/Debian configuration and uses the
binary compiler, assembler, linker, and headers that come with the
packages you've already installed.
If you have unexpected build problems, try adding a
`-fno-stack-protector -U_FORTIFY_SOURCE` to the cflags. Some core
packages like EGLIBC don't like how Ubuntu turns on the stack
protector and fortify options.
You can use the Ubuntu source packages as a eference for how to
configure a package with a good set of options. For example, to see
how Ubuntu configures EGLIBC you can run:
* apt-get source eglibc
* cd eglibc-...
* dpkg-buildpackage -us -uc -d -b
...and look for the 'configure' line in the output. The arguments mean
don't sign the source or changes (-us, -uc), ignore missing build
dependencies (-d as we're only interested in the configure line), and
build a binary (-b).
If you want to see what's installed and where the files ended up, try:
* dpkg -l *armel* *gnueabi*
* dpkg -L package-name
I used this to find the existing Linux headers. The dpkg -l search
showed that linux-libc-dev-armel was installed, and dpkg -L
linux-libc-dev-armel showed that they were installed in
BTW, why are you compiling EGLIBC? It's a pretty core package and not
Matt, could you put this in your toolbox?
More information about the linaro-toolchain