Skip to content

Commit

Permalink
configure-system-libraries.sh: Skip 32bit libraries during lookup on …
Browse files Browse the repository at this point in the history
…x64 Linux. OpenRA#21353
  • Loading branch information
tinix0 committed Apr 3, 2024
1 parent 0c43801 commit 5ec6e5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions configure-system-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# This file must stay /bin/sh and POSIX compliant for macOS and BSD portability.
# Copy-paste the entire script into http://shellcheck.net to check.
####

set -o errexit || exit $?

patch_config()
Expand Down Expand Up @@ -37,11 +36,18 @@ patch_config()
if [ -L "bin/${REPLACE}" ]; then
return 0
fi

KERNEL="$(uname -s)"
ARCH="$(arch)"
printf "Searching for %s... " "${LABEL}"
for DIR in ${SEARCHDIRS} ; do
for LIB in ${SEARCH}; do
if [ -f "${DIR}/${LIB}" ]; then
# x86-64 Linux might have 32-bit libraries present, link against the 64 bit libraries since there is no 32-bit Linux release of dotnet
if [ "${KERNEL}" = "Linux" ] && [ "${ARCH}" = "x86_64" ]; then
if [ "$(LANG=C file -L -b "${DIR}/${LIB}" | cut -d" " -f2)" != "64-bit" ]; then
continue
fi
fi
echo "${LIB}"
ln -s "${DIR}/${LIB}" "bin/${REPLACE}"
return 0
Expand Down

0 comments on commit 5ec6e5d

Please sign in to comment.