Closed
Bug 1092004
Opened 11 years ago
Closed 10 years ago
Android NDK r10c build failure: error: implicit declaration of function 'getdtablesize'
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla48
| Tracking | Status | |
|---|---|---|
| firefox48 | --- | fixed |
People
(Reporter: dougc, Assigned: toonetown)
References
Details
(Whiteboard: [ndk-r10c])
Attachments
(1 file)
unix_rand.c:738:2: error: implicit declaration of function 'getdtablesize'
Seems that getdtablesize is no longer defined in the header files since android-21.
Comment 1•11 years ago
|
||
We have a patch for this in bug 1103816 though I think the real fix is to stop using getdtablesize.
| Assignee | ||
Comment 2•10 years ago
|
||
Getdtablesize is completely removed from android ndk version 11. Linking with that sdk fails
| Assignee | ||
Comment 3•10 years ago
|
||
Just to be clear, the error that is being thrown now is:
27:42.47 unix_rand.c:738: error: undefined reference to 'getdtablesize'
27:42.47 collect2: error: ld returned 1 exit status
27:42.47 make[7]: *** [/gecko-dev/objdir-armv7/security/nss/lib/freebl/libfreebl3.so] Error 1
Same error is thrown when building i386.
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nathan
| Assignee | ||
Comment 4•10 years ago
|
||
When building non-gonk builds, ANDROID_VERSION is not set. Beginning with NDK 11, getdtablesize is no longer included. This means that we should use the stub version of the function that is defined in android_stub.h for all android platforms. This patch moves the function out of the "#if ANDROID_VERSION >=21" block so that all android code can use it.
Adding glandium as the reviewer, because he reviewed the original patch at bug 1103816.
Review commit: https://reviewboard.mozilla.org/r/39843/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/39843/
Attachment #8730409 -
Flags: review?(mh+mozilla)
Comment 5•10 years ago
|
||
Can you clarify whether getdtablesize was removed from the headers only or if it was removed from devices's libc as well?
| Assignee | ||
Comment 6•10 years ago
|
||
It is removed from the headers from platform 21 and higher (that is, it *does* exist in NDK 11 under the android-XX where XX is 19 and lower). However, it does *NOT* appear to exist in libc anymore...even if I link, for example against android-15.
| Assignee | ||
Comment 7•10 years ago
|
||
I do not - however, know if it exists on the *device's* libc... I just ran the checks against the files that are distributed with the NDK itself. The change appears to have begun with NDK 11 (which I know is not a supported NDK - so this is probably not a critical issue...just one I figured I'd look at for "fun" :) )
| Assignee | ||
Comment 8•10 years ago
|
||
For example (and for reference), the check I ran was (from within the NDK root):
> toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm platforms/android-15/arch-arm/usr/lib/libc.so | grep 'getdtablesize'
When running this on NDK r10e, I get a "getdtablesize" for every libc (for arm architecture - regardless of platform version). On NDK r11, there is not a single "getdtablesize" for any libc (again, I only checked the arm architecture).
| Assignee | ||
Comment 9•10 years ago
|
||
Google hasn't posted images for arm yet - but the x86 emulator image for Android-N *DOES* contain getdtablesize. However, the ones that are used for linking (the ones in ${ANDROID_NDK_HOME}/platforms) do *NOT* contain entries for getdtablesize...and therefore building fails (undefined reference). Though I would assume that binaries linked with older versions of the NDK will still execute on Android-N.
Updated•10 years ago
|
Attachment #8730409 -
Flags: review?(mh+mozilla) → review+
Comment 10•10 years ago
|
||
Comment on attachment 8730409 [details]
MozReview Request: Bug 1092004 - Use getdtablesize for non-gonk builds as well. r=glandium
https://reviewboard.mozilla.org/r/39843/#review36819
While I'm giving a r+ here, I think the right thing to do would be to modify the sole user of getdtablesize() (nss's unix_rand.c) to stop using it.
| Assignee | ||
Comment 11•10 years ago
|
||
https://reviewboard.mozilla.org/r/39843/#review36823
I logged the getdtablesize() issue as Bug 1257048.
Treeherder: https://treeherder.mozilla.org/#/jobs?repo=try&revision=982df7c9a53b
| Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 12•10 years ago
|
||
Keywords: checkin-needed
Comment 13•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•