Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure failed for libssh2 #1602

Open
eakteam opened this issue May 21, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@eakteam
Copy link

commented May 21, 2019

Hi there, hope that everything is good.
I am trying to cross compile and everything is going fine for armeabi-v7a & x86, but it shows error when trying for arm64-v8a. I am compiling with Android NDK R20-Beta3.
The problem is when configuring Nmap :
--with-openssl=${OPENSSLDIR}

checking for shared library run path origin... done
checking for libssl... no
configure: error: No crypto library found!
Try --with-libssl-prefix=PATH
 or --with-libgcrypt-prefix=PATH
 or --with-libmbedtls-prefix=PATH
 or --with-wincng on Windows
configure: error: ./configure failed for libssh2

This is my openssl configure :

export PATH=${NDK_INSTALL_DIR}/bin:${PATH}
export CC=${NMAP_HOST}-clang
export RANLIB=${NMAP_HOST}-ranlib
export CXX=${NMAP_HOST}-clang++
./Configure dist -ldl -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -fPIE -static -Os -Wall -fPIC -fvisibility=hidden -D__ANDROID_API__=21 --prefix=${OPENSSLDIR}
PATH=${NDK_INSTALL_DIR}/bin:${PATH} make clean
PATH=${NDK_INSTALL_DIR}/bin:${PATH} make CC=clang LDFLAGS="-static"
PATH=${NDK_INSTALL_DIR}/bin:${PATH} make install

When adding --without-libssh2 it works OK

Something going wrong when configuring for arm64-v8a , any workaround ?
I have checked ./makefile and ./configure it seems OK, why it fails to find openssl library ?
Tried to to explictly add --with-libssl-prefix=PATH & --with-libgcrypt-prefix=PATH , it again fails

Nmap version which trying to cross compile : nmap-7.70
Openssl version : openssl-1.0.2j & openssl-1.1.0j - Same error with both versions

PS : as said above it works OK for armeabi-v7a & x86

@dmiller-nmap

This comment has been minimized.

Copy link

commented May 24, 2019

The libssh2, libpcre, libpcap, libz, liblua, and liblinear directories are intended for convenience to avoid needing to download and build separate dependencies for individual users who want to build Nmap themselves. If you are cross-compiling, it's almost certainly in your best interest to get these libraries yourself, build and install them, and link them dynamically from Nmap.

I will be building Nmap on several different platforms in the coming week, so I will watch out for any changes that might have to be made surrounding libssh2 and passing along the openssl configure options, but for now I do not think there's anything we're planning to do to resolve this issue.

@eakteam

This comment has been minimized.

Copy link
Author

commented May 24, 2019

@dmiller-nmap , i understand. Thanks for your explanations, just to say, it will be very great if it will support automatic cross-compiling for every main systems out there.
Anyway, thanks i will solve it by my self but it is very hard to make core changes on every release.
Best Regards

For e.x armeabi-v7a & x86 (Android) it is working ok and i am able to build successfully for version 7.70.
The problems are with arm64-v8a and some others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.