https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87030

--- Comment #26 from Iain Sandoe <iains at gcc dot gnu.org> ---
Author: iains
Date: Thu Sep  5 19:14:35 2019
New Revision: 275429

URL: https://gcc.gnu.org/viewcvs?rev=275429&root=gcc&view=rev
Log:
[Darwin] Fix PR87030 and tidy config fragments.

This is about 32/64b host and multilib support across the range of Darwin
systems.

Prior to Darwin8 (OS X 10.4), the toolchains support only PowerPC and only 32b.

On Darwin8 it is possible to target a 64b multilib, but with support limited
to a few of the main libraries on the system (not a recommended configuration).

>From Darwin9 to Darwin17 (OSX 10.5 to 10.13) it is possible to have either
32 or 64b hosted toolchains, with support for a 64 or 32b multilib
respectively.

On Darwin9 the kernel is 32b, but with support for 64b executables, so it's
conventional to build a 32b host toolchain supporting a 64b multilib. However
this is not enforced (merely a convention).

There is also some platform hardware supporting Darwin10/11 which is only 32b
and for which the same situation applies. However, from Darwin10 to Darwin17,
the majority of platform hardware supports a 64b kernel and it's conventional
to build a 64b host toolchain with support for a 32b multilib.

On/from Darwin18 (OS X 10.14), the development headers (in the SDK) no longer
expose the interfaces for the 32b multilib support (although sufficient runtime
support remains installed that the testsuite can be run for a 32b multilib).

The PR is raised against this latter situation since the absence of exposed
interfaces causes a 'default' bootstrap fail regardless of the availability of
the runtimes. Given the number of permutations, I felt it warranted a general
solution, especially since the current scheme of target headers and t-make
fragments has become somewhat messy.

The changes here enforce the single 32b PowerPC multilib for Darwin < 8 and the
single X86 64b multilib for Darwin >= 18. This means that there is no longer
any need to configure Darwin18+ '--disable-multilib', but also that if you want
to use the ability to continue to test the compiler's 32b multilib there, you
need to make a configuration targeting an earlier OS version (and using the
SDK from that).

2019-09-05  Iain Sandoe  <i...@sandoe.co.uk>

        Backport from mainline
        2019-07-24  Iain Sandoe  <i...@sandoe.co.uk>

        PR bootstrap/87030
        * config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert change from r273749.

        PR bootstrap/87030
        * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here...
        * config/i386/darwin32-biarch.h .. to here.
        * config/i386/darwin64-biarch.h: Adjust comments.
        * config/rs6000/darwin32-biarch.h: Likewise.
        * config/rs6000/darwin64-biarch.h: Likewise.
        * config.gcc: Missed commit from r273746
        (*-*-darwin*): Don't include CPU t-darwin here.
        (i[34567]86-*-darwin*): Adjust to use biarch files. Produce
        an error message if i686-darwin configuration is attempted for
        Darwin >= 18.

        Backport from mainline
        2019-07-23  Iain Sandoe  <i...@sandoe.co.uk>

        PR bootstrap/87030
        * config.gcc (*-*-darwin*): Don't include CPU t-darwin here.
        (i[34567]86-*-darwin*): Adjust to use biarch files. Produce
        an error message if i686-darwin configuration is attempted for
        Darwin >= 18.
        (x86_64-*-darwin*): Switch to single multilib for Darwin >= 18.
        (powerpc-*-darwin*): Use biarch files where needed.
        (powerpc64-*-darwin*): Likewise.
        * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file.
        (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
        arch case.
        * config/i386/darwin32-biarch.h: New.
        * config/i386/darwin64.h: Rename.
        * gcc/config/i386/darwin64-biarch.h: To this.
        * config/i386/t-darwin: Rename.
        * gcc/config/i386/t-darwin32-biarch: To this.
        * config/i386/t-darwin64: Rename.
        * gcc/config/i386/t-darwin64-biarch: To this.
        * config/rs6000/darwin32-biarch.h: New.
        * config/rs6000/darwin64.h: Rename.
        * config/rs6000/darwin64-biarch.h: To this.
        (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
        arch case.
        * config/rs6000/t-darwin8: Rename.
        * config/rs6000/t-darwin32-biarch: To this.
        * config/rs6000/t-darwin64 Rename.
        * config/rs6000/t-darwin64-biarch: To this.


Added:
    branches/gcc-7-branch/gcc/config/i386/darwin32-biarch.h
    branches/gcc-7-branch/gcc/config/i386/darwin64-biarch.h
    branches/gcc-7-branch/gcc/config/i386/t-darwin32-biarch
    branches/gcc-7-branch/gcc/config/i386/t-darwin64-biarch
    branches/gcc-7-branch/gcc/config/rs6000/darwin32-biarch.h
    branches/gcc-7-branch/gcc/config/rs6000/darwin64-biarch.h
    branches/gcc-7-branch/gcc/config/rs6000/t-darwin32-biarch
    branches/gcc-7-branch/gcc/config/rs6000/t-darwin64-biarch
Removed:
    branches/gcc-7-branch/gcc/config/i386/darwin64.h
    branches/gcc-7-branch/gcc/config/i386/t-darwin
    branches/gcc-7-branch/gcc/config/i386/t-darwin64
    branches/gcc-7-branch/gcc/config/rs6000/darwin64.h
    branches/gcc-7-branch/gcc/config/rs6000/t-darwin64
    branches/gcc-7-branch/gcc/config/rs6000/t-darwin8
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/config.gcc
    branches/gcc-7-branch/gcc/config/i386/darwin.h
    branches/gcc-7-branch/gcc/config/rs6000/darwin.h

Reply via email to