]> gcc.gnu.org Git - gcc.git/commit
Darwin: Truncate kernel-provided version to OS major for Darwin >= 20.
authorSimon Wright <simon@pushface.org>
Sun, 12 Jun 2022 16:01:22 +0000 (17:01 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 15 Jun 2022 19:08:00 +0000 (20:08 +0100)
commit64f5efce03c248af7f51d600b5519f46f64eea48
tree36044bdae1fe233911b6469c82d79d3d882e09cf
parentbe343e001eb9744e63d04035600a2520332a8b0a
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 should
include both major and minium version identifiers.  However the system tools
(for those versions) truncate the value to the major version - this leads to
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.

gcc/ChangeLog:

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

(cherry picked from commit add1adaa17a294ea25918ffb4fdd40f115362632)
gcc/config/darwin-driver.cc
This page took 0.067234 seconds and 6 git commands to generate.