Repository: go
Issue: x/mobile: gomobile fails with big error (go1.20)
Labels: NeedsInvestigation,mobile

```
$ gomobile build -target android -o animalsounds.apk -androidapi 24
gomobile: go build -buildmode=c-shared -o /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/gomobile-work-1891904512/lib/armeabi-v7a/libanimalsounds.so animalsounds failed: exit status 1
# fyne.io/fyne/v2/internal/driver/mobile
android.c:51:9: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
android.c:68:48: warning: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'jobject' (aka 'void *') [-Wint-conversion]
android.c:72:55: warning: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'jobject' (aka 'void *') [-Wint-conversion]
android.c:123:48: warning: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'jobject' (aka 'void *') [-Wint-conversion]
android.c:126:48: warning: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'jobject' (aka 'void *') [-Wint-conversion]
android.c:182:50: warning: passing 'char *' to parameter of type 'jbyte *' (aka 'signed char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
android.c:192:48: warning: passing 'char *' to parameter of type 'const jbyte *' (aka 'const signed char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
# fyne.io/fyne/v2/app
app_mobile_and.c:45:48: warning: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'jobject' (aka 'void *') [-Wint-conversion]
app_mobile_and.c:48:48: warning: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'jobject' (aka 'void *') [-Wint-conversion]
app_mobile_and.c:84:30: warning: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'jobject' (aka 'void *') [-Wint-conversion]
app_mobile_and.c:97:33: warning: incompatible pointer to integer conversion passing 'JNIEnv *' (aka 'const struct JNINativeInterface **') to parameter of type 'uintptr_t' (aka 'unsigned int') [-Wint-conversion]
app_mobile_and.c:41:36: note: passing argument to parameter 'jni_env' here
# animalsounds
/usr/local/go/pkg/tool/darwin_amd64/link: running /usr/local/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang failed: exit status 1
ld: error: duplicate symbol: setCurrentContext
>>> defined at _cgo_export.c:25
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(setCurrentContext)
>>> defined at _cgo_export.c:25
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x0)

ld: error: duplicate symbol: callMain
>>> defined at _cgo_export.c:44
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(callMain)
>>> defined at _cgo_export.c:44
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x50)

ld: error: duplicate symbol: onStart
>>> defined at _cgo_export.c:61
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onStart)
>>> defined at _cgo_export.c:61
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x98)

ld: error: duplicate symbol: onResume
>>> defined at _cgo_export.c:78
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onResume)
>>> defined at _cgo_export.c:78
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0xE0)

ld: error: duplicate symbol: onSaveInstanceState
>>> defined at _cgo_export.c:95
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onSaveInstanceState)
>>> defined at _cgo_export.c:95
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x128)

ld: error: duplicate symbol: onPause
>>> defined at _cgo_export.c:116
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onPause)
>>> defined at _cgo_export.c:116
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x184)

ld: error: duplicate symbol: onStop
>>> defined at _cgo_export.c:133
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onStop)
>>> defined at _cgo_export.c:133
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x1CC)

ld: error: duplicate symbol: onCreate
>>> defined at _cgo_export.c:150
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onCreate)
>>> defined at _cgo_export.c:150
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x214)

ld: error: duplicate symbol: onDestroy
>>> defined at _cgo_export.c:167
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onDestroy)
>>> defined at _cgo_export.c:167
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x25C)

ld: error: duplicate symbol: onWindowFocusChanged
>>> defined at _cgo_export.c:184
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onWindowFocusChanged)
>>> defined at _cgo_export.c:184
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x2A4)

ld: error: duplicate symbol: onNativeWindowCreated
>>> defined at _cgo_export.c:203
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onNativeWindowCreated)
>>> defined at _cgo_export.c:203
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x2F4)

ld: error: duplicate symbol: onNativeWindowRedrawNeeded
>>> defined at _cgo_export.c:222
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onNativeWindowRedrawNeeded)
>>> defined at _cgo_export.c:222
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x344)

ld: error: duplicate symbol: onNativeWindowDestroyed
>>> defined at _cgo_export.c:241
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onNativeWindowDestroyed)
>>> defined at _cgo_export.c:241
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x394)

ld: error: duplicate symbol: onInputQueueCreated
>>> defined at _cgo_export.c:260
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onInputQueueCreated)
>>> defined at _cgo_export.c:260
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x3E4)

ld: error: duplicate symbol: onInputQueueDestroyed
>>> defined at _cgo_export.c:279
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onInputQueueDestroyed)
>>> defined at _cgo_export.c:279
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x434)

ld: error: duplicate symbol: onContentRectChanged
>>> defined at _cgo_export.c:298
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onContentRectChanged)
>>> defined at _cgo_export.c:298
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x484)

ld: error: duplicate symbol: onConfigurationChanged
>>> defined at _cgo_export.c:334
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onConfigurationChanged)
>>> defined at _cgo_export.c:317
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x4D4)

ld: error: duplicate symbol: onLowMemory
>>> defined at _cgo_export.c:351
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000020.o:(onLowMemory)
>>> defined at _cgo_export.c:334
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000039.o:(.text+0x51C)

ld: error: duplicate symbol: JNI_OnLoad
>>> defined at android.c:57
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000023.o:(JNI_OnLoad)
>>> defined at android.c:52
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000041.o:(.text+0x0)

ld: error: duplicate symbol: ANativeActivity_onCreate
>>> defined at android.c:76
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000023.o:(ANativeActivity_onCreate)
>>> defined at android.c:71
>>>            /var/folders/bm/pt_ywx1j2gx_yjx9qqkn9kn40000gn/T/go-link-3400143632/000041.o:(.text+0x40)

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```