Skip to content

Commit 4402701

Browse files
authored
Fix clock_gettime errors on old macOS machines (#134)
Our GCC shards did not correctly configure themselves to target the oldest supported macOS build. Instead, because GCC doesn't fully understand how to use the availability macros that macOS uses, it assumed that it was able to use `clock_gettime()`, which caused a reliance on that symbol within `libgfortran` itself. This resulted in our CSL being unusable on macOS 10.11 and earlier. This PR updates the GCC shards [0] and also adds compiler flags to enforce that users who attempt to use `gcc` on macOS do not end up making the same mistake. [0] JuliaPackaging/Yggdrasil#2836
1 parent 12bdfb4 commit 4402701

File tree

2 files changed

+68
-52
lines changed

2 files changed

+68
-52
lines changed

Artifacts.toml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,157 +1254,157 @@ os = "linux"
12541254

12551255
[["GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.squashfs"]]
12561256
arch = "x86_64"
1257-
git-tree-sha1 = "bea32c300b87f79585268bccfc27bc7559e2f58f"
1257+
git-tree-sha1 = "26139b79927c0f2557c200bd01ce1adfaa816d46"
12581258
lazy = true
12591259
libc = "musl"
12601260
os = "linux"
12611261

12621262
[["GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.squashfs".download]]
1263-
sha256 = "a52bc662da73dcdf422d1768e0c985320a65c8e7348d4de99f43d1791775573a"
1264-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v10.2.0+0/GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.squashfs.tar.gz"
1263+
sha256 = "51a81cb1a2dbea1aa3875b6cef521204580a2f372daecd7140b07c84a59c85a9"
1264+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v10.2.0+1/GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.squashfs.tar.gz"
12651265

12661266
[["GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.unpacked"]]
12671267
arch = "x86_64"
1268-
git-tree-sha1 = "c7130ed1e7ce7f2330842114bad067a476427cc3"
1268+
git-tree-sha1 = "0108431575f65015dabb33516464ad34e4cf993b"
12691269
lazy = true
12701270
libc = "musl"
12711271
os = "linux"
12721272

12731273
[["GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.unpacked".download]]
1274-
sha256 = "3b3ca560e23fe22271fea2bbd357d3c9cd83821d6688cc59217aacb1fb9d59c5"
1275-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v10.2.0+0/GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.unpacked.tar.gz"
1274+
sha256 = "6833d89663385af03d31f97cf26c34664ba7afbcf4c629ef7de891fddab09334"
1275+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v10.2.0+1/GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.unpacked.tar.gz"
12761276

12771277
[["GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.squashfs"]]
12781278
arch = "x86_64"
1279-
git-tree-sha1 = "f7915abce1746466c4638ac778eb63c87c9b4e87"
1279+
git-tree-sha1 = "665a96279cda5d5cf23f13ce3970353b5c1f2ec8"
12801280
lazy = true
12811281
libc = "musl"
12821282
os = "linux"
12831283

12841284
[["GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.squashfs".download]]
1285-
sha256 = "2858f85eb64f289d93ebcacf992297623c85748b501bdbe8038b6fa1100728d7"
1286-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v4.8.5+6/GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.squashfs.tar.gz"
1285+
sha256 = "a5d7d63f98c789aca3c5d313d2039bcef00c83515a2988b899f828fe48344c8b"
1286+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v4.8.5+7/GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.squashfs.tar.gz"
12871287

12881288
[["GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.unpacked"]]
12891289
arch = "x86_64"
1290-
git-tree-sha1 = "678e51f4b65e4d344faaa59ce05286f4f61b18e7"
1290+
git-tree-sha1 = "243126f2ab5d127398cd82a9ea290ed317990e4f"
12911291
lazy = true
12921292
libc = "musl"
12931293
os = "linux"
12941294

12951295
[["GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.unpacked".download]]
1296-
sha256 = "1f59dc2e245d94d13048b4968c17f832d282fe95986291157407b58bee22b4a4"
1297-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v4.8.5+6/GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.unpacked.tar.gz"
1296+
sha256 = "022fa2e36eceff87ed5857c8a3ec7039bf38f55f394130702a901f96d525d285"
1297+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v4.8.5+7/GCCBootstrap-x86_64-apple-darwin14.v4.8.5.x86_64-linux-musl.unpacked.tar.gz"
12981298

12991299
[["GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.squashfs"]]
13001300
arch = "x86_64"
1301-
git-tree-sha1 = "8db4790c25c4b9ff23725e23d1265500a403dead"
1301+
git-tree-sha1 = "c6093f4ae602881b065d22a7c94f58e4a2015936"
13021302
lazy = true
13031303
libc = "musl"
13041304
os = "linux"
13051305

13061306
[["GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.squashfs".download]]
1307-
sha256 = "eaf53c090b336377804a126f4be7eed12df6fd11c080f106d2a78f0f4c119e0f"
1308-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v5.2.0+4/GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.squashfs.tar.gz"
1307+
sha256 = "b8eeaa34499ae14ac49075ac3e38b3bcf1067d06220a2e3d4fdd37486fb6f6cd"
1308+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v5.2.0+5/GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.squashfs.tar.gz"
13091309

13101310
[["GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.unpacked"]]
13111311
arch = "x86_64"
1312-
git-tree-sha1 = "522feb508d32f12cca1180cf6df09309b1fc910d"
1312+
git-tree-sha1 = "1c42475fe174b81481b4d8d11239dbf85e469b42"
13131313
lazy = true
13141314
libc = "musl"
13151315
os = "linux"
13161316

13171317
[["GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.unpacked".download]]
1318-
sha256 = "fb2eb159e85828758f4204c4f1653e3d67545d9bed19ca96370200fad3abd327"
1319-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v5.2.0+4/GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.unpacked.tar.gz"
1318+
sha256 = "5776b16befe684ce2f3a6721bf5a00e3a0bc546ea2acdf3464d8cfcaf8b5d56c"
1319+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v5.2.0+5/GCCBootstrap-x86_64-apple-darwin14.v5.2.0.x86_64-linux-musl.unpacked.tar.gz"
13201320

13211321
[["GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.squashfs"]]
13221322
arch = "x86_64"
1323-
git-tree-sha1 = "c595c01b3a935f5e94de54324ef78cc200c5dca4"
1323+
git-tree-sha1 = "7dc77333ecfafac3f50dd1313625eef60f62d253"
13241324
lazy = true
13251325
libc = "musl"
13261326
os = "linux"
13271327

13281328
[["GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.squashfs".download]]
1329-
sha256 = "f82528aa0e465a55a67947f401f89a54551ed97422eacf01a4e4e6d10326161e"
1330-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v6.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.squashfs.tar.gz"
1329+
sha256 = "9e3e7efb69c31cfff02c735e8f808373fcadf2961cd89bdba8d173e0c69af9f0"
1330+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v6.1.0+5/GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.squashfs.tar.gz"
13311331

13321332
[["GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.unpacked"]]
13331333
arch = "x86_64"
1334-
git-tree-sha1 = "9ffeb139defce72dc3311f48441a37393b455c36"
1334+
git-tree-sha1 = "47a7f1888388d4a9fdb81c78159ef8574ef9360d"
13351335
lazy = true
13361336
libc = "musl"
13371337
os = "linux"
13381338

13391339
[["GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.unpacked".download]]
1340-
sha256 = "02aacf1284f8f26ea94ca9dce610a5f1945df4dc2f091f52b6d5c9a087ae277c"
1341-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v6.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.unpacked.tar.gz"
1340+
sha256 = "c4d01f7bfaf7d9110e14fdc335968a0d50cd5c9511336403f31c9235a58860a4"
1341+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v6.1.0+5/GCCBootstrap-x86_64-apple-darwin14.v6.1.0.x86_64-linux-musl.unpacked.tar.gz"
13421342

13431343
[["GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.squashfs"]]
13441344
arch = "x86_64"
1345-
git-tree-sha1 = "edc1c72616c19f01403ba811a42ec78aa5a84485"
1345+
git-tree-sha1 = "df7ae73168e03c18551caa67d3dc657f9c63ef42"
13461346
lazy = true
13471347
libc = "musl"
13481348
os = "linux"
13491349

13501350
[["GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.squashfs".download]]
1351-
sha256 = "03d31b11924223be6346a0472b42b32c05a6289958d6d892e50c165c90548574"
1352-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v7.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.squashfs.tar.gz"
1351+
sha256 = "f9933766c45497682123bf9afb78c7a349897fb71e920531d3cbc7a74bbc81ad"
1352+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v7.1.0+5/GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.squashfs.tar.gz"
13531353

13541354
[["GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.unpacked"]]
13551355
arch = "x86_64"
1356-
git-tree-sha1 = "0ad4499ebb8c7c02db00dec492971836e2e0e5d2"
1356+
git-tree-sha1 = "1231eeb9af98fb4524f46a598cd2393c335e7770"
13571357
lazy = true
13581358
libc = "musl"
13591359
os = "linux"
13601360

13611361
[["GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.unpacked".download]]
1362-
sha256 = "70a5412c23d088838608ab8d7f39a6e4c5870123ec22507dd27b470287dd72f6"
1363-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v7.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.unpacked.tar.gz"
1362+
sha256 = "f534b25ea7ed546e09ea95a8f8ab666308351e9ab6445424fc29a31ab4891bfc"
1363+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v7.1.0+5/GCCBootstrap-x86_64-apple-darwin14.v7.1.0.x86_64-linux-musl.unpacked.tar.gz"
13641364

13651365
[["GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.squashfs"]]
13661366
arch = "x86_64"
1367-
git-tree-sha1 = "498361f8826b4dc7c65281af2dbf2fbd134193f3"
1367+
git-tree-sha1 = "dcb3a04dad0a2c82079128c691343d0bfa6e63b3"
13681368
lazy = true
13691369
libc = "musl"
13701370
os = "linux"
13711371

13721372
[["GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.squashfs".download]]
1373-
sha256 = "601647964228c9df17cb6012aae4ccdfe1f59d9dacbeac9219ab01f717729449"
1374-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v8.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.squashfs.tar.gz"
1373+
sha256 = "c108e6d7a4f763da2603d7c8143296b7dde3f6440b8d88f5fd07360c5195f0d4"
1374+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v8.1.0+5/GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.squashfs.tar.gz"
13751375

13761376
[["GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.unpacked"]]
13771377
arch = "x86_64"
1378-
git-tree-sha1 = "7f8518c7a9f40a9eb0d43a35e2fbbce88e05d785"
1378+
git-tree-sha1 = "aaa4fdfa7ee9b0562153e095b1bf42e1d42f770d"
13791379
lazy = true
13801380
libc = "musl"
13811381
os = "linux"
13821382

13831383
[["GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.unpacked".download]]
1384-
sha256 = "6e5a592f0e3acfd0f74d7fc55cfd3250cee9041d27ceaa6759b1fb373320d566"
1385-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v8.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.unpacked.tar.gz"
1384+
sha256 = "6fe75c3b1dd0ed409a57b9d9ddb40d2eaaa64ef0c7a005eef4717c19ac135093"
1385+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v8.1.0+5/GCCBootstrap-x86_64-apple-darwin14.v8.1.0.x86_64-linux-musl.unpacked.tar.gz"
13861386

13871387
[["GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.squashfs"]]
13881388
arch = "x86_64"
1389-
git-tree-sha1 = "53ffd834e425216ed1f23a9a6002d119318bb367"
1389+
git-tree-sha1 = "dd9960b837f5c33863b6974c43789fb63c5b595f"
13901390
lazy = true
13911391
libc = "musl"
13921392
os = "linux"
13931393

13941394
[["GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.squashfs".download]]
1395-
sha256 = "50dbce1074dc64b395e24546f1d82cddf184b1465938c142929473cb5d800ec6"
1396-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v9.1.0+3/GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.squashfs.tar.gz"
1395+
sha256 = "9735ccb4b0dc65a70f43f8072f1323bbf4881d3f01425804b715286ccdd63b19"
1396+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v9.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.squashfs.tar.gz"
13971397

13981398
[["GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.unpacked"]]
13991399
arch = "x86_64"
1400-
git-tree-sha1 = "becb09d6c7810ed490746c7e4c5a6968cd897c09"
1400+
git-tree-sha1 = "d30568b763191bfc499ad25c8985ee0f30893cc8"
14011401
lazy = true
14021402
libc = "musl"
14031403
os = "linux"
14041404

14051405
[["GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.unpacked".download]]
1406-
sha256 = "bebee6ef684d0b708d5a8efa2fded213d7f1e48f2d9e677ce2ac09de402fd0f5"
1407-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v9.1.0+3/GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.unpacked.tar.gz"
1406+
sha256 = "052c0e1c06baf9f97b3892947b878f744c7173cbd614ddbd19b7146336b43859"
1407+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v9.1.0+4/GCCBootstrap-x86_64-apple-darwin14.v9.1.0.x86_64-linux-musl.unpacked.tar.gz"
14081408

14091409
[["GCCBootstrap-x86_64-linux-gnu.v10.2.0.x86_64-linux-musl.squashfs"]]
14101410
arch = "x86_64"

src/Runner.jl

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
236236
return flags
237237
end
238238

239-
function min_macos_version_flag(p::AbstractPlatform)
240-
# If no `os_version` is specified in `p`, default to the oldest we support in the Julia world,
241-
# which is `10.8`, but if it is actually specified, then set that corresponding value.
242-
#min_macos_version = something(os_version(p), v"14.0.0")
243-
244-
# Eventually, we'll take this in `os_version(p)`, but not just yet. We need to fix the paths
245-
# to the compiler shards first, since right now they have `14` at the end
246-
min_macos_version = v"14.0.0"
247-
239+
function macos_version(kernel_version::Integer)
248240
kernel_to_macos = Dict(
249241
12 => "10.8",
250242
13 => "10.9",
@@ -256,9 +248,26 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
256248
19 => "10.15",
257249
20 => "11.0",
258250
)
251+
return get(kernel_to_macos, kernel_version, nothing)
252+
end
253+
function macos_version(p::AbstractPlatform)
254+
if os(p) != "macos"
255+
return nothing
256+
end
259257

258+
# If no `os_version` is specified in `p`, default to the oldest we support in the Julia world,
259+
# which is `10.8`, but if it is actually specified, then set that corresponding value.
260+
#version = something(os_version(p), v"14.0.0")
261+
262+
# Eventually, we'll take this in `os_version(p)`, but not just yet. We need to fix the paths
263+
# to the compiler shards first, since right now they have `14` at the end
264+
version = v"14.0.0"
265+
return macos_version(version.major)
266+
end
267+
268+
function min_macos_version_flag(p::AbstractPlatform)
260269
# Ask compilers to compile for a minimum macOS version
261-
return "-mmacosx-version-min=$(kernel_to_macos[min_macos_version.major])"
270+
return "-mmacosx-version-min=$(macos_version(p))"
262271
end
263272

264273
function clang_compile_flags!(p::AbstractPlatform, flags::Vector{String} = String[])
@@ -322,6 +331,13 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
322331
push!(flags, "-D_GLIBCXX_USE_CXX11_ABI=0")
323332
end
324333

334+
# Simulate some of the `__OSX_AVAILABLE()` macro usage that is broken in GCC
335+
# Currently, we only target 10.10, but eventually, we'll want to tailor this to `os_version(p)`
336+
if 14 < 16
337+
# Disable usage of `clock_gettime()`
338+
push!(flags, "-D_DARWIN_FEATURE_CLOCK_GETTIME=0")
339+
end
340+
325341
# Use hash of arguments to provide consistent, unique random seed
326342
push!(flags, "-frandom-seed=0x\${ARGS_HASH}")
327343

0 commit comments

Comments
 (0)