Skip to content

Commit b3e5c92

Browse files
committed
config stdc++ for llvm too 3
1 parent 6ba4c89 commit b3e5c92

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
@@ -1123,32 +1123,6 @@ build_single_target() {
11231123
fi
11241124
fi
11251125

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

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

0 commit comments

Comments
 (0)