Home | History | Annotate | Download | only in warn-noabi
      1 # Check if ARM g++ no longer gives pointless warning about the mangling of <va_list> has changed in GCC 4.4
      2 # See https://android-review.googlesource.com/#/c/42274/
      3 #
      4 
      5 export ANDROID_NDK_ROOT=$NDK
      6 
      7 NDK_BUILDTOOLS_PATH=$NDK/build/tools
      8 . $NDK/build/tools/prebuilt-common.sh
      9 
     10 VERSION=4.6
     11 
     12 if [ -n "$NDK_TOOLCHAIN_VERSION" ];  then
     13     case "$NDK_TOOLCHAIN_VERSION" in
     14         4.4.3|4.6|4.7*|4.8*|4.9*)
     15            VERSION=$NDK_TOOLCHAIN_VERSION
     16             ;;
     17         clang*)
     18            echo "No need to test clang on this issue"
     19            exit 0
     20             ;;
     21         *)
     22            echo "ERROR: invalid NDK_TOOLCHAIN_VERSION $NDK_TOOLCHAIN_VERSION"
     23            exit 1
     24     esac
     25 fi
     26 
     27 SYSTEM=$(get_prebuilt_host_tag)
     28 if [ "$SYSTEM" = "windows" ] ; then
     29   SYSTEM64=windows-x86_64
     30   NULL="NUL"
     31 else
     32   SYSTEM64=${SYSTEM}_64
     33   NULL="/dev/null"
     34 fi
     35 
     36 ARM_GPP=$NDK/toolchains/arm-linux-androideabi-$VERSION/prebuilt/$SYSTEM/bin/arm-linux-androideabi-g++${HOST_EXE}
     37 if [ ! -f "$ARM_GPP" ]; then
     38     ARM_GPP=$NDK/toolchains/arm-linux-androideabi-$VERSION/prebuilt/$SYSTEM64/bin/arm-linux-androideabi-g++${HOST_EXE}
     39 fi
     40 if [ ! -f "$ARM_GPP" ]; then
     41     echo "ERROR: Can't locate compiler $ARM_GPP"
     42     exit 1
     43 fi
     44 
     45 OUT=$(echo "#include <stdarg.h>
     46 void foo(va_list v) { }" | $ARM_GPP -x c++ -c -o $NULL - 2>&1)
     47 
     48 if [ -z "$OUT" ]; then
     49   echo "ARM g++ no longer gives pointless warning about the mangling of <va_list> has changed in GCC 4.4"
     50   exit 0
     51 else
     52   echo "ERROR: ARM g++ still gives pointless warning about the mangling of <va_list> has changed in GCC 4.4"
     53   exit 1
     54 fi
     55