diff mbox

[i386,Android] Enable exceptions and RTTI by default for Android

Message ID CAMbmDYYk4OiT+JjxW_UHkNuSqNbbP-uA1B=ExB8tHSmxDdgNpw@mail.gmail.com
State New
Headers show

Commit Message

Ilya Enkovich Feb. 24, 2012, 10:22 a.m. UTC
> On Wed, Feb 22, 2012 at 3:57 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>> Hello,
>>
>> Here is a simple patch which enables exceptions and RTTI by default
>> for Android target. OK for trunk?
>
> Err - isn't that the default?  Thus, simply delete the bogus spec?
>
> Richard.
>
>
Hi,

Is following patch OK or it's better to remove whole macro and its usages?

Thanks,
Ilya
--
2012-02-22  Enkovich Ilya  <ilya.enkovich@intel.com>

	* gcc/config/linux-android.h (ANDROID_CC1PLUS_SPEC): Enable
	exceptions and rtti by default.

Comments

Richard Biener Feb. 24, 2012, 10:36 a.m. UTC | #1
On Fri, Feb 24, 2012 at 11:22 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>> On Wed, Feb 22, 2012 at 3:57 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>> Hello,
>>>
>>> Here is a simple patch which enables exceptions and RTTI by default
>>> for Android target. OK for trunk?
>>
>> Err - isn't that the default?  Thus, simply delete the bogus spec?
>>
>> Richard.
>>
>>
> Hi,
>
> Is following patch OK or it's better to remove whole macro and its usages?

The latter.

Richard.

> Thanks,
> Ilya
> --
> 2012-02-22  Enkovich Ilya  <ilya.enkovich@intel.com>
>
>        * gcc/config/linux-android.h (ANDROID_CC1PLUS_SPEC): Enable
>        exceptions and rtti by default.
>
>
> diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
> index 94c5274..180b62b 100644
> --- a/gcc/config/linux-android.h
> +++ b/gcc/config/linux-android.h
> @@ -45,9 +45,7 @@
>   "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} "                      \
>   "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
>
> -#define ANDROID_CC1PLUS_SPEC                                           \
> -  "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} "               \
> -  "%{!frtti:%{!fno-rtti: -fno-rtti}}"
> +#define ANDROID_CC1PLUS_SPEC ""
>
>  #define ANDROID_LIB_SPEC \
>   "%{!static: -ldl}"
Jing Yu Feb. 24, 2012, 11:33 p.m. UTC | #2
My comment is(was) not on the format of the patch. Instead, I am
thinking whether Android toolchain customer, which is Android AOSP,
wants this patch.

I don't know the scenario behind this patch. I think the question
behind this patch is, if RTTI and exceptions are enabled by default,
who is supposed to handle RTTI and exceptions by default? The answer
is no answer, for now.

Android AOSP tree provides very limited C++ support. Android NDK
provides four options for C++ support. Some of the options support
both exceptions and rttit, some options only support rtti.

Therefore I guess Android AOSP probably would not like to enable
exceptions and RTTI by default.

Questions/complaints/requests on Android limited C++ support, should
go to Android forum.
Questions about license concerns, should go to Android AOSP lawyer.

Thanks,
Jing

On Fri, Feb 24, 2012 at 2:36 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Fri, Feb 24, 2012 at 11:22 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>> On Wed, Feb 22, 2012 at 3:57 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>>> Hello,
>>>>
>>>> Here is a simple patch which enables exceptions and RTTI by default
>>>> for Android target. OK for trunk?
>>>
>>> Err - isn't that the default?  Thus, simply delete the bogus spec?
>>>
>>> Richard.
>>>
>>>
>> Hi,
>>
>> Is following patch OK or it's better to remove whole macro and its usages?
>
> The latter.
>
> Richard.
>
>> Thanks,
>> Ilya
>> --
>> 2012-02-22  Enkovich Ilya  <ilya.enkovich@intel.com>
>>
>>        * gcc/config/linux-android.h (ANDROID_CC1PLUS_SPEC): Enable
>>        exceptions and rtti by default.
>>
>>
>> diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
>> index 94c5274..180b62b 100644
>> --- a/gcc/config/linux-android.h
>> +++ b/gcc/config/linux-android.h
>> @@ -45,9 +45,7 @@
>>   "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} "                      \
>>   "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
>>
>> -#define ANDROID_CC1PLUS_SPEC                                           \
>> -  "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} "               \
>> -  "%{!frtti:%{!fno-rtti: -fno-rtti}}"
>> +#define ANDROID_CC1PLUS_SPEC ""
>>
>>  #define ANDROID_LIB_SPEC \
>>   "%{!static: -ldl}"
Ilya Enkovich Feb. 27, 2012, 8:28 a.m. UTC | #3
> My comment is(was) not on the format of the patch. Instead, I am
> thinking whether Android toolchain customer, which is Android AOSP,
> wants this patch.
>
> I don't know the scenario behind this patch. I think the question
> behind this patch is, if RTTI and exceptions are enabled by default,
> who is supposed to handle RTTI and exceptions by default? The answer
> is no answer, for now.
>
> Android AOSP tree provides very limited C++ support. Android NDK
> provides four options for C++ support. Some of the options support
> both exceptions and rttit, some options only support rtti.
>
> Therefore I guess Android AOSP probably would not like to enable
> exceptions and RTTI by default.

Actually when you rebuild Android NDK similar patch (named
0001-Enable-C-exceptions-and-RTTI-by-default.patch) is applied to GCC
sources before toolchain rebuild.

Ilya

