Skip to content

Commit b41481c

Browse files
authored
Automate computation of max_minor_version for libstdcxx-ng version (#183)
* use a greater `max_minor_version` value * automate `max_minor_version` * rework `libstdcxx-ng` compat bounds * add url for versioning * add note * restore lower bound for compat * revert some parts and refactor others * update changelog * fix type error --------- Co-authored-by: Christopher Doris <github.com/cjdoris>
1 parent 237e79b commit b41481c

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Unreleased
4+
* Bug fix: detect actual libstdcxx version.
5+
36
## 0.2.28 (2025-04-09)
47
* Bug fix: remove lazy loading for backends, which is incompatible with precompilation.
58

src/resolve.jl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,14 @@ end
105105
_convert(::Type{T}, @nospecialize(x)) where {T} = convert(T, x)::T
106106

107107
# For each (V, B) in this list, if Julia has libstdc++ loaded at version at least V, then
108-
# B is a compatible bound for libstdcxx_ng.
108+
# B is a compatible bound for libstdcxx-ng.
109109
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
110+
# See https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/config/abi/pre/gnu.ver
110111
# See https://gcc.gnu.org/develop.html#timeline.
111-
# Last updated: 2024-11-08
112+
# Last updated: 2025-05-11
112113
const _compatible_libstdcxx_ng_versions = [
113-
(v"3.4.33", ">=3.4,<14.3"),
114+
(v"3.4.34", ">=3.4,<=15.1"),
115+
(v"3.4.33", ">=3.4,<15.0"),
114116
(v"3.4.32", ">=3.4,<14.0"),
115117
(v"3.4.31", ">=3.4,<13.2"),
116118
(v"3.4.30", ">=3.4,<13.0"),
@@ -127,6 +129,13 @@ const _compatible_libstdcxx_ng_versions = [
127129
(v"3.4.19", ">=3.4,<4.9"),
128130
]
129131

132+
const _libstdcxx_max_minor_version = let
133+
v = _compatible_libstdcxx_ng_versions[1][1]
134+
@assert v.major == 3
135+
@assert v.minor == 4
136+
Int(v.patch)
137+
end
138+
130139
"""
131140
_compatible_libstdcxx_ng_version()
132141
@@ -148,7 +157,7 @@ function _compatible_libstdcxx_ng_version()
148157
if !Sys.islinux()
149158
return nothing
150159
end
151-
loaded_libstdcxx_version = Base.BinaryPlatforms.detect_libstdcxx_version()
160+
loaded_libstdcxx_version = Base.BinaryPlatforms.detect_libstdcxx_version(_libstdcxx_max_minor_version)
152161
if loaded_libstdcxx_version === nothing
153162
return nothing
154163
end

0 commit comments

Comments
 (0)