Skip to content

Commit 8e8d50e

Browse files
committed
config stdc++ for llvm too 3
1 parent 9b3bfc4 commit 8e8d50e

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

_build.sh

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,32 +1128,6 @@ build_single_target() {
11281128
fi
11291129
fi
11301130

1131-
if [ "${_HOST}" = 'linux' ] && [ "${_OS}" = 'linux' ] && [ "${unamem}" != "${_machine}" ] && [ "${_DISTRO}" = 'debian' ]; then
1132-
# https://packages.debian.org/testing/all/libstdc++-13-dev-arm64-cross/filelist
1133-
# /usr/aarch64-linux-gnu/include/c++/13/
1134-
tmp="$(find "/usr/${_TRIPLETSH}/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1135-
if [ -n "${tmp}" ]; then
1136-
_CXXFLAGS_GLOBAL+=" -I${tmp}"
1137-
_CXXFLAGS_GLOBAL+=" -I${tmp}/${_TRIPLETSH}"
1138-
_CXXFLAGS_GLOBAL+=" -I${tmp}/backward"
1139-
else
1140-
# https://packages.debian.org/trixie/arm64/libstdc++-12-dev/filelist
1141-
# /usr/include/c++/12/algorithm
1142-
# /usr/include/aarch64-linux-gnu/c++/12/ext/opt_random.h
1143-
tmp1="$(find "/usr/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1144-
tmp2="$(find "/usr/include/${_TRIPLETSH}/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1145-
if [ -n "${tmp1}" ] && \
1146-
[ -n "${tmp2}" ]; then
1147-
_CXXFLAGS_GLOBAL+=" -I${tmp1}"
1148-
_CXXFLAGS_GLOBAL+=" -I${tmp2}"
1149-
_CXXFLAGS_GLOBAL+=" -I${tmp1}/backward"
1150-
else
1151-
>&2 echo '! Error: Failed to detect g++-cross env root.'
1152-
exit 1
1153-
fi
1154-
fi
1155-
fi
1156-
11571131
# TODO: enable it for platform native compiler + mingw-w64 when support reaches them.
11581132
if [ "${_TOOLCHAIN}" = 'llvm-mingw' ]; then
11591133
# Requires llvm v16 and mingw-w64 v11 built with `--enable-cfguard`.
@@ -1244,6 +1218,32 @@ build_single_target() {
12441218
_BINUTILS_SUFFIX="${_CCSUFFIX}"
12451219
fi
12461220

1221+
if [ "${_HOST}" = 'linux' ] && [ "${_OS}" = 'linux' ] && [ "${unamem}" != "${_machine}" ] && [ "${_DISTRO}" = 'debian' ]; then
1222+
# https://packages.debian.org/testing/all/libstdc++-13-dev-arm64-cross/filelist
1223+
# /usr/aarch64-linux-gnu/include/c++/13/
1224+
tmp="$(find "/usr/${_TRIPLETSH}/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1225+
if [ -n "${tmp}" ]; then
1226+
_CXXFLAGS_GLOBAL+=" -I${tmp}"
1227+
_CXXFLAGS_GLOBAL+=" -I${tmp}/${_TRIPLETSH}"
1228+
_CXXFLAGS_GLOBAL+=" -I${tmp}/backward"
1229+
else
1230+
# https://packages.debian.org/trixie/arm64/libstdc++-12-dev/filelist
1231+
# /usr/include/c++/12/algorithm
1232+
# /usr/include/aarch64-linux-gnu/c++/12/ext/opt_random.h
1233+
tmp1="$(find "/usr/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1234+
tmp2="$(find "/usr/include/${_TRIPLETSH}/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1235+
if [ -n "${tmp1}" ] && \
1236+
[ -n "${tmp2}" ]; then
1237+
_CXXFLAGS_GLOBAL+=" -I${tmp1}"
1238+
_CXXFLAGS_GLOBAL+=" -I${tmp2}"
1239+
_CXXFLAGS_GLOBAL+=" -I${tmp1}/backward"
1240+
else
1241+
>&2 echo '! Error: Failed to detect g++-cross env root.'
1242+
exit 1
1243+
fi
1244+
fi
1245+
fi
1246+
12471247
# Avoid picking up dependencies from system locations
12481248
export PKG_CONFIG_LIBDIR=
12491249

0 commit comments

Comments
 (0)