[libgfortran] aix: Fix building fat library for AIX

Message ID CAGWvny=D7b=YPrvs__ikuPCBDhNTDJ5tNS_cX067=6iWjBmYnQ@mail.gmail.com
State New
Headers
Series [libgfortran] aix: Fix building fat library for AIX |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply

Commit Message

David Edelsohn May 6, 2024, 3:22 p.m. UTC
  aix: Fix building fat library for AIX

    With the change in subdirectories, the code for libgfortran fat
libraries
    needs to be adjusted to explicitly reference the subdirectory.  AIX
    creates fat library archives and the compiler itself can be built as
    either 32 bit or 64 bit application and default code generation.  For
    the two, alternate versions of the compiler to interoperate, GCC needs
    to construct the fat libraries manually.

    The Makefile fragment had been trying to leverage as much of the
existing
    targets and macros as possible.  With the subdirectory change, the
    location of single.o is more obscured and cannot be determined without
    libtool.  This patch references the location of the real object file
    more explicitly.

    Utilizing subst seems like overkill and unnecessary obscuration for a
single
    object file.  Either way, it's digging below the libtool abstraction
layer.

    This also fixes Fortran bootstrap on AIX.

    Bootstrapped on powerpc-ibm-aix7.3.0.0

    libgfortran/ChangeLog:
            * config/t-aix (all-local, libcaf_single): Explicitly reference
            caf/.libs/single.o

-       $(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)/.libs/libcaf_single.a
../pthread/ppc$(BITS)/$(PACKAGE)/.libs/$(libcaf_single_la_OBJECTS:.lo=.o)
+       $(ARX) -X$(BITS) rc .libs/libcaf_single.a
../ppc$(BITS)/$(PACKAGE)/caf/.libs/single.o
+       $(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)/.libs/libcaf_single.a
../pthread/ppc$(BITS)/$(PACKAGE)/caf/.libs/single.o
 endif
  

Comments

FX Coudert May 6, 2024, 5:02 p.m. UTC | #1
>     libgfortran/ChangeLog:
>             * config/t-aix (all-local, libcaf_single): Explicitly reference
>             caf/.libs/single.o

OK, and sorry for the breakage.

FX
  

Patch

diff --git a/libgfortran/config/t-aix b/libgfortran/config/t-aix
index 0e50501d10e..099fc5d8b3a 100644
--- a/libgfortran/config/t-aix
+++ b/libgfortran/config/t-aix
@@ -7,6 +7,6 @@  ARX=$(shell echo $(AR) | sed -e 's/-X[^ ]*//g')
 all-local:
        $(ARX) -X$(BITS) rc .libs/$(PACKAGE).a
../ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
        $(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a
../pthread/ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
-       $(ARX) -X$(BITS) rc .libs/libcaf_single.a
../ppc$(BITS)/$(PACKAGE)/.libs/$(libcaf_single_la_OBJECTS:.lo=.o)