support android >= android api version 30 (aka android 10) would be great

Get Outlook for Android

From: Simon Marchi <simark@simark.ca>
Sent: Saturday, 31 October 2026 03:51:40
To: Tom Tromey <tromey@adacore.com>; trcrsired <oyzawqgcfc@gmail.com>
Cc: binutils@sourceware.org <binutils@sourceware.org>; gdb-patches@sourceware.org <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/1] Support building binutils-gdb for an Android (bionic) host
 
Hi,

Could we determine (and ideally document) a baseline Android that we
need to support?  The other day when removing ancient hacks there were
some made for old Bionic verisons, and I had to guess whether they were
still needed or not.  If we had a clear policy (and I wish we had that
for other platforms), it would make it much easier.

Simon

On 10/30/26 1:57 PM, Tom Tromey wrote:
>>>>>> trcrsired  <oyzawqgcfc@gmail.com> writes:
>
>> Building with --host=aarch64-linux-android30 failed because bionic is not
>> glibc:
>
> Thanks for the patch.
>
> In addition to what Jan said, I have a few minor comments.
>
>> - The compiler's <limits.h> does not expose PATH_MAX (bionic defines it in
>>   <linux/limits.h>), while <sys/param.h> defines MAXPATHLEN as PATH_MAX.
>>   Make PATH_MAX available from libiberty.h and gnulib's pathmax.h for
>>   __ANDROID__.
>
> I'm curious why this is needed in libiberty.h specifically.
>
> I somewhat thought gdb didn't need PATH_MAX.
>
>> diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
>> index 16a2520baf4..cc73c22a580 100644
>> --- a/gdbserver/configure.ac
>> +++ b/gdbserver/configure.ac
> [...]
>
> Here at AdaCore we have essentially this same patch in place.
> If you sent this separately I would approve it.
>
>> diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
>> index 1c0ae0ad9d1..b29a81ada40 100644
>> --- a/gdbsupport/common-defs.h
>> +++ b/gdbsupport/common-defs.h
>
> This one also seems fine to me.
>
>> diff --git a/gnulib/import/rawmemchr.c b/gnulib/import/rawmemchr.c
>> index ea68c1bfc6a..50d5918ba07 100644
>> --- a/gnulib/import/rawmemchr.c
>> +++ b/gnulib/import/rawmemchr.c
>
> gnulib changes are a pain I'm afraid.
>
> In addition to patching the tree, you have to add the patch itself to
> gnulib/patches so they can potentially be reapplied by update-gnulib.sh.
>
> Last time I tried to update gnulib, it was a total failure, though.
> I recommend not trying this.
>
> However what you could do is put the patch in patches, then run
> update-gnulib.sh (using the existing hash) to verify that the patch
> application works as intended.
>
> I looked at upstream gnulib and it doesn't seem to have any relevant
> change here.  So you might consider submitting this change to gnulib as
> well.
>
> thanks,
> Tom