title: Compiling go to Android: invalid signature of pthread_key_create
body: <pre><code>CGO_CFLAGS="--sysroot=android-sdk-linux/ndk-bundle/platforms/android-9/arch-arm/" CGO_ENABLED=1 CC=android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ CXX=android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ \                
      GOOS=android GOARCH=arm go build -buildmode=c-archive --ldflags="--sysroot=android-sdk-linux/ndk-bundle/platforms/android-9/arch-arm/"
  # runtime/cgo
  /usr/lib/go-1.8/src/runtime/cgo/gcc_android_arm.c: In function 'void inittls(void**, void**)':
  /usr/lib/go-1.8/src/runtime/cgo/gcc_android_arm.c:30:34: error: invalid conversion from 'void*' to 'void (*)(void*)' [-fpermissive]
    err = pthread_key_create(&amp;k, nil);
                                    ^
  In file included from /usr/lib/go-1.8/src/runtime/cgo/gcc_android_arm.c:5:0:
  /home/janus/Desktop/android-sdk-linux/ndk-bundle/platforms/android-9/arch-arm/usr/include/pthread.h:265:5: note: initializing argument 2 of 'int pthread_key_create(pthread_key_t*, void (*)(void*))'
   int pthread_key_create(pthread_key_t *key, void (*destructor_function)(void *));
  </code></pre>
  
  <p>The same issue occurs with recent API levels like 22.</p>
  
  <p>I am using the golang-1.8-go package mentioned on <a href="https://github.com/golang/go/wiki/Ubuntu" rel="nofollow noreferrer">https://github.com/golang/go/wiki/Ubuntu</a></p>