Created attachment 2230 [details] adds appropriate definitions when cross-compiling for Android This is the first of a few patches that I will be submitting - I am attempting to get OpenSSH to cross-compile for the Android platform. Android does not define fd_mask or howmany - and therefore channels.c:2143 and channels.c:2145 cause compilation to fail with errors: channels.c: In function 'channel_prepare_select': channels.c:2143:2: warning: implicit declaration of function 'howmany' [-Wimplicit-function-declaration] channels.c:2145:45: error: 'fd_mask' undeclared (first use in this function) The attached patch adds a couple of definitions that will work around this problem.
Created attachment 2231 [details] adds appropriate definitions when cross-compiling for Android [fixed] Sorry, there was a formatting bug with the original patch - this one replaces it.
Created attachment 2235 [details] adds appropriate definitions when cross-compiling for Android [fixed again] Sorry, I'm having a bad day. I forgot the ';;' at the end of the androideabi section. This corrected patch should fix everything (I hope).
Created attachment 2236 [details] adds appropriate definitions when cross-compiling for Android [fixed yet again] This is terribly embarrassing - but this time I've started from a completely clean copy of the source code and applied the patch. I've gone to great lengths to ensure you won't see any errors this time around. THIS ONE SHOULD WORK. Sorry for being a nuisance.
Thanks, we'll put this on the list for the 6.3 release.
Created attachment 2276 [details] add real configure tests for NFDBITS, howmany and fd_mask Rather than continuing to propagate these platform-specific settings I think we should make them real tests so that we don't have to do this again. Does this work for you? (note you'll need to run "autoreconf" to rebuild configure before running it).
Created attachment 2278 [details] tests for NFDBITS, howmany and fd_mask take 2 A good start. I needed to add sysmacros.h to find howmany on SVR5 platforms. fd_mask is a typedef so we need to use AC_CHECK_TYPES Other than that, it's OK
Created attachment 2279 [details] tests for NFDBITS, howmany and fd_mask take 3 Opps, uploaded the wrong one before.
I tried applying your patch but now I get undefined reference to 'howmany' errors again: in function ssh_connect:sshconnect.c:270: error: undefined reference to 'howmany' in function ssh_exchange_identification:sshconnect.c:468: error: undefined reference to 'howmany' in function channel_prepare_select:channels.c:2143: error: undefined reference to 'howmany' in function packet_write_wait:packet.c:1734: error: undefined reference to 'howmany'
I think I found the source of the problem. In config.h.in, the definition names missed getting updated. I am attaching a supplementary patch that fixes this.
Created attachment 2282 [details] Fixes improper definition names in config.h.in
(In reply to Nathan Osman from comment #10) > Created attachment 2282 [details] > Fixes improper definition names in config.h.in As Darren mentioned in comment 5, you need to run autoreconf. config.h.in is regenerated with the new bits by autoreconf.
Sorry for the mixup - I was running 'autoconf' instead of 'autoreconf'. Tim's patch works as-is now and you can ignore my supplementary patch.
Patch applied, thanks.
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1