>
> Questions/complaints/requests on Android limited C++ support, should
> go to Android forum.
> Questions about license concerns, should go to Android AOSP lawyer.
>
> Thanks,
> Jing
>
> On Fri, Feb 24, 2012 at 2:36 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Fri, Feb 24, 2012 at 11:22 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>>> On Wed, Feb 22, 2012 at 3:57 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>>>> Hello,
>>>>>
>>>>> Here is a simple patch which enables exceptions and RTTI by default
>>>>> for Android target. OK for trunk?
>>>>
>>>> Err - isn't that the default?  Thus, simply delete the bogus spec?
>>>>
>>>> Richard.
>>>>
>>>>
>>> Hi,
>>>
>>> Is following patch OK or it's better to remove whole macro and its usages?
>>
>> The latter.
>>
>> Richard.
>>
>>> Thanks,
>>> Ilya
>>> --
>>> 2012-02-22  Enkovich Ilya  <ilya.enkovich@intel.com>
>>>
>>>        * gcc/config/linux-android.h (ANDROID_CC1PLUS_SPEC): Enable
>>>        exceptions and rtti by default.
>>>
>>>
>>> diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
>>> index 94c5274..180b62b 100644
>>> --- a/gcc/config/linux-android.h
>>> +++ b/gcc/config/linux-android.h
>>> @@ -45,9 +45,7 @@
>>>   "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} "                      \
>>>   "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
>>>
>>> -#define ANDROID_CC1PLUS_SPEC                                           \
>>> -  "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} "               \
>>> -  "%{!frtti:%{!fno-rtti: -fno-rtti}}"
>>> +#define ANDROID_CC1PLUS_SPEC ""
>>>
>>>  #define ANDROID_LIB_SPEC \
>>>   "%{!static: -ldl}"
Jing Yu Feb. 27, 2012, 6:16 p.m. UTC | #4
On Mon, Feb 27, 2012 at 12:28 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>> My comment is(was) not on the format of the patch. Instead, I am
>> thinking whether Android toolchain customer, which is Android AOSP,
>> wants this patch.
>>
>> I don't know the scenario behind this patch. I think the question
>> behind this patch is, if RTTI and exceptions are enabled by default,
>> who is supposed to handle RTTI and exceptions by default? The answer
>> is no answer, for now.
>>
>> Android AOSP tree provides very limited C++ support. Android NDK
>> provides four options for C++ support. Some of the options support
>> both exceptions and rttit, some options only support rtti.
>>
>> Therefore I guess Android AOSP probably would not like to enable
>> exceptions and RTTI by default.
>
> Actually when you rebuild Android NDK similar patch (named
> 0001-Enable-C-exceptions-and-RTTI-by-default.patch) is applied to GCC
> sources before toolchain rebuild.

Right. The patch is used to build NDK toolchain which is to build NDK
applications, and NDK offers several options for RTTI and exception
support. But Android AOSP platform does not support exception, and the
toolchain to build Android AOSP platform does not use this patch.
That's why the patch exists in NDK package, not in AOSP toolchain
source repository.

Thanks,
Jing

>
> Ilya
>
>>
>> Questions/complaints/requests on Android limited C++ support, should
>> go to Android forum.
>> Questions about license concerns, should go to Android AOSP lawyer.
>>
>> Thanks,
>> Jing
>>
>> On Fri, Feb 24, 2012 at 2:36 AM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>> On Fri, Feb 24, 2012 at 11:22 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>>>> On Wed, Feb 22, 2012 at 3:57 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>>>>> Hello,
>>>>>>
>>>>>> Here is a simple patch which enables exceptions and RTTI by default
>>>>>> for Android target. OK for trunk?
>>>>>
>>>>> Err - isn't that the default?  Thus, simply delete the bogus spec?
>>>>>
>>>>> Richard.
>>>>>
>>>>>
>>>> Hi,
>>>>
>>>> Is following patch OK or it's better to remove whole macro and its usages?
>>>
>>> The latter.
>>>
>>> Richard.
>>>
>>>> Thanks,
>>>> Ilya
>>>> --
>>>> 2012-02-22  Enkovich Ilya  <ilya.enkovich@intel.com>
>>>>
>>>>        * gcc/config/linux-android.h (ANDROID_CC1PLUS_SPEC): Enable
>>>>        exceptions and rtti by default.
>>>>
>>>>
>>>> diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
>>>> index 94c5274..180b62b 100644
>>>> --- a/gcc/config/linux-android.h
>>>> +++ b/gcc/config/linux-android.h
>>>> @@ -45,9 +45,7 @@
>>>>   "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} "                      \
>>>>   "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
>>>>
>>>> -#define ANDROID_CC1PLUS_SPEC                                           \
>>>> -  "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} "               \
>>>> -  "%{!frtti:%{!fno-rtti: -fno-rtti}}"
>>>> +#define ANDROID_CC1PLUS_SPEC ""
>>>>
>>>>  #define ANDROID_LIB_SPEC \
>>>>   "%{!static: -ldl}"
diff mbox

Patch

diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
index 94c5274..180b62b 100644
--- a/gcc/config/linux-android.h
+++ b/gcc/config/linux-android.h
@@ -45,9 +45,7 @@ 
   "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} "			\
   "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"

-#define ANDROID_CC1PLUS_SPEC						\
-  "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} "		\
-  "%{!frtti:%{!fno-rtti: -fno-rtti}}"
+#define ANDROID_CC1PLUS_SPEC ""

 #define ANDROID_LIB_SPEC \
   "%{!static: -ldl}"