Skip to content

Commit 4f78917

Browse files
committed
config stdc++ for llvm too 3
1 parent eb00acc commit 4f78917

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`.
@@ -1245,6 +1219,32 @@ build_single_target() {
12451219
_BINUTILS_SUFFIX="${_CCSUFFIX}"
12461220
fi
12471221

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

0 commit comments

Comments
 (0)