Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure-system-libraries.sh: Skip 32bit libraries during lookup on x64 Linux. #21353 #21382

Open
wants to merge 1 commit into
base: bleed
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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