Skip to content

Commit

Permalink
add leading underscores for 32-bit symbol names
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Nov 3, 2023
1 parent 9014d04 commit ade139e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/build_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,16 @@ make PREFIX=$openblas_root/$build_bits $interface_flags install
DLL_BASENAME=libscipy_openblas${SYMBOLSUFFIX}_${LIBNAMESUFFIX}

# OpenBLAS does not build a symbol-suffixed static library on Windows:
# do it ourselves
# do it ourselves. On 32-bit builds, the objcopy.def names need a '_' prefix
static_libname=$(find . -maxdepth 1 -type f -name '*.a' \! -name '*.dll.a' | tail -1)
make -C exports $interface_flags objcopy.def

if [ "$build_bits" == 32 ]; then
sed -i "s/^/_/" exports/objcopy.def
sed -i "s/scipy_/_scipy_/" exports/objcopy.def
echo "make sure both columns have leading underscores"
head -10 exports/objcopy.def
fi
objcopy --redefine-syms exports/objcopy.def "${static_libname}" "${static_libname}.renamed"
cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${static_libname}"
cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${DLL_BASENAME}.a"
Expand Down

0 comments on commit ade139e

Please sign in to comment.