diff mbox series

[AIX] Alias -m64 to -maix64 and -m32 to -maix32

Message ID CAGWvnyncsPPCC0FSaXaS7nMDrYzb6fo6MBvjNu6rq11z6UuuYQ@mail.gmail.com
State New
Headers show
Series [AIX] Alias -m64 to -maix64 and -m32 to -maix32 | expand

Commit Message

David Edelsohn April 27, 2021, 10:15 p.m. UTC
GCC on AIX historically has used -maix64 and -maix32 to switch to
64 bit mode
    or 32 bit mode, unlike other ports that use -m64 and -m32.  The Alias()
    directive for options cannot be used because aix64 is expected in multiple
    parts of the compiler infrastructure and one cannot switch to -m64 due to
    backward compatibility.

    This patch defines DRIVER_SELF_SPECS to translate -m64 to -maix64 and
    -m32 to -maix32 so that the command line option compatible with other
    targets can be used while continuing to allow the historical options.

Bootstrapped on powerpc-ibm-aix7.2.3.0

Thanks, David


            * config/rs6000/aix.h (SUBTARGET_DRIVER_SELF_SPECS): New.
            * config/rs6000/aix64.opt (m64): New.
            (m32): New.
diff mbox series


diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index b116e1a36bb..662785cc7db 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -280,3 +280,9 @@ 

 #define TARGET_PRECOMPUTE_TLS_P rs6000_aix_precompute_tls_p
+/* Replace -m64 with -maix64 and -m32 with -maix32.  */
+"%{m64:-maix64} %<m64",                        \
+"%{m32:-maix32} %<m32"

diff --git a/gcc/config/rs6000/aix64.opt b/gcc/config/rs6000/aix64.opt
index 7673c91e013..8473b110539 100644
--- a/gcc/config/rs6000/aix64.opt
+++ b/gcc/config/rs6000/aix64.opt
@@ -53,3 +53,9 @@  Driver