Skip to content

Commit eb00acc

Browse files
committed
config stdc++ for llvm too 2
1 parent 3e7eb85 commit eb00acc

File tree

1 file changed

+33
-37
lines changed

1 file changed

+33
-37
lines changed

_build.sh

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,47 +1113,43 @@ build_single_target() {
11131113
_CXXFLAGS_GLOBAL+=" -I${tmp}/include/c++/${_TRIPLET}"
11141114
_CXXFLAGS_GLOBAL+=" -I${tmp}/include/c++/backward"
11151115
fi
1116-
elif [ "${_HOST}" = 'linux' ] && [ "${_OS}" = 'linux' ] && [ "${unamem}" != "${_machine}" ]; then
1117-
if [ "${_CC}" = 'llvm' ]; then
1118-
if [ "${_CRT}" != 'musl' ]; then
1119-
_CFLAGS_GLOBAL+=" -isystem /usr/${_TRIPLETSH}/include"
1120-
_LDFLAGS_GLOBAL+=" -L/usr/${_TRIPLETSH}/lib"
1121-
if [ "${_CCRT}" = 'libgcc' ]; then
1122-
# https://packages.debian.org/testing/all/libgcc-13-dev-arm64-cross/filelist
1123-
# /usr/lib/gcc-cross/aarch64-linux-gnu/13/
1124-
tmp="$(find "/usr/lib/gcc-cross/${_TRIPLETSH}" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1125-
if [ -z "${tmp}" ]; then
1126-
>&2 echo '! Error: Failed to detect gcc-cross env root.'
1127-
exit 1
1128-
fi
1129-
_LDFLAGS_GLOBAL+=" -L${tmp}"
1130-
fi
1116+
elif [ "${_HOST}" = 'linux' ] && [ "${_OS}" = 'linux' ] && [ "${unamem}" != "${_machine}" ] && [ "${_CRT}" != 'musl' ]; then
1117+
_CFLAGS_GLOBAL+=" -isystem /usr/${_TRIPLETSH}/include"
1118+
_LDFLAGS_GLOBAL+=" -L/usr/${_TRIPLETSH}/lib"
1119+
if [ "${_CCRT}" = 'libgcc' ]; then
1120+
# https://packages.debian.org/testing/all/libgcc-13-dev-arm64-cross/filelist
1121+
# /usr/lib/gcc-cross/aarch64-linux-gnu/13/
1122+
tmp="$(find "/usr/lib/gcc-cross/${_TRIPLETSH}" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1123+
if [ -z "${tmp}" ]; then
1124+
>&2 echo '! Error: Failed to detect gcc-cross env root.'
1125+
exit 1
11311126
fi
1127+
_LDFLAGS_GLOBAL+=" -L${tmp}"
11321128
fi
1129+
fi
11331130

1134-
if [ "${_DISTRO}" = 'debian' ]; then
1135-
# https://packages.debian.org/testing/all/libstdc++-13-dev-arm64-cross/filelist
1136-
# /usr/aarch64-linux-gnu/include/c++/13/
1137-
tmp="$(find "/usr/${_TRIPLETSH}/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1138-
if [ -n "${tmp}" ]; then
1139-
_CXXFLAGS_GLOBAL+=" -I${tmp}"
1140-
_CXXFLAGS_GLOBAL+=" -I${tmp}/${_TRIPLETSH}"
1141-
_CXXFLAGS_GLOBAL+=" -I${tmp}/backward"
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"
11421150
else
1143-
# https://packages.debian.org/trixie/arm64/libstdc++-12-dev/filelist
1144-
# /usr/include/c++/12/algorithm
1145-
# /usr/include/aarch64-linux-gnu/c++/12/ext/opt_random.h
1146-
tmp1="$(find "/usr/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1147-
tmp2="$(find "/usr/include/${_TRIPLETSH}/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true)"
1148-
if [ -n "${tmp1}" ] && \
1149-
[ -n "${tmp2}" ]; then
1150-
_CXXFLAGS_GLOBAL+=" -I${tmp1}"
1151-
_CXXFLAGS_GLOBAL+=" -I${tmp2}"
1152-
_CXXFLAGS_GLOBAL+=" -I${tmp1}/backward"
1153-
else
1154-
>&2 echo '! Error: Failed to detect g++-cross env root.'
1155-
exit 1
1156-
fi
1151+
>&2 echo '! Error: Failed to detect g++-cross env root.'
1152+
exit 1
11571153
fi
11581154
fi
11591155
fi

0 commit comments

Comments
 (0)