[2/2] rust: update usage of TARGET_AIX to TARGET_AIX_OS

Message ID 20230616160002.1854983-2-murphyp@linux.ibm.com
State Accepted
Headers
Series [1/2] go: update usage of TARGET_AIX to TARGET_AIX_OS |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Paul E Murphy June 16, 2023, 4 p.m. UTC
  This was noticed when fixing the gccgo usage of the macro, the
rust usage is very similar.

TARGET_AIX is defined as a non-zero value on linux/powerpc64le
which may cause unexpected behavior.  TARGET_AIX_OS should be
used to toggle AIX specific behavior.

gcc/rust/ChangeLog:

	* rust-object-export.cc [TARGET_AIX]: Rename and update
	usage to TARGET_AIX_OS.
---
 gcc/rust/rust-object-export.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Thomas Schwinge June 19, 2023, 8:39 a.m. UTC | #1
Hi Paul!

On 2023-06-16T11:00:02-0500, "Paul E. Murphy via Gcc-patches" <gcc-patches@gcc.gnu.org> wrote:
> This was noticed when fixing the gccgo usage of the macro, the
> rust usage is very similar.
>
> TARGET_AIX is defined as a non-zero value on linux/powerpc64le
> which may cause unexpected behavior.  TARGET_AIX_OS should be
> used to toggle AIX specific behavior.
>
> gcc/rust/ChangeLog:
>
>       * rust-object-export.cc [TARGET_AIX]: Rename and update
>       usage to TARGET_AIX_OS.

I don't have rights to formally approve this GCC/Rust change, but I'll
note that it follows "as obvious" (see
<https://gcc.gnu.org/gitwrite.html#policies>, "Obvious fixes") to the
corresponding GCC/Go change, which has been approved:
<https://inbox.sourceware.org/CAKOQZ8wDWc7G5_jBNK1jvgChhiURceeAmZb5Bqrx_VZjeJP2Vw@mail.gmail.com>,
and which is where this GCC/Rust code has been copied from, so I suggest
you push both patches at once.


Grüße
 Thomas


> ---
>  gcc/rust/rust-object-export.cc | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/rust/rust-object-export.cc b/gcc/rust/rust-object-export.cc
> index 1143c767784..f9a395f6964 100644
> --- a/gcc/rust/rust-object-export.cc
> +++ b/gcc/rust/rust-object-export.cc
> @@ -46,8 +46,8 @@
>  #define RUST_EXPORT_SECTION_NAME ".rust_export"
>  #endif
>
> -#ifndef TARGET_AIX
> -#define TARGET_AIX 0
> +#ifndef TARGET_AIX_OS
> +#define TARGET_AIX_OS 0
>  #endif
>
>  /* Return whether or not GCC has reported any errors.  */
> @@ -91,7 +91,7 @@ rust_write_export_data (const char *bytes, unsigned int size)
>      {
>        gcc_assert (targetm_common.have_named_sections);
>        sec = get_section (RUST_EXPORT_SECTION_NAME,
> -                      TARGET_AIX ? SECTION_EXCLUDE : SECTION_DEBUG, NULL);
> +                      TARGET_AIX_OS ? SECTION_EXCLUDE : SECTION_DEBUG, NULL);
>      }
>
>    switch_to_section (sec);
> --
> 2.31.1
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
  
