[Bug target/104871] macosx-version-min wrong for macOS >= Big Sur (darwin20)

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 15 19:17:51 GMT 2022


--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain D Sandoe


commit r10-10848-g82b771fd6cab421d92cc074a79f98389ac8569c3
Author: Simon Wright <simon@pushface.org>
Date:   Sun Jun 12 17:01:22 2022 +0100

    Darwin: Truncate kernel-provided version to OS major for Darwin >= 20.

    In common with system tools, GCC uses a version obtained from the kernel as
    the prevailing macOS target, when that is not overridden by command line or
    environment versions (i.e. mmacosx-version-min=, MACOSX_DEPLOYMENT_TARGET).

    Presently, GCC assumes that if the OS version is >= 20, the value used
    include both major and minium version identifiers.  However the system
    (for those versions) truncate the value to the major version - this leads
    link errors when combining objects built with clang and GCC for example:

    ld: warning: object file (null.o) was built for newer macOS version (12.2)
    than being linked (12.0)

    The change here truncates the values GCC uses to the major version.


            PR target/104871
            * config/darwin-driver.c (darwin_find_version_from_kernel): If the
            version is darwin20 (macOS 11) or greater, truncate the version to
            major number.

    (cherry picked from commit add1adaa17a294ea25918ffb4fdd40f115362632)

More information about the Gcc-bugs mailing list