Skip to content

Commit

Permalink
OpenBLAS: fix linking on older Mac versions
Browse files Browse the repository at this point in the history
Tweak ar options instead of using weak linking. Ensure that the
_xerbla_ symbol exists by always writing the correct xerbla.c.o file
to the archive regardless of compilation order.

Fixes: https://trac.macports.org/ticket/68810
  • Loading branch information
erikbs committed Dec 3, 2023
1 parent ec06943 commit ba2e563
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
8 changes: 4 additions & 4 deletions math/OpenBLAS/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ if {[string first "-devel" $subport] > 0} {
checksums rmd160 30577718a2f6880b2c9a799fa0dcf8830ef91c47 \
sha256 7be7acf6cc22c55a36980953942e1f6fecadf993bd6e02b793b70e15fbd25e9e \
size 24307835
revision 1
revision 2

conflicts OpenBLAS

patchfiles patch-libnoarch.devel.diff \
patch-openblas.pc-fixed-version-and-url.diff \
patch-enable-overstep-of-too-long-args-without-DYNAMIC_ARCH.diff \
patch-weak-linking-old-macos.diff \
patch-ar-options-old-macos.diff \
patch-OpenBLAS-old-macos.diff \
patch-OpenBLAS-i386-Apple.diff

Expand All @@ -56,15 +56,15 @@ if {[string first "-devel" $subport] > 0} {
checksums rmd160 eea6fe2c33762df4c47c7241808dabbdb085eed3 \
sha256 4c25cb30c4bb23eddca05d7d0a85997b8db6144f5464ba7f8c09ce91e2f35543 \
size 24073168
revision 3
revision 4

conflicts OpenBLAS-devel

patchfiles patch-libnoarch.release.diff \
patch-xcode15-fix.diff \
patch-openblas.pc-fixed-version-and-url.diff \
patch-enable-overstep-of-too-long-args-without-DYNAMIC_ARCH.diff \
patch-weak-linking-old-macos.diff \
patch-ar-options-old-macos.diff \
patch-OpenBLAS-old-macos.diff \
patch-OpenBLAS-i386-Apple.diff

Expand Down
10 changes: 10 additions & 0 deletions math/OpenBLAS/files/patch-ar-options-old-macos.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git CMakeLists.txt CMakeLists.txt
index 7c6b96f41..7e5d1e0fb 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -257,1 +257,1 @@ "sh -c 'cat ${CMAKE_BINARY_DIR}/CMakeFiles/openblas_shared.dir/objects*.rsp | xargs -n 1024 ${CMAKE_AR} -ru libopenblas.a && exit 0' "
- "sh -c '${CMAKE_AR} -ru libopenblas.a ${CMAKE_BINARY_DIR}/driver/others/CMakeFiles/driver_others.dir/xerbla.c.o && exit 0' "
+ "sh -c '${CMAKE_AR} -rs libopenblas.a ${CMAKE_BINARY_DIR}/driver/others/CMakeFiles/driver_others.dir/xerbla.c.o && exit 0' "
@@ -266,1 +266,1 @@ "sh -c 'cat ${CMAKE_BINARY_DIR}/CMakeFiles/openblas_shared.dir/objects*.rsp | xargs -n 1024 ${CMAKE_AR} -ru libopenblas.a && exit 0' "
- "sh -c '${CMAKE_AR} -ru libopenblas.a ${CMAKE_BINARY_DIR}/driver/others/CMakeFiles/driver_others.dir/xerbla.c.o && exit 0' "
+ "sh -c '${CMAKE_AR} -rs libopenblas.a ${CMAKE_BINARY_DIR}/driver/others/CMakeFiles/driver_others.dir/xerbla.c.o && exit 0' "
21 changes: 0 additions & 21 deletions math/OpenBLAS/files/patch-weak-linking-old-macos.diff

This file was deleted.

0 comments on commit ba2e563

Please sign in to comment.