diff mbox

Fix bootstrap on arm target

Message ID AM4PR0701MB21625C8CD77FE18BAAC23DFEE4EF0@AM4PR0701MB2162.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger May 9, 2017, 7:59 a.m. UTC
Hi,

since a few days the bootstrap of ada fails on a native arm target.

It is due to a -Werror warning when passing GNAT_EXCEPTION_CLASS
which is a string constant to exception_class_eq, but C++ forbids to cast
that to "char*".

Not sure what is the smartest solution, I tried the following and it
seems to work for x86_64-pc-linux-gnu and arm-linux-gnueabihf.


Is it OK for trunk?


Thanks
Bernd.

Comments

Arnaud Charlet May 9, 2017, 1:10 p.m. UTC | #1
> 
> since a few days the bootstrap of ada fails on a native arm target.
> 
> It is due to a -Werror warning when passing GNAT_EXCEPTION_CLASS
> which is a string constant to exception_class_eq, but C++ forbids to cast
> that to "char*".
> 
> Not sure what is the smartest solution, I tried the following and it
> seems to work for x86_64-pc-linux-gnu and arm-linux-gnueabihf.
> 
> Is it OK for trunk?

Patch looks OK to me FWIW. Tristan?

> 2017-05-09  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 
> 	* raise-gcc.c (exception_class_eq): Make ec parameter const.
> 
> --- gcc/ada/raise-gcc.c.jj	2017-04-27 12:00:42.000000000 +0200
> +++ gcc/ada/raise-gcc.c	2017-05-09 09:45:59.557507045 +0200
> @@ -909,7 +909,8 @@
>  /* Return true iff the exception class of EXCEPT is EC.  */
>  
>  static int
> -exception_class_eq (const _GNAT_Exception *except,
> _Unwind_Exception_Class ec)
> +exception_class_eq (const _GNAT_Exception *except,
> +		    const _Unwind_Exception_Class ec)
>  {
>  #ifdef __ARM_EABI_UNWINDER__
>    return memcmp (except->common.exception_class, ec, 8) == 0;
Bernd Edlinger May 10, 2017, 1:18 p.m. UTC | #2
On 05/09/17 15:10, Arnaud Charlet wrote:
>>
>> since a few days the bootstrap of ada fails on a native arm target.
>>
>> It is due to a -Werror warning when passing GNAT_EXCEPTION_CLASS
>> which is a string constant to exception_class_eq, but C++ forbids to cast
>> that to "char*".
>>
>> Not sure what is the smartest solution, I tried the following and it
>> seems to work for x86_64-pc-linux-gnu and arm-linux-gnueabihf.
>>
>> Is it OK for trunk?
>
> Patch looks OK to me FWIW. Tristan?
>

so, should I go ahead and commit it?

>> 2017-05-09  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>
>> 	* raise-gcc.c (exception_class_eq): Make ec parameter const.
>>
>> --- gcc/ada/raise-gcc.c.jj	2017-04-27 12:00:42.000000000 +0200
>> +++ gcc/ada/raise-gcc.c	2017-05-09 09:45:59.557507045 +0200
>> @@ -909,7 +909,8 @@
>>  /* Return true iff the exception class of EXCEPT is EC.  */
>>
>>  static int
>> -exception_class_eq (const _GNAT_Exception *except,
>> _Unwind_Exception_Class ec)
>> +exception_class_eq (const _GNAT_Exception *except,
>> +		    const _Unwind_Exception_Class ec)
>>  {
>>  #ifdef __ARM_EABI_UNWINDER__
>>    return memcmp (except->common.exception_class, ec, 8) == 0;
>
Arnaud Charlet May 10, 2017, 1:21 p.m. UTC | #3
> >> It is due to a -Werror warning when passing GNAT_EXCEPTION_CLASS
> >> which is a string constant to exception_class_eq, but C++ forbids to
> >> cast
> >> that to "char*".
> >>
> >> Not sure what is the smartest solution, I tried the following and it
> >> seems to work for x86_64-pc-linux-gnu and arm-linux-gnueabihf.
> >>
> >> Is it OK for trunk?
> >
> > Patch looks OK to me FWIW. Tristan?
> >
> 
> so, should I go ahead and commit it?

Go ahead.

> >> 2017-05-09  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> >>
> >> 	* raise-gcc.c (exception_class_eq): Make ec parameter const.
> >>
> >> --- gcc/ada/raise-gcc.c.jj	2017-04-27 12:00:42.000000000 +0200
> >> +++ gcc/ada/raise-gcc.c	2017-05-09 09:45:59.557507045 +0200
> >> @@ -909,7 +909,8 @@
> >>  /* Return true iff the exception class of EXCEPT is EC.  */
> >>
> >>  static int
> >> -exception_class_eq (const _GNAT_Exception *except,
> >> _Unwind_Exception_Class ec)
> >> +exception_class_eq (const _GNAT_Exception *except,
> >> +		    const _Unwind_Exception_Class ec)
> >>  {
> >>  #ifdef __ARM_EABI_UNWINDER__
> >>    return memcmp (except->common.exception_class, ec, 8) == 0;
> >
diff mbox

Patch

2017-05-09  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* raise-gcc.c (exception_class_eq): Make ec parameter const.

--- gcc/ada/raise-gcc.c.jj	2017-04-27 12:00:42.000000000 +0200
+++ gcc/ada/raise-gcc.c	2017-05-09 09:45:59.557507045 +0200
@@ -909,7 +909,8 @@ 
 /* Return true iff the exception class of EXCEPT is EC.  */
 
 static int
-exception_class_eq (const _GNAT_Exception *except, _Unwind_Exception_Class ec)
+exception_class_eq (const _GNAT_Exception *except,
+		    const _Unwind_Exception_Class ec)
 {
 #ifdef __ARM_EABI_UNWINDER__
   return memcmp (except->common.exception_class, ec, 8) == 0;