building the android beagle toolchain -- getting around the issues

a number of observations regarding building the android toolchain if
anyone wanted to try that. at the moment, it doesn't build according
to what's in the README, and here's why, and here's how to fix it.
(this will, not surprisingly, go up on my wiki in short order.)

  if you want the official embinux toolchain for android for the
beagle, you can go here:

  http://www.embinux.com/download_toolchain.php

where what you get is a tarball from which you can allegedly *build*
the toolchain. sadly, there are issues, and here's how to deal with
them.

  the README instructs one to use the configuration option
"--target=arm-eabi". however, the configure file itself contains this
snippet regarding gdb:

Robert,

The toolchain you are mentioning is not from embinux. looking at source tar ball name (android-toolchain-20081019.tar.bz2 ), it seems that you have downloaded it from following link.

I will like to clarify that embinux had never released a toolchain for android. And the one released at following link is not meant to compile android build. Regards, Rupesh Gujare Robert P. J. Day wrote:

ok, i stand corrected, but it's certainly confusing to have that
link at embinux's home page, immediately underneath a link labelled
"Android on Beagle".

rday

Robert,

     If you download toolchain from embinux it gives you following tar
ball. "arm-none-linux-gnueabi-cortex-core-v2.tar.bz2"

While the one you have mentioned is "android-toolchain-20081019.tar.bz2"

  It is better to acknowledge your mistakes, rather than pointing at
others, and what others should do.

Regards,
Rupesh Gujare

Robert P. J. Day wrote:

ok, if i messed that up, i apologize, but i have no idea where that
other toolchain could have come from. i'll try again.

rday

you're right, i apologize. i'm absolutely baffled as to where that
other toolchain came from. my mistake.

rday

Hi all,
I am trying porting Cortex patches from code sourcery to Android
toolchain. I did that and am now compiling with top Makefile.in
patches as follows:

Melwyn,

This might be of interest to you.

Regards, melwyn wrote:

Rupesh,
I think I prefer to compile the toolchain rather than using a prebuilt
one.
I got over the above issue by using --disable-multilib option

However when I use this compiler for compiling the Android package I
get the following error:

Do you have the toolchain source for the tarball "http://
labs.embinux.org/index.php/Toolchain_For_Android"
I could use that as a reference.

Regards,
Melwyn

Rupesh,
While using your toolchain binaries (after following the README) I get
the following error:

prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc -I
system/core/include -I hardware/libhardware/include -I hardware/
ril/include -I dalvik/libnativehelper/include -I frameworks/base/
include -I external/skia/include -I out/target/product/generic/obj/
include -I bionic/libc/arch-arm/include -I bionic/libc/include -
I bionic/libstdc++/include -I bionic/libc/kernel/common -I bionic/
libc/kernel/arch-arm -I bionic/libm/include -I bionic/libm/include/
arch/arm -I bionic/libthread_db/include -I external/srec/audio/
test/AudioHardwareRecordLoop/include -I external/srec/audio/AudioIn/
UNIX/include -I external/srec/audio/test/AudioHardwareRecordLoop -
I out/target/product/generic/obj/EXECUTABLES/
AudioHardwareRecordLoop_intermediates -c -fno-exceptions -Wno-
multichar -msoft-float -fpic -ffunction-sections -funwind-tables -
fstack-protector -march=armv7-a -D__ARM_ARCH_7__ -include system/core/
include/arch/linux-arm/AndroidConfig.h -I system/core/include/arch/
linux-arm/ -mthumb-interwork -DANDROID -fmessage-length=0 -W -Wall -
Wno-unused -DSK_RELEASE -DNDEBUG -O2 -g -Wstrict-aliasing=2 -finline-
functions -fno-inline-functions-called-once -fgcse-after-reload -
frerun-cse-after-loop -frename-registers -DNDEBUG -UDEBUG -mthumb -Os -
fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -MD -o
out/target/product/generic/obj/EXECUTABLES/
AudioHardwareRecordLoop_intermediates/src/AudioHardwareRecordLoop.o
external/srec/audio/test/AudioHardwareRecordLoop/src/
AudioHardwareRecordLoop.c
/home/melwyn/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/
bin/../libexec/gcc/arm-eabi/4.4.0/cc1: error while loading shared
libraries: libmpfr.so.1: cannot open shared object file: No such file
or directory

Seems like you don't have MPFR library(http://www.mpfr.org) on your
host machine, please install it and give a try.

On ubuntu you could do,
$ sudo apt-get install libmpfr1ldbl

-Thanks,

          Anish

Hi Anil,

I get this error on a newly built toolchain. Could you tell what this
could be?

external/srec/uapi/java/jniapi/jniapi/JNIHelper.cpp:168: internal
compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/
libUAPI_jni_intermediates/JNIHelper.o] Error 1

Melwyn

It seems to be new error from the gcc , can you please send some more
detail log of the error.

Regards
Partha

Hi,

Think these kinds of errors are encountered when you mix the
optimization flags passed to the compiler in a way that is not
supported.

You could try building in the verbose mode with
#make showcommands
and send the line where the fault occurs.

-Thanks,

             Anish