* Building gdb for Android using Android-ndk
@ 2013-01-23 9:29 Robert
2013-01-23 13:40 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Robert @ 2013-01-23 9:29 UTC (permalink / raw)
To: gdb
Hi,
I am trying to build gdb for Android using the "standalone-toolchain"
created by the Android-NDK (make-standalone-toolchain.sh).
My configure call is as follows:
./configure --target=arm-linux-androideabi --host=arm-linux-androideabi
I tried different gdb versions - unfortunately earlier or later I ran
into an error I could not solve.
For example gdb 7.5 has only some minor problems where libraries like
libsim.a, libbfd.a and other required additional processing using
ranlib. I fixed this by manually executing ranlib on the specified
libraries and then restarted the make process.
But in the end the build process stops with the following error:
make[5]: Leaving directory `/tmp/gdb-7.5/gdb/gdbserver'
gcc -c -g -O2 -I. -I. -I./../common -I./../regformats
-I./../../include -I./../gnulib/import -Ibuild-gnulib-gdbserver/import
-Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
-Wno-char-subscripts -Werror linux-arm-low.c
linux-arm-low.c: In function âarm_prepare_to_resumeâ:
linux-arm-low.c:714:9: error: cast to pointer from integer of different
size [-Werror=int-to-pointer-cast]
linux-arm-low.c:720:9: error: cast to pointer from integer of different
size [-Werror=int-to-pointer-cast]
linux-arm-low.c:734:9: error: cast to pointer from integer of different
size [-Werror=int-to-pointer-cast]
linux-arm-low.c:740:9: error: cast to pointer from integer of different
size [-Werror=int-to-pointer-cast]
BTW: Build environment is Ubuntu 12.04 (x86_64).
Robert
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Building gdb for Android using Android-ndk
2013-01-23 9:29 Building gdb for Android using Android-ndk Robert
@ 2013-01-23 13:40 ` Pedro Alves
2013-01-23 14:54 ` Robert
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-01-23 13:40 UTC (permalink / raw)
To: Robert; +Cc: gdb
On 01/23/2013 09:29 AM, Robert wrote:
> I am trying to build gdb for Android using the "standalone-toolchain"
> created by the Android-NDK (make-standalone-toolchain.sh).
>
> My configure call is as follows:
>
> ./configure --target=arm-linux-androideabi --host=arm-linux-androideabi
>
> I tried different gdb versions - unfortunately earlier or later I ran
> into an error I could not solve.
You're building a gdb that runs on Android? Or you want a GDBserver
that runs on Android, but debug from your x86_64 Ubuntu host?
If the latter, drop the --host part when building GDB, as you
want GDB that runs on x86_64. You'll then need to build GDBserver
as a separate step, for an Android host, so you'll use the --host
setting then. See:
http://www.sourceware.org/autobook/autobook/autobook_259.html
>
> For example gdb 7.5 has only some minor problems where libraries like
> libsim.a, libbfd.a and other required additional processing using
> ranlib. I fixed this by manually executing ranlib on the specified
> libraries and then restarted the make process.
>
> But in the end the build process stops with the following error:
>
> make[5]: Leaving directory `/tmp/gdb-7.5/gdb/gdbserver'
> gcc -c -g -O2 -I. -I. -I./../common -I./../regformats
So is "gcc" itself a native compiler running on Android? If not,
then you should be seeing arm-linux-androideabi-gcc or some such here.
> -I./../../include -I./../gnulib/import -Ibuild-gnulib-gdbserver/import
> -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
> -Wno-char-subscripts -Werror linux-arm-low.c
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Building gdb for Android using Android-ndk
2013-01-23 13:40 ` Pedro Alves
@ 2013-01-23 14:54 ` Robert
2013-01-23 14:58 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Robert @ 2013-01-23 14:54 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb
Hi Pedro,
thanks for your reply.
> You're building a gdb that runs on Android? Or you want a GDBserver
> that runs on Android, but debug from your x86_64 Ubuntu host?
I am trying to build a standalone version of gdb that runs directly on
the device. It is coincidence that the error just occurs in the
gdbserver subproject. I am not aware of the internal dependencies of gdb
- may be one can simply disable the gdbserver subproject?
> So is "gcc" itself a native compiler running on Android? If not,
> then you should be seeing arm-linux-androideabi-gcc or some such
> here.
You are right, this little strange detail did not catch my attention.
Looks like the configuration was not done correctly.
Therefore I deleted everything and started from scratch. Now the build
process looks correct, but stops much earlier with an error I have seen
several times before:
arm-linux-androideabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I./../include
-W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic
./getpagesize.c -o getpagesize.o
./getpagesize.c:64:1: error: redefinition of 'getpagesize'
/opt/android-standalone-toolchain/bin/../sysroot/usr/include/unistd.h:162:23:
note: previous definition of 'getpagesize' was here
I checked the log and noticed that the system checks that executed the
first time when I execute "make" contains several lines with
"checking for getpagesize... no".
I uploaded the complete make log here: http://pastebin.com/v3etd3Sa
Robert
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Building gdb for Android using Android-ndk
2013-01-23 14:54 ` Robert
@ 2013-01-23 14:58 ` Pedro Alves
[not found] ` <35190382.post@talk.nabble.com>
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-01-23 14:58 UTC (permalink / raw)
To: Robert; +Cc: gdb
On 01/23/2013 02:28 PM, Robert wrote:
>> You're building a gdb that runs on Android? Or you want a GDBserver
>> that runs on Android, but debug from your x86_64 Ubuntu host?
>
> I am trying to build a standalone version of gdb that runs directly on
> the device.
Ack. I don't ever recall seeing patches to port the various
subprojects in gdb (bfd, libiberty, gdb itself, etc.), except
gdbserver, which always runs on the target, to
Android/bionic though.
You're likely to hit problems that would need porting work.
It is coincidence that the error just occurs in the
> gdbserver subproject. I am not aware of the internal dependencies of gdb
> - may be one can simply disable the gdbserver subproject?
gdbserver should build for Android. So the cross scenario we know works.
>
> arm-linux-androideabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I./../include
> -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic
> ./getpagesize.c -o getpagesize.o
> ./getpagesize.c:64:1: error: redefinition of 'getpagesize'
> /opt/android-standalone-toolchain/bin/../sysroot/usr/include/unistd.h:162:23:
> note: previous definition of 'getpagesize' was here
>
> I checked the log and noticed that the system checks that executed the
> first time when I execute "make" contains several lines with
> "checking for getpagesize... no".
>
> I uploaded the complete make log here: http://pastebin.com/v3etd3Sa
Right, so the build is failing while building libiberty (primarily a
host abstraction library). I'm afraid it looks like someone needs to
step up and do some porting work. Looks like you found an itch to
scratch. ;-)
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-04 9:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 9:29 Building gdb for Android using Android-ndk Robert
2013-01-23 13:40 ` Pedro Alves
2013-01-23 14:54 ` Robert
2013-01-23 14:58 ` Pedro Alves
[not found] ` <35190382.post@talk.nabble.com>
2013-04-04 9:43 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).