Skip to content

Commit 02de741

Browse files
committed
_build.sh: blind try for debian musl missing <memory> C++ header
1 parent 0b0b785 commit 02de741

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

_build.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,18 +1108,22 @@ build_single_target() {
11081108
_CXXFLAGS_GLOBAL+=" -I${tmp}/include/c++/${_TRIPLET}"
11091109
_CXXFLAGS_GLOBAL+=" -I${tmp}/include/c++/backward"
11101110
fi
1111-
elif [ "${_HOST}" = 'linux' ] && [ "${_OS}" = 'linux' ] && [ "${unamem}" != "${_machine}" ] && [ "${_CC}" = 'llvm' ] && [ "${_CRT}" != 'musl' ]; then
1112-
_CFLAGS_GLOBAL+=" -isystem /usr/${_TRIPLETSH}/include"
1113-
_LDFLAGS_GLOBAL+=" -L/usr/${_TRIPLETSH}/lib"
1114-
if [ "${_CCRT}" = 'libgcc' ]; then
1115-
# https://packages.debian.org/testing/all/libgcc-13-dev-arm64-cross/filelist
1116-
# /usr/lib/gcc-cross/aarch64-linux-gnu/13/
1117-
tmp="$(find "/usr/lib/gcc-cross/${_TRIPLETSH}" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1118-
if [ -z "${tmp}" ]; then
1119-
>&2 echo '! Error: Failed to detect gcc-cross env root.'
1120-
exit 1
1111+
elif [ "${_HOST}" = 'linux' ] && [ "${_OS}" = 'linux' ] && [ "${unamem}" != "${_machine}" ] && [ "${_CC}" = 'llvm' ]; then
1112+
if [ "${_CRT}" != 'musl' ]; then
1113+
_CFLAGS_GLOBAL+=" -isystem /usr/${_TRIPLETSH}/include"
1114+
_LDFLAGS_GLOBAL+=" -L/usr/${_TRIPLETSH}/lib"
1115+
if [ "${_CCRT}" = 'libgcc' ]; then
1116+
# https://packages.debian.org/testing/all/libgcc-13-dev-arm64-cross/filelist
1117+
# /usr/lib/gcc-cross/aarch64-linux-gnu/13/
1118+
tmp="$(find "/usr/lib/gcc-cross/${_TRIPLETSH}" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1119+
if [ -z "${tmp}" ]; then
1120+
>&2 echo '! Error: Failed to detect gcc-cross env root.'
1121+
exit 1
1122+
fi
1123+
_LDFLAGS_GLOBAL+=" -L${tmp}"
11211124
fi
1122-
_LDFLAGS_GLOBAL+=" -L${tmp}"
1125+
fi
1126+
if [ "${_DISTRO}" = 'debian' ]; then
11231127
# https://packages.debian.org/testing/all/libstdc++-13-dev-arm64-cross/filelist
11241128
# /usr/aarch64-linux-gnu/include/c++/13/
11251129
tmp="$(find "/usr/${_TRIPLETSH}/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"

0 commit comments

Comments
 (0)