Skip to content

Commit ade139e

Browse files
committed
add leading underscores for 32-bit symbol names
1 parent 9014d04 commit ade139e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/build_openblas.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,16 @@ make PREFIX=$openblas_root/$build_bits $interface_flags install
103103
DLL_BASENAME=libscipy_openblas${SYMBOLSUFFIX}_${LIBNAMESUFFIX}
104104

105105
# OpenBLAS does not build a symbol-suffixed static library on Windows:
106-
# do it ourselves
106+
# do it ourselves. On 32-bit builds, the objcopy.def names need a '_' prefix
107107
static_libname=$(find . -maxdepth 1 -type f -name '*.a' \! -name '*.dll.a' | tail -1)
108108
make -C exports $interface_flags objcopy.def
109+
110+
if [ "$build_bits" == 32 ]; then
111+
sed -i "s/^/_/" exports/objcopy.def
112+
sed -i "s/scipy_/_scipy_/" exports/objcopy.def
113+
echo "make sure both columns have leading underscores"
114+
head -10 exports/objcopy.def
115+
fi
109116
objcopy --redefine-syms exports/objcopy.def "${static_libname}" "${static_libname}.renamed"
110117
cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${static_libname}"
111118
cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${DLL_BASENAME}.a"

0 commit comments

Comments
 (0)