Skip to content

Commit

Permalink
[CompilerSupportLibraries_jll] Fix soname of libgcc_s on x86_64-darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Jul 20, 2022
1 parent cfcbd82 commit 561b313
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,18 @@ else
LIBGCC_NAME := libgcc_s_seh-1.$(SHLIB_EXT)
endif
endif
# On macOS, libgcc_s has soversion 1.1 always on aarch64 and only for GCC 12+
# (-> libgfortran 5) on x86_64
ifeq ($(OS),Darwin)
ifeq ($(ARCH),aarch64)
LIBGCC_NAME := libgcc_s.1.1.$(SHLIB_EXT)
else
ifeq ($(LIBGFORTRAN_VERSION),5)
LIBGCC_NAME := libgcc_s.1.1.$(SHLIB_EXT)
else
LIBGCC_NAME := libgcc_s.1.$(SHLIB_EXT)
endif
endif
endif
ifneq ($(findstring $(OS),Linux FreeBSD),)
LIBGCC_NAME := libgcc_s.$(SHLIB_EXT).1
Expand Down
8 changes: 8 additions & 0 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,19 @@ else ifneq ($(USE_SYSTEM_OPENLIBM),0)
$(eval $(call symlink_system_library,OPENLIBM,$(LIBMNAME)))
endif

# On macOS, libgcc_s has soversion 1.1 always on aarch64 and only for GCC 12+
# (-> libgfortran 5) on x86_64
ifeq ($(OS),Darwin)
ifeq ($(ARCH),aarch64)
$(eval $(call symlink_system_library,CSL,libgcc_s,1.1))
else
ifeq ($(LIBGFORTRAN_VERSION),5)
$(eval $(call symlink_system_library,CSL,libgcc_s,1.1))
else
$(eval $(call symlink_system_library,CSL,libgcc_s,1))
endif
endif
endif
ifneq (,$(LIBGFORTRAN_VERSION))
$(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION)))
endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ if Sys.iswindows()
const libstdcxx = "libstdc++-6.dll"
const libgomp = "libgomp-1.dll"
elseif Sys.isapple()
const libgcc_s = "@rpath/libgcc_s.1.1.dylib"
if arch(HostPlatform()) == "aarch64" || libgfortran_version(HostPlatform()) == v"5"
const libgcc_s = "@rpath/libgcc_s.1.1.dylib"
else
const libgcc_s = "@rpath/libgcc_s.1.dylib"
end
const libgfortran = string("@rpath/", "libgfortran.", libgfortran_version(HostPlatform()).major, ".dylib")
const libstdcxx = "@rpath/libstdc++.6.dylib"
const libgomp = "@rpath/libgomp.1.dylib"
Expand Down

0 comments on commit 561b313

Please sign in to comment.