On Wed, Jan 18, 2012 at 7:28 PM, shyamalan sivan shyamalan123@gmail.com wrote:
Hello experts,
I don't know whether this is the place to ask this question.Please forgive if i am wrong.
I am trying to cross-compile Eglibc,(which i thought is similar to the glibc) library with Linaro tool chain.My aim is to cross-compile the library and add it with the tool-chain( i assumed that Linaro doesn't ahve the eglibc libraries by itself).
Yip, we include EGLIBC as part of the cross compiler. This is the same EGLIBC that runs on the target. .
I referred to the link http://www.eglibc.org/archives/patches/msg00078.html (README.cross-compiling of the libc) and did the following.
I thought that binutils is not required as the tool chain itself contains the loader, assembler etc.(which are the most important in the binutils).So i skipped that step.(i am not sure whether this is right.please correct me if i am wrong).
I did the below steps as in the above link.
- Copied the Linux Kernel Headers
- EGLIBC Headers and Preliminary Objects
2.1) configuring the Eglibc headers by the below steps.
appan@oplt$ ~/cross_compile_eglibc/ppc/obj/eglibc-headers$ BUILD_CC=gcc CC=/home/appan/cross_compile_eglibc/ppc/tools/bin/arm-linux-gnueabi-gcc CXX=/home/appan/cross_compile_eglibc/ppc/tools/bin/arm-linux-gnueabi-cpp AR=/home/appan/cross_compile_eglibc/ppc/tools/bin/arm-linux-gnueabi-ar RANLIB=/home/appaan/cross_compile_eglibc/ppc/tools/bin/arm-linux-gnueabi-ranlib /home/appan/cross_compile_eglibc/src/libc/configure --prefix=/home/appan/CC_EGLIBC --with-headers=/home/appan/cross_compile_eglibc/ppc/sysroot/usr/include/ --build=i686-pc-linux-gnu --host=arm-unknown-linux-gnu --enable-add-ons --with-tls --with-__thread
2.2) compilation
make install-headers install_root=$sysroot install-bootstrap-headers=yes
But following is the error i get.
/home/appan/cross_compile_eglibc/ppc/obj/eglibc-headers/Versions.v.iT
In file included from <stdin>:1:0: ports/sysdeps/arm/nptl/tls.h:48:3: error: #error "TLS support is required." make[1]: *** No rule to make target `headers_install'. Stop. make[1]: Leaving directory `/home/appan/cross_compile_eglibc/src/libc' make: *** [headers_install] Error 2
I tried googling, but i did not get the solution for this.. please provide me with some suggestions and that will be of great help to me...
Here's the command line we use in our automatic test builds:
Code:
../configure --host=arm-linux-gnueabi --prefix=$PWD/install --without-cvs \ --enable-add-ons=libidn,ports,nptl --enable-profile --without-selinux --enable-stackguard-randomization \ --enable-kernel=2.6.15 --with-headers=/usr/arm-linux-gnueabi/include
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 /usr/arm-linux-gnueabi/include.
BTW, why are you compiling EGLIBC? It's a pretty core package and not often changed.
-- Michael