This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, Android] MIPS support
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: "Fu, Chao-Ying" <fu at mips dot com>
- Cc: gcc-patches Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Apr 2012 13:36:22 +1200
- Subject: Re: [PATCH, Android] MIPS support
- References: <BCDE03C0-61B1-4C07-9E09-35A3E5C4BA38@codesourcery.com> <16285357-1E07-4D60-BD8D-2B2FE796609B@codesourcery.com> <87sjgmm0rt.fsf@talisman.home> <7C6479EB2BF52547AC332FD6034646DA01448C282D@exchdb03.mips.com> <CA+=Sn1mYyCOusJWY9vswVA9k6Rm-goXPDxBvQYpXsh8zgJ30ng@mail.gmail.com> <7C6479EB2BF52547AC332FD6034646DA01448C3ABE@exchdb03.mips.com> <CA+=Sn1nDX8Yf+QE5VO+bQTiRpG25ZO-3PFp4QhkFN=8GEjMaJg@mail.gmail.com> <7C6479EB2BF52547AC332FD6034646DA01448C3AEF@exchdb03.mips.com> <B5CB78C8-D6D9-4E58-8A58-D95DE94A0AA7@codesourcery.com> <7C6479EB2BF52547AC332FD6034646DA01448C524E@exchdb03.mips.com> <DF146E78-EBAA-4A69-9430-DEF78480C5FB@codesourcery.com> <DC934C10-B958-40D3-8782-5DDAD8B7F668@codesourcery.com> <7C6479EB2BF52547AC332FD6034646DA01448CA91E@exchdb03.mips.com>
On 18/04/2012, at 1:10 PM, Fu, Chao-Ying wrote:
> Maxim Kuvyrkov wrote:
>
>> Above definitions are OK.
>
> Thanks!
For avoidance of doubt, please wait for the whole patch to be approved before committing it.
>>>> Index: gcc/libgcc/unwind-dw2-fde-dip.c
>>>> ===================================================================
>>>> --- gcc.orig/libgcc/unwind-dw2-fde-dip.c 2012-04-03
>> 17:07:28.000000000 -0700
>>>> +++ gcc/libgcc/unwind-dw2-fde-dip.c 2012-04-04
>> 14:51:01.338074000 -0700
>>>> @@ -48,8 +48,9 @@
>>>> #include "gthr.h"
>>>>
>>>> #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
>>>> - && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
>>>> - || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 &&
>> defined(DT_CONFIG)))
>>>> + && ((defined(__BIONIC__) && (defined(mips) ||
>> defined(__mips__))) \
>>>> + || (__GLIBC__ > 2 || (__GLIBC__ == 2 &&
>> __GLIBC_MINOR__ > 2) \
>>>> + || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 &&
>> defined(DT_CONFIG))))
>>>> # define USE_PT_GNU_EH_FRAME
>>>> #endif
>>
>> What is this change for?
>
> For stack unwinding, MIPS needs supporting functions in libgcc to
> work with eh_frame for Android.
> (Note that ARM has its own unwinding functions in gcc/config/arm/. It doesn't use eh_frame.)
> The file is enabled for GLIBC originally. Thus, I add a new test to enable it
> for MIPS Android BIONIC build.
Please use format that other C libraries use (instead of mixing together GLIBC and Bionic definitions):
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
&& defined(__BIONIC__)
# define USE_PT_GNU_EH_FRAME
#endif
Also, as far as I can tell, this change would also apply for x86, and for ARM having USE_PT_GNU_EH_FRAME defined will not hurt. So please make the definition architecture-agnostic.
Thank you,
--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics