aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/cgo
diff options
context:
space:
mode:
authorElias Naur <mail@eliasnaur.com>2019-04-02 23:58:43 +0200
committerElias Naur <mail@eliasnaur.com>2019-04-02 22:17:34 +0000
commitfc7ac2e8c0499d047ce0120a2f5df23093df6c17 (patch)
treec8ac2abd741bb0d6699cab689ab182747f76b9b3 /src/runtime/cgo
parent814c97b3133d0e5a8aa884e2ef752aaf7e7bd500 (diff)
downloadgo-fc7ac2e8c0499d047ce0120a2f5df23093df6c17.tar.gz
go-fc7ac2e8c0499d047ce0120a2f5df23093df6c17.zip
runtime/cgo: look for android_get_device_api_level in libc.so
The presence of the android_get_device_api_level symbol is used to detect Android Q or later. Use the suggestion by Ryan Prichard and look for it in libc.so and not in the entire program where someone else might have defined it. Manually tested on an Android Q amd64 emulator and arm64 Pixel. Updates #29674 Change-Id: Iaef35d8f8910037b3690aa21f319e216a05a9a73 Reviewed-on: https://go-review.googlesource.com/c/go/+/170127 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/cgo')
-rw-r--r--src/runtime/cgo/gcc_android.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/cgo/gcc_android.c b/src/runtime/cgo/gcc_android.c
index a626cd0681..5075023282 100644
--- a/src/runtime/cgo/gcc_android.c
+++ b/src/runtime/cgo/gcc_android.c
@@ -50,7 +50,7 @@ inittls(void **tlsg, void **tlsbase)
void *handle, *get_ver;
// Check for Android Q where we can use the free TLS_SLOT_APP slot.
- handle = dlopen(NULL, RTLD_LAZY);
+ handle = dlopen("libc.so", RTLD_LAZY);
if (handle == NULL) {
fatalf("inittls: failed to dlopen main program");
return;