In gcc/config/darwin-driver.c, darwin_find_version_from_kernel() assumes that the minor version in the Darwin kernel version (16.7.0, => minor version 7) is equal to the bugfix component of the macOS version, so that the compiler receives -mmacosx-version-min=10.12.7 and the linker receives -macosx_version_min 10.12.7. Unfortunately, Apple don’t apply this algorithm; the macOS version is actually 10.12.6. Getting this wrong means that it’s impossible to run an executable from within a bundle: Sierra complains "You have macOS 10.12.6. The application requires macOS 10.12.7 or later". A workround would perhaps be to link the executable with -Wl,-macosx_version_min,`sw_vers -productVersion` (I assume that it’s only the linker phase that matters?) I see that Apple’s gcc (Apple LLVM version 8.0.0 (clang-800.0.42.1)) specifies - only at link time - -macosx_version_min 10.12.0 This patch does the same. gcc/Changelog: 2017-09-01 Simon Wright PR target/80204 * config/darwin-driver.c (darwin_find_version_from_kernel): eliminate calculation of the minor version, always output as 0.