Re: Cross-compile error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



6.1.2013 1:39, Brandon Falk kirjoitti:

GL_BUILD  = x86_64-linux-gnu
GL_HOST   = x86_64-linux-gnu
GL_TARGET = arm-linux-androideabi

Configure:

PROJ_CFG      = --build=$(GL_BUILD) --host=$(GL_HOST) --target=$(GL_TARGET) \
                 --enable-languages=c,c++ --prefix=/usr

I'm getting the error:

In file included from
../../../../../../../srcs/gcc/gcc-4.7.2/libgcc/gthr.h:150:0,
                  from
../../../../../../../srcs/gcc/gcc-4.7.2/libgcc/emutls.c:31:
./gthr-default.h:41:21: fatal error: pthread.h: No such file or directory

If it can't find pthread.h, then I'm assuming there is some issue with
glibc... but how could I possibly build glibc without gcc in the first
place?


You have misunderstood something... Android has it's own prebuilt C library or variations of it for different Android releases and CPU types, the prebuilt GCC from Google I have :

gcc version 4.6.x-google 20120106 (prerelease) (GCC)

used the '--with-float=soft --with-fpu=vfp --with-arch=armv5te' options in it's configure. I would suggest inspecting what the Android NDK has before trying to build one's own GCCs.

The Android NDK C library I used during the GCC (4.6.3 and 4.7.2) builds had as the library
binaries :

[root@HP-Pavilion lib]# pwd
/opt/host-arm-linux-androideabi/usr/lib
[root@HP-Pavilion lib]# ls -l
yhteensä 4432
-rw-r-----. 1 124982 5000    2158  3.7.2012 crtbegin_dynamic.o
-rw-r-----. 1 124982 5000    1608  3.7.2012 crtbegin_so.o
-rw-r-----. 1 124982 5000    1804  3.7.2012 crtbegin_static.o
-rw-r-----. 1 124982 5000     972  3.7.2012 crtend_android.o
-rw-r-----. 1 124982 5000     796  3.7.2012 crtend_so.o
-rwxr-x---. 1 124982 5000   43947  3.7.2012 libandroid.so
-rw-r-----. 1 124982 5000 3093736 24.6.2012 libc.a
-rwxr-x---. 1 124982 5000   98693  3.7.2012 libc.so
-rwxr-x---. 1 124982 5000    5353  3.7.2012 libdl.so
-rwxr-x---. 1 124982 5000    6503  3.7.2012 libEGL.so
-rwxr-x---. 1 124982 5000   45527  3.7.2012 libGLESv1_CM.so
-rwxr-x---. 1 124982 5000   43919  3.7.2012 libGLESv2.so
-rwxr-x---. 1 124982 5000    5322  3.7.2012 libjnigraphics.so
-rwxr-x---. 1 124982 5000    5465  3.7.2012 liblog.so
-rw-r-----. 1 124982 5000  996072 24.6.2012 libm.a
-rwxr-x---. 1 124982 5000   42249  3.7.2012 libm.so
-rwxr-x---. 1 124982 5000    6941  3.7.2012 libOpenMAXAL.so
-rwxr-x---. 1 124982 5000    7178  3.7.2012 libOpenSLES.so
-rw-r-----. 1 124982 5000   28564 24.6.2012 libstdc++.a
-rwxr-x---. 1 124982 5000    6117  3.7.2012 libstdc++.so
-rwxr-x---. 1 124982 5000    5534  3.7.2012 libthread_db.so
-rwxr-x---. 1 124982 5000   40027  3.7.2012 libz.so

and using these plus the 'usr/include' parts let both gcc-4.6.3 and 4.7.2 be built without
any problems...

I cannot see what sanity is with trying to replace the Google-built official C libraries, in both the crosstoolchain and on the Android target platforms like those cellphones...
Assuming that all those '.so' files are installed on them.

So building the crosstoolchains fully normally via producing only the self-made binutils, GCCs and GDBs and using the pre-made target libraries is the expected method in
this issue...

Ok, here is how the Android NDK GCC was configured :

Configured with: /usr/local/google/home/andrewhsieh/ndk-andrewhsieh/src/build/../gcc/gcc-4.6/configure --prefix=/tmp/ndk-andrewhsieh/build/toolchain/prefix --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-mpfr=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --with-mpc=/tmp/ndk-andrewhsieh/build/toolchain/temp-install --without-ppl --without-cloog --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-initfini-array --disable-nls --prefix=/tmp/ndk-andrewhsieh/build/toolchain/prefix --with-sysroot=/tmp/ndk-andrewhsieh/build/toolchain/prefix/sysroot --with-binutils-version=2.21 --with-mpfr-version=2.4.1 --with-mpc-version=0.8.1 --with-gmp-version=5.0.5 --with-gcc-version=4.6 --with-gdb-version=7.3.x --disable-bootstrap --disable-libquadmath --disable-plugin --enable-gold --enable-ld=default --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold

Not that tidy so one might try something more simple :-)

[root@HP-Pavilion bin]# arm-linux-androideabi-gcc-4.7 -v
Using built-in specs.
COLLECT_GCC=arm-linux-androideabi-gcc-4.7
COLLECT_LTO_WRAPPER=/media/2c439158-ef3e-4dcf-a63b-03191c302829/opt/cross/bin/../lib/gcc/arm-linux-androideabi/4.7.2/lto-wrapper
Target: arm-linux-androideabi
Configured with: ../configure --build=i686-linux-gnu --host=i686-linux-gnu --target=arm-linux-androideabi --prefix=/opt/cross --libdir=/opt/cross/lib --libexecdir=/opt/cross/lib --with-sysroot=/opt/host-arm-linux-androideabi --with-gxx-include-dir=/opt/cross/include/c++/4.7.2 --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-threads --enable-languages=c,c++ --enable-target-optspace --enable-initfini-array --enable-gold --enable-ld=default --enable-version-specific-runtime-libs --with-system-zlib --without-ppl --without-cloog --disable-nls --disable-plugin --disable-shared --disable-tls --disable-sjlj-exceptions --disable-libssp --disable-libmudflap --disable-libgomp --disable-libquadmath --disable-libstdc__-v3 --disable-libitm --program-prefix=arm-linux-androideabi- --program-suffix=-4.7
Thread model: posix
gcc version 4.7.2 (by Kai Ruottu)



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux