Skip to content

Commit e29ec49

Browse files
committed
macOS targeting fixes
1 parent c3e8fd4 commit e29ec49

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

BinaryBuilderAuditor.jl/src/SystemLibraries.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function is_system_library(soname::AbstractString, platform::AbstractPlatform)
110110
]
111111
csl_libs = [
112112
"libgcc_s.1.dylib",
113+
"libgcc_s.1.1.dylib",
113114
]
114115
return lowercase(soname) vcat(ignore_libs, csl_libs)
115116
elseif os(platform) == "windows"

BinaryBuilderAuditor.jl/src/passes/DynamicLinkage.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function resolve_dynamic_links!(scan::ScanResult,
88
dep_soname_map = Dict{String,Tuple{Symbol,Symbol}}()
99
for (jll_name, libs) in dep_libs
1010
for lib in libs
11-
dep_soname_map[lib.soname] = (Symbol(string(jll_name, "_jll")), lib.varname)
11+
dep_soname_map[basename(lib.soname)] = (Symbol(string(jll_name, "_jll")), lib.varname)
1212
end
1313
end
1414

@@ -147,7 +147,7 @@ function rpaths_consistent!(scan::ScanResult,
147147
soname_locator = copy(scan.soname_locator)
148148
for (_, libs) in dep_libs
149149
for lib in libs
150-
soname_locator[lib.soname] = lib.path
150+
soname_locator[basename(lib.soname)] = lib.path
151151
end
152152
end
153153

BinaryBuilderToolchains.jl/src/toolchains/CToolchain.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,7 @@ function toolchain_env(toolchain::CToolchain, deployed_prefix::String)
691691
set_envvars(env_prefix, wrapper_prefix)
692692
end
693693

694-
sdk_jll = get_jll(toolchain, "macOSSDK_jll")
695-
if sdk_jll !== nothing
694+
if Sys.isapple(toolchain.platform.target)
696695
# If toolchain platform already has an `os_version`, we need to obey that, otherwise we
697696
# use the default deployment targets for the architecture being built:
698697
function default_kernel_version(arch)
@@ -1029,7 +1028,7 @@ function clang_wrappers(toolchain::CToolchain, dir::String)
10291028
if is_clangxx
10301029
# It's extremely rare, but some packages (such as `libc++` itself) manually set
10311030
# the `--stdlib` flag, so let's let them do their thing.
1032-
flagmatch(io, [!flag"--stdlib", !flag"--nostdlib++"]) do io
1031+
flagmatch(io, [!flag"--stdlib=.*"r, !flag"--nostdlib++"]) do io
10331032
append_flags(io, :PRE, [
10341033
# Set the C++ runtime library, but only in clang++
10351034
"--stdlib=$(get_cxx_runtime_str(toolchain))",
@@ -1155,12 +1154,12 @@ function binutils_wrappers(toolchain::CToolchain, dir::String)
11551154

11561155
# Many of our tools have nondeterministic
11571156
function _warn_nondeterministic_definition(io, nondeterminism_description="uses flags that cause nondeterministic output!")
1158-
println(io, raw"""
1157+
println(io, """
11591158
NONDETERMINISTIC=0
11601159
warn_nondeterministic() {
1161-
if [[ "${NONDETERMINISTIC}" != "1" ]]; then
1162-
echo "Non-reproducibility alert: This '$0' invocation $(nondeterminism_description)." >&2
1163-
echo "$0 flags: ${ARGS[@]}" >&2
1160+
if [[ "\${NONDETERMINISTIC}" != "1" ]]; then
1161+
echo "Non-reproducibility alert: This '\$0' invocation $(nondeterminism_description)." >&2
1162+
echo "\$0 flags: \${ARGS[@]}" >&2
11641163
echo "Continuing build, but please repent." >&2
11651164
fi
11661165
NONDETERMINISTIC=1

src/build_api/PackageConfig.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,11 @@ function add_os_version(platform::Platform, target_spec::BuildTargetSpec)
263263
end
264264

265265
tenv = toolchain_env(toolchain, "")
266-
# Get the version that the JLL corresponds to, and return!
267-
platform["os_version"] = string(version_map(tenv["MACOSX_DEPLOYMENT_TARGET"]))
268-
return platform
266+
if haskey(tenv, "MACOSX_DEPLOYMENT_TARGET")
267+
# Get the version that the JLL corresponds to, and return!
268+
platform["os_version"] = string(version_map(tenv["MACOSX_DEPLOYMENT_TARGET"]))
269+
return platform
270+
end
269271
end
270272

271273
# Unable to find an OS version, that's fine!

0 commit comments

Comments
 (0)