ubiquiti / dropbear-android

Dropbear version 2018.76 cross-compiled to run on Android with password authentication
44 stars 28 forks source link

Compilation fails with android-ndk-r17b #1

Open Maxr1998 opened 6 years ago

Maxr1998 commented 6 years ago

Here's the error log:

/home/max/Development/Linux/toolchain-arm/bin/arm-linux-androideabi-gcc --sysroot=/home/max/Development/Linux/toolchain-arm/sysroot -Wl,-pie -Wl,-z,now -Wl,-z,relro -o dropbear dbutil.o buffer.o dbhelpers.o dss.o bignum.o signkey.o rsa.o dbrandom.o queue.o atomicio.o compat.o fake-rfc2553.o ltc_prng.o ecc.o ecdsa.o crypto_desc.o gensignkey.o gendss.o genrsa.o common-session.o packet.o common-algo.o common-kex.o common-channel.o common-chansession.o termcodes.o loginrec.o tcp-accept.o listener.o process-packet.o dh_groups.o common-runopts.o circbuffer.o curve25519-donna.o list.o netio.o svr-kex.o svr-auth.o sshpty.o svr-authpasswd.o svr-authpubkey.o svr-authpubkeyoptions.o svr-session.o svr-service.o svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o svr-tcpfwd.o svr-authpam.o libtomcrypt/libtomcrypt.a libtommath/libtommath.a  
dbutil.c:139: error: undefined reference to 'stderr'
dbutil.c:361: error: undefined reference to 'signal'
dbutil.c:280: error: undefined reference to 'signal'
dbrandom.c:92: error: undefined reference to '__FD_SET_chk'
/home/max/Development/Linux/toolchain-arm/sysroot/usr/include/bits/fortify/unistd.h:406: error: undefined reference to '__read_chk'
/home/max/Development/Linux/toolchain-arm/sysroot/usr/include/bits/fortify/string.h:391: error: undefined reference to '__strlen_chk'
/home/max/Development/Linux/toolchain-arm/sysroot/usr/include/bits/fortify/string.h:391: error: undefined reference to '__strlen_chk'
gendss.c:66: error: undefined reference to 'stderr'
genrsa.c:133: error: undefined reference to 'stderr'
genrsa.c:91: error: undefined reference to 'stderr'
common-session.c:157: error: undefined reference to '__FD_SET_chk'
common-session.c:174: error: undefined reference to '__FD_SET_chk'
common-session.c:180: error: undefined reference to '__FD_SET_chk'
common-session.c:206: error: undefined reference to '__FD_ISSET_chk'
common-session.c:218: error: undefined reference to '__FD_ISSET_chk'
common-session.c:414: error: undefined reference to '__FD_ISSET_chk'
common-channel.c:219: error: undefined reference to '__FD_ISSET_chk'
/home/max/Development/Linux/toolchain-arm/sysroot/usr/include/bits/fortify/string.h:391: error: undefined reference to '__strlen_chk'
sshpty.c:219: error: undefined reference to 'tcgetattr'
sshpty.c:228: error: undefined reference to 'tcsetattr'
sshpty.c:274: error: undefined reference to 'signal'
svr-chansession.c:159: error: undefined reference to 'sigemptyset'
svr-chansession.c:1047: error: undefined reference to 'sigemptyset'
svr-chansession.c:817: error: undefined reference to 'signal'
svr-chansession.c:481: error: undefined reference to 'tcgetattr'
svr-chansession.c:553: error: undefined reference to 'tcsetattr'
svr-main.c:394: error: undefined reference to 'sigemptyset'
svr-main.c:352: error: undefined reference to 'sigemptyset'
bn_mp_rand.c:36: error: undefined reference to 'rand'
bn_mp_rand.c:36: error: undefined reference to 'rand'
bn_mp_rand.c:36: error: undefined reference to 'rand'
bn_mp_rand.c:36: error: undefined reference to 'rand'
collect2: error: ld returned 1 exit status
make: *** [Makefile:177: dropbear] Fehler 1

Not really sure what I could be doing wrong..

Maxr1998 commented 6 years ago

Fixed by adding -D__ANDROID_API__=21 to the CFLAGS. I passed --api 21 to make_standalone_toolchain.py previously, that's why I used 21. This should probably be added to the README.

MonroeD commented 5 years ago

Fixed by adding -D__ANDROID_API__=21 to the CFLAGS. I passed --api 21 to make_standalone_toolchain.py previously, that's why I used 21. This should probably be added to the README.

help me a lot, great!