Paul E Murphy June 21, 2023, 4:20 p.m. UTC | #2
On 6/19/23 3:39 AM, Thomas Schwinge wrote:
> Hi Paul!
> 
> On 2023-06-16T11:00:02-0500, "Paul E. Murphy via Gcc-patches" <gcc-patches@gcc.gnu.org> wrote:
>> This was noticed when fixing the gccgo usage of the macro, the
>> rust usage is very similar.
>>
>> TARGET_AIX is defined as a non-zero value on linux/powerpc64le
>> which may cause unexpected behavior.  TARGET_AIX_OS should be
>> used to toggle AIX specific behavior.
>>
>> gcc/rust/ChangeLog:
>>
>>        * rust-object-export.cc [TARGET_AIX]: Rename and update
>>        usage to TARGET_AIX_OS.
> 
> I don't have rights to formally approve this GCC/Rust change, but I'll
> note that it follows "as obvious" (see
> <https://gcc.gnu.org/gitwrite.html#policies>, "Obvious fixes") to the
> corresponding GCC/Go change, which has been approved:
> <https://inbox.sourceware.org/CAKOQZ8wDWc7G5_jBNK1jvgChhiURceeAmZb5Bqrx_VZjeJP2Vw@mail.gmail.com>,
> and which is where this GCC/Rust code has been copied from, so I suggest
> you push both patches at once.
> 
> 
> Grüße
>   Thomas

Hi Thomas,

Thank you for reviewing.  I do not have commit access, so I cannot push 
this myself.  If this is OK, could one of the rust maintainers push this 
patch?

Thanks,
Paul
  
Peter Bergner June 22, 2023, 11:38 p.m. UTC | #3
On 6/21/23 11:20 AM, Paul E Murphy via Gcc-patches wrote:
> 
> 
> On 6/19/23 3:39 AM, Thomas Schwinge wrote:
>> Hi Paul!
>>
>> On 2023-06-16T11:00:02-0500, "Paul E. Murphy via Gcc-patches" <gcc-patches@gcc.gnu.org> wrote:
>>> This was noticed when fixing the gccgo usage of the macro, the
>>> rust usage is very similar.
>>>
>>> TARGET_AIX is defined as a non-zero value on linux/powerpc64le
>>> which may cause unexpected behavior.  TARGET_AIX_OS should be
>>> used to toggle AIX specific behavior.
>>>
>>> gcc/rust/ChangeLog:
>>>
>>>        * rust-object-export.cc [TARGET_AIX]: Rename and update
>>>        usage to TARGET_AIX_OS.
>>
>> I don't have rights to formally approve this GCC/Rust change, but I'll
>> note that it follows "as obvious" (see
>> <https://gcc.gnu.org/gitwrite.html#policies>, "Obvious fixes") to the
>> corresponding GCC/Go change, which has been approved:
>> <https://inbox.sourceware.org/CAKOQZ8wDWc7G5_jBNK1jvgChhiURceeAmZb5Bqrx_VZjeJP2Vw@mail.gmail.com>,
>> and which is where this GCC/Rust code has been copied from, so I suggest
>> you push both patches at once.
>>
>>
>> Grüße
>>   Thomas
> 
> Hi Thomas,
> 
> Thank you for reviewing.  I do not have commit access, so I cannot push this myself.  If this is OK, could one of the rust maintainers push this patch?
> 
> Thanks,
> Paul

I pushed this to trunk for Paul.

Peter
  

Patch

diff --git a/gcc/rust/rust-object-export.cc b/gcc/rust/rust-object-export.cc
index 1143c767784..f9a395f6964 100644
--- a/gcc/rust/rust-object-export.cc
+++ b/gcc/rust/rust-object-export.cc
@@ -46,8 +46,8 @@ 
 #define RUST_EXPORT_SECTION_NAME ".rust_export"
 #endif
 
-#ifndef TARGET_AIX
-#define TARGET_AIX 0
+#ifndef TARGET_AIX_OS
+#define TARGET_AIX_OS 0
 #endif
 
 /* Return whether or not GCC has reported any errors.  */
@@ -91,7 +91,7 @@  rust_write_export_data (const char *bytes, unsigned int size)
     {
       gcc_assert (targetm_common.have_named_sections);
       sec = get_section (RUST_EXPORT_SECTION_NAME,
-			 TARGET_AIX ? SECTION_EXCLUDE : SECTION_DEBUG, NULL);
+			 TARGET_AIX_OS ? SECTION_EXCLUDE : SECTION_DEBUG, NULL);
     }
 
   switch_to_section (sec);