File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -904,12 +904,13 @@ function detect_libgfortran_version()
904
904
end
905
905
906
906
"""
907
- detect_libstdcxx_version()
907
+ detect_libstdcxx_version(max_minor_version::Int=30 )
908
908
909
909
Inspects the currently running Julia process to find out what version of libstdc++
910
- it is linked against (if any).
910
+ it is linked against (if any). `max_minor_version` is the latest version in the
911
+ 3.4 series of GLIBCXX where the search is performed.
911
912
"""
912
- function detect_libstdcxx_version ()
913
+ function detect_libstdcxx_version (max_minor_version :: Int = 30 )
913
914
libstdcxx_paths = filter (x -> occursin (" libstdc++" , x), Libdl. dllist ())
914
915
if isempty (libstdcxx_paths)
915
916
# This can happen if we were built by clang, so we don't link against
@@ -919,7 +920,9 @@ function detect_libstdcxx_version()
919
920
920
921
# Brute-force our way through GLIBCXX_* symbols to discover which version we're linked against
921
922
hdl = Libdl. dlopen (first (libstdcxx_paths))
922
- for minor_version in 26 : - 1 : 18
923
+ # Try all GLIBCXX versions down to GCC v4.8:
924
+ # https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
925
+ for minor_version in max_minor_version: - 1 : 18
923
926
if Libdl. dlsym (hdl, " GLIBCXX_3.4.$(minor_version) " ; throw_error= false ) != = nothing
924
927
Libdl. dlclose (hdl)
925
928
return VersionNumber (" 3.4.$(minor_version) " )
You can’t perform that action at this time.
0 commit comments