@@ -1108,47 +1108,43 @@ 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} " ]; then
1112- if [ " ${_CC} " = ' llvm' ]; then
1113- if [ " ${_CRT} " != ' musl' ]; then
1114- _CFLAGS_GLOBAL+=" -isystem /usr/${_TRIPLETSH} /include"
1115- _LDFLAGS_GLOBAL+=" -L/usr/${_TRIPLETSH} /lib"
1116- if [ " ${_CCRT} " = ' libgcc' ]; then
1117- # https://packages.debian.org/testing/all/libgcc-13-dev-arm64-cross/filelist
1118- # /usr/lib/gcc-cross/aarch64-linux-gnu/13/
1119- tmp=" $( find " /usr/lib/gcc-cross/${_TRIPLETSH} " -mindepth 1 -maxdepth 1 -type d | head -n 1 || true) "
1120- if [ -z " ${tmp} " ]; then
1121- >&2 echo ' ! Error: Failed to detect gcc-cross env root.'
1122- exit 1
1123- fi
1124- _LDFLAGS_GLOBAL+=" -L${tmp} "
1125- fi
1111+ elif [ " ${_HOST} " = ' linux' ] && [ " ${_OS} " = ' linux' ] && [ " ${unamem} " != " ${_machine} " ] && [ " ${_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
11261121 fi
1122+ _LDFLAGS_GLOBAL+=" -L${tmp} "
11271123 fi
1124+ fi
11281125
1129- if [ " ${_DISTRO} " = ' debian' ]; then
1130- # https://packages.debian.org/testing/all/libstdc++-13-dev-arm64-cross/filelist
1131- # /usr/aarch64-linux-gnu/include/c++/13/
1132- tmp=" $( find " /usr/${_TRIPLETSH} /include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true) "
1133- if [ -n " ${tmp} " ]; then
1134- _CXXFLAGS_GLOBAL+=" -I${tmp} "
1135- _CXXFLAGS_GLOBAL+=" -I${tmp} /${_TRIPLETSH} "
1136- _CXXFLAGS_GLOBAL+=" -I${tmp} /backward"
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"
11371145 else
1138- # https://packages.debian.org/trixie/arm64/libstdc++-12-dev/filelist
1139- # /usr/include/c++/12/algorithm
1140- # /usr/include/aarch64-linux-gnu/c++/12/ext/opt_random.h
1141- tmp1=" $( find " /usr/include/c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true) "
1142- tmp2=" $( find " /usr/include/${_TRIPLETSH} /c++" -mindepth 1 -maxdepth 1 -type d | head -n 1 || true) "
1143- if [ -n " ${tmp1} " ] && \
1144- [ -n " ${tmp2} " ]; then
1145- _CXXFLAGS_GLOBAL+=" -I${tmp1} "
1146- _CXXFLAGS_GLOBAL+=" -I${tmp2} "
1147- _CXXFLAGS_GLOBAL+=" -I${tmp1} /backward"
1148- else
1149- >&2 echo ' ! Error: Failed to detect g++-cross env root.'
1150- exit 1
1151- fi
1146+ >&2 echo ' ! Error: Failed to detect g++-cross env root.'
1147+ exit 1
11521148 fi
11531149 fi
11541150 fi
0 commit comments