aboutsummaryrefslogtreecommitdiff
path: root/tests/build/warn-noabi/build.sh
blob: 651801a83d0b0fe161808c305c5adb60522d646b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Check if ARM g++ no longer gives pointless warning about the mangling of <va_list> has changed in GCC 4.4
# See https://android-review.googlesource.com/#/c/42274/
#

export ANDROID_NDK_ROOT=$NDK

NDK_BUILDTOOLS_PATH=$NDK/build/tools
. $NDK/build/tools/prebuilt-common.sh

VERSION=4.9

if [ -n "$NDK_TOOLCHAIN_VERSION" ];  then
    case "$NDK_TOOLCHAIN_VERSION" in
        4.9*)
           VERSION=$NDK_TOOLCHAIN_VERSION
            ;;
        clang*)
           echo "No need to test clang on this issue"
           exit 0
            ;;
        *)
           echo "ERROR: invalid NDK_TOOLCHAIN_VERSION $NDK_TOOLCHAIN_VERSION"
           exit 1
    esac
fi

SYSTEM=$(get_prebuilt_host_tag)
if [ "$SYSTEM" = "windows" ] ; then
  SYSTEM64=windows-x86_64
  NULL="NUL"
else
  SYSTEM64=${SYSTEM}_64
  NULL="/dev/null"
fi

ARM_GPP=$NDK/toolchains/arm-linux-androideabi-$VERSION/bin/arm-linux-androideabi-g++${HOST_EXE}
if [ ! -f "$ARM_GPP" ]; then
    echo "ERROR: Can't locate compiler $ARM_GPP"
    exit 1
fi

OUT=$(echo "#include <stdarg.h>
void foo(va_list v) { }" | $ARM_GPP -x c++ -c -o $NULL - 2>&1)

if [ -z "$OUT" ]; then
  echo "ARM g++ no longer gives pointless warning about the mangling of <va_list> has changed in GCC 4.4"
  exit 0
else
  echo "ERROR: ARM g++ still gives pointless warning about the mangling of <va_list> has changed in GCC 4.4"
  exit 1
fi