Fixed
Status Update
Comments
en...@google.com <en...@google.com> #2
have you actually hit this limit in practice?
tb...@google.com <tb...@google.com> #3
I've hit this limit and that made me question the choice of !28 in this bug report.
The scenario is the following:
- we're deploying unit and functional tests over SSH to non rooted Android devices
- beside executables we're deploying big assets (several GB) over SSH wtih rsync
- we're using SSHDroid which home is /data/data/berserker.android.apps.sshdroid/home
/data/data/berserker.android.apps.sshdroid/home is already 48 characters which is more than a third of the maximum allowed name if you pass an absolute path to dlopen()
Gregory
The scenario is the following:
- we're deploying unit and functional tests over SSH to non rooted Android devices
- beside executables we're deploying big assets (several GB) over SSH wtih rsync
- we're using SSHDroid which home is /data/data/berserker.android.apps.sshdroid/home
/data/data/berserker.android.apps.sshdroid/home is already 48 characters which is more than a third of the maximum allowed name if you pass an absolute path to dlopen()
Gregory
tb...@google.com <tb...@google.com> #5
Currently UAPI_HEADERS is defined in build/tools/prebuilt-common.sh for some of the architectures (aarch64, x86_64, mips64el). I tried to define it for arm also, but it just caused other compile errors both with android-21 and for android-18. Changing the condition to depend on __ANDROID__ have the same effect.
I think the root cause of the problem is the missing sys/procfs.h file on android what was worked around with having most of its content in asm/elf.h (and included from linux/elf.h) prior to android-21.
I would prefer to put asm/elf.h back to android-21 (and the other changes related to it) as that will fix the compilation error for each platform and with that change we can (most likely) remove all of the crap added only to the android version of gdb making it easier to update to a new version.
I think the root cause of the problem is the missing sys/procfs.h file on android what was worked around with having most of its content in asm/elf.h (and included from linux/elf.h) prior to android-21.
I would prefer to put asm/elf.h back to android-21 (and the other changes related to it) as that will fix the compilation error for each platform and with that change we can (most likely) remove all of the crap added only to the android version of gdb making it easier to update to a new version.
en...@google.com <en...@google.com> #6
(sorry for the delay.)
no, asm/elf.h is a non-uapi header, so it won't be coming back.
my understanding was that andrewhsieh was going to add a <sys/procfs.h> to gdb -- the only thing that needs it -- but apparently this hasn't happened, and it looks like there's no upstream __ANDROID__ alternative either.
danalbert: want to have a look at what we'd need to build gdb out of the box while i'm gone? (if you won't have time, just assign back to me.)
no, asm/elf.h is a non-uapi header, so it won't be coming back.
my understanding was that andrewhsieh was going to add a <sys/procfs.h> to gdb -- the only thing that needs it -- but apparently this hasn't happened, and it looks like there's no upstream __ANDROID__ alternative either.
danalbert: want to have a look at what we'd need to build gdb out of the box while i'm gone? (if you won't have time, just assign back to me.)
mc...@gmail.com <mc...@gmail.com> #7
I'm interested in the correct resolution for this issue. For the time being, I am using a modified workaround mentioned by a chinese blog, which seems to fix the compile issue (I only use 21 with aarch64):
diff --git a/gdb-7.6/gdb/gdbserver/gdb_proc_service.h b/gdb-7.6/gdb/gdbserver/gdb_proc_service.h
index 955b0d5..90402b3 100644
--- a/gdb-7.6/gdb/gdbserver/gdb_proc_service.h
+++ b/gdb-7.6/gdb/gdbserver/gdb_proc_service.h
@@ -75,6 +75,15 @@ typedef unsigned int lwpid_t;
typedef void *psaddr_t;
#endif
+// mchinen: this hack is needed to compile for android platform 21 sysroot
+// we make x86 and arm build against 19, but aarch64 does not exist until 21.
+//https://code.google.com/p/android/issues/detail?id=86712 ),
+//http://blog.csdn.net/bupt073114/article/details/25211319
+#if defined(__aarch64__)
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[35];
+#endif
+
#ifndef HAVE_PRGREGSET_T
typedef elf_gregset_t prgregset_t;
#endif
diff --git a/gdb-7.6/gdb/gdbserver/gdb_proc_service.h b/gdb-7.6/gdb/gdbserver/gdb_proc_service.h
index 955b0d5..90402b3 100644
--- a/gdb-7.6/gdb/gdbserver/gdb_proc_service.h
+++ b/gdb-7.6/gdb/gdbserver/gdb_proc_service.h
@@ -75,6 +75,15 @@ typedef unsigned int lwpid_t;
typedef void *psaddr_t;
#endif
+// mchinen: this hack is needed to compile for android platform 21 sysroot
+// we make x86 and arm build against 19, but aarch64 does not exist until 21.
+//
+//
+#if defined(__aarch64__)
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[35];
+#endif
+
#ifndef HAVE_PRGREGSET_T
typedef elf_gregset_t prgregset_t;
#endif
da...@google.com <da...@google.com> #8
I'm looking in to this btw. So far it looks like we might be able to fix it by just replacing the NDK headers with the latest bionic headers (something we were wanting to do anyway), and adding a sys/procfs.h to bionic.
Still haven't made it all the way through the process yet, but that seems to be making progress so far.
Still haven't made it all the way through the process yet, but that seems to be making progress so far.
ch...@gmail.com <ch...@gmail.com> #9
Just checking to see if there's been progress on this' currently (trying) to build gdb on android.
en...@google.com <en...@google.com> #10
i built gdbserver with https://android-review.googlesource.com/#/c/139010/ this afternoon. i needed to remove some local hacks from the toolchain repository's copy of gdb, and i needed to add some ifdefs around constants that gdb defines differently to the kernel headers we use (a change we'll want to get upstream), but this change should cover the gnarly part of the problem. let me know how you get on.
ch...@gmail.com <ch...@gmail.com> #11
Should I be using the sources there instead of from the gnu download location?
(also, just to make sure it's clear, i'm building gdb ON android)
(also, just to make sure it's clear, i'm building gdb ON android)
ch...@gmail.com <ch...@gmail.com> #12
nm...I think my issue is different. I'm on arm Android and the elf_gregset errors are happening when compiling arm-linux-nat.c
en...@google.com <en...@google.com> #13
no, you shouldn't use the toolchain repo sources; we want to remove them (and their hacks) in favor of building directly from upstream.
you're right that i only tried to build gdbserver, not gdb. i was thinking of trying the latter today, actually, to see if there are any other compatibility issues.
you're right that i only tried to build gdbserver, not gdb. i was thinking of trying the latter today, actually, to see if there are any other compatibility issues.
ch...@gmail.com <ch...@gmail.com> #14
Yeah, I'm getting an unknown type name error for elf_gregset_t when compiling arm-linux-nat.c...the error comes from nm.h which is included from deps.h which is included in arm-linux-nat.c
en...@google.com <en...@google.com> #15
did you apply the change i mentioned in 9 to the NDK you're using? i just built gdb 7.9.1 from the prepackaged .tar.xz file on their web site. i needed three trivial patches (tell configure to use windows-termcap.o instead of a real termcap, a hack to readline to declare its own PC, BC, and UP, and a hack to not use setpwent in readline). you presumably don't need the first three of those if you're building with termcap, and i'll try to push the last of those upstream.
oh, this actually requiredhttps://android-review.googlesource.com/#/c/155038/ to fix a few things in a few headers (which, again, you'll have to apply locally to your NDK sysroot), and one more patch that i haven't uploaded yet to remove from thread_db.h the things that patch adds to <sys/procfs.h>...
oh, this actually required
en...@google.com <en...@google.com>
ch...@gmail.com <ch...@gmail.com> #16
The link you posted in #9 wasn't clear...i.e. I wasn't sure what to do with it...but I was able to get gdb built and running on my tablet. I made patches for most of the changes I made.
ch...@gmail.com <ch...@gmail.com> #17
Unfortunately...post upgrade to android-21...I'm re-building gdb on-device and running into issues.
Is there a patch or set of patches to apply to the source that fixes the various bionic/android related issues?
Is there a patch or set of patches to apply to the source that fixes the various bionic/android related issues?
en...@google.com <en...@google.com> #18
if you build your own NDK from AOSP ToT today, that'll work.
ch...@gmail.com <ch...@gmail.com> #19
Hmmm. Still running into an "unknown type name" error for fpregset_t when building.
ch...@gmail.com <ch...@gmail.com> #20
Is it possible to download the headers instead of downloading and building the NDK from source? If so, which headers and where should they be downloaded from?
en...@google.com <en...@google.com> #21
yeah, you could clone just the bionic project and then copy header files across into your existing NDK.
ch...@gmail.com <ch...@gmail.com> #22
What's the version number?
I ask because I've limited space on device; I plan on browsing the repo and downloading the sysroot.
I ask because I've limited space on device; I plan on browsing the repo and downloading the sysroot.
ch...@gmail.com <ch...@gmail.com> #23
da...@google.com <da...@google.com> #24
The header you need isn't in any released branch. You'll have to take it from master. If it hasn't been moved into development/ndk/platforms yet, take the header from bionic/libc/include.
ch...@gmail.com <ch...@gmail.com> #25
hat did the trick...thanks!
FYI...I downloaded the entire include dir and replaced the sysroot include dir I'm using with the on-device gcc
FYI...I downloaded the entire include dir and replaced the sysroot include dir I'm using with the on-device gcc
Description
typedef unsigned long elf_greg_t;
[...]
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
In android-21, the <asm/elf.h> file does not exist (and elf_greg_t and elf_gregset_t are not defined anywhere else), but are used by <linux/elfcore.h>, which seems broken (and breaks compiling gdb with the NDK).