Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

build openssl for android

52 views
Skip to first unread message

Indtiny s

unread,
Sep 12, 2012, 1:05:35 PM9/12/12
to

Hi,

I have to build the openssl 1.0.1c for the android , I have added new  ECC-CCM chiper key support at the openssl , hence i want build the same for android-ndk and use in my application as shared libraries . is there any guide to build the same ..?

Rgds
Indu

Jason Goldberg

unread,
Sep 12, 2012, 1:34:50 PM9/12/12
to
For Android, check out this project as an example:


They have the Android-specific Makefile configs for doing an NDK build.  You could patch it with your changes and generate the .so libraries you need.

farmdve data.bg

unread,
Sep 12, 2012, 10:30:45 PM9/12/12
to
Do not use that one, it's old. Use this one  https://github.com/aluvalassuman/OpenSSL1.0.1cForAndroid 

Just calling ndk-build should work.

farmdve data.bg

unread,
Sep 12, 2012, 10:36:33 PM9/12/12
to
Oh, and I highly suggest specifying the TARGET_ABI so that the code is optimized(considerable boost compared to without specifying it).

So either add TARGET_ABI := android-APILEVEL-armeabi to android-config.mk OR open Android.mk in the crypto and ssl folders, and add it just before $(BUILD_SHARED_LIBRARY).
Be sure to replace APILEVEL with the API level you target. And if you want static libraries, replace  $(BUILD_SHARED_LIBRARY)  where encountered to  $(BUILD_STATIC_LIBRARY) 

Indtiny s

unread,
Sep 13, 2012, 12:26:03 AM9/13/12
to
Hi,
My android for the TAB is HoneyComb and its API level is 12 so I have wriiten it as
TARGET_ABI:=android-12-armeabi
 
I put the above line in android-config.mk just below the first LOCAL_CFLAGS and excuted the ndk-build but I got the following error .
 
linux-androideabi/bin/ld: warning: libz.so, needed by ./obj/local/armeabi/libcry
./obj/local/armeabi/libcrypto.so: undefined reference to `zError'
./obj/local/armeabi/libcrypto.so: undefined reference to `inflateEnd'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflate'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflateInit_'
 
Rgds
Indu

te...@terralogic.net

unread,
Sep 13, 2012, 1:04:49 AM9/13/12
to

I don't at this point own an android and I am thinking of getting one. I'd like to ask of the environment. Will I need to root it? I expect the answer is yes and I'll have to install all the development tools as well. Its there a website which provides instructions.

Next what of cross compilers or a development environment which runs on say the desktop and provides the test bed that the phone uses.

THanks.


On Thu, Sep 13, 2012 at 09:56:03AM +0530, Indtiny s wrote:
> Hi,
> My android for the TAB is HoneyComb and its API level is 12 so I have
> wriiten it as
> TARGET_ABI:=android-12-armeabi
>
> I put the above line in android-config.mk just below the first LOCAL_CFLAGS
> and excuted the ndk-build but I got the following error .
>
> linux-androideabi/bin/ld: warning: libz.so, needed by
> ./obj/local/armeabi/libcry
> ./obj/local/armeabi/libcrypto.so: undefined reference to `zError'
> ./obj/local/armeabi/libcrypto.so: undefined reference to `inflateEnd'
> ./obj/local/armeabi/libcrypto.so: undefined reference to `deflate'
> ./obj/local/armeabi/libcrypto.so: undefined reference to `deflateInit_'
>
> Rgds
> Indu
>
>
>
>
>
> On Thu, Sep 13, 2012 at 8:06 AM, farmdve data.bg <far...@data.bg> wrote:
>
> > Oh, and I highly suggest specifying the TARGET_ABI so that the code is
> > optimized(considerable boost compared to without specifying it).
> >
> > So either add TARGET_ABI := android-APILEVEL-armeabi to android-config.mkOR open Android.mk in the crypto and ssl folders, and add it just before
> > $(BUILD_SHARED_LIBRARY).
> > Be sure to replace APILEVEL with the API level you target. And if you want
> > static libraries, replace $(BUILD_SHARED_LIBRARY) where encountered to
> > $(BUILD_STATIC_LIBRARY)
> >
> >
> > On Thu, Sep 13, 2012 at 5:30 AM, farmdve data.bg <far...@data.bg> wrote:
> >
> >> Do not use that one, it's old. Use this one
> >> https://github.com/aluvalassuman/OpenSSL1.0.1cForAndroid
> >>
> >> Just calling ndk-build should work.
> >>
> >> On Wed, Sep 12, 2012 at 8:34 PM, Jason Goldberg <jgol...@oneid.com>wrote:
> >>
> >>> For Android, check out this project as an example:
> >>>
> >>> https://github.com/eighthave/openssl-android
> >>>
> >>> They have the Android-specific Makefile configs for doing an NDK build.
> >>> You could patch it with your changes and generate the .so libraries you
> >>> need.
> >>>
> >>> On Sep 12, 2012, at 12:05 PM, Indtiny s <ind...@gmail.com> wrote:
> >>>
> >>>
> >>> Hi,
> >>>
> >>> I have to build the openssl 1.0.1c for the android , I have added new
> >>> ECC-CCM chiper key support at the openssl , hence i want build the same
> >>> for android-ndk and use in my application as shared libraries . is there
> >>> any guide to build the same ..?
> >>>
> >>> Rgds
> >>> Indu
> >>>
> >>>
> >>>
> >>
> >
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openss...@openssl.org
Automated List Manager majo...@openssl.org

Indtiny s

unread,
Sep 13, 2012, 2:45:32 AM9/13/12
to
Hi,
When I complied  my old code (openssl-android 1.0.0e)  which downloaded from the github , ir built properly ..
but this new code from the  https://github.com/aluvalassuman/OpenSSL1.0.1cForAndroid
is throwing the zlib not found error .. I ran everything through $ sudo ndk-build script only .
 
Is there any reference needs to be added in the android.mk for the new code ..?

Indtiny s

unread,
Sep 13, 2012, 7:11:07 AM9/13/12
to
Hi,
adding more to my previous problem reference post :

That library is there in the ndk floder

/home/indu/Android/android-ndk-r8b/platforms/android-9/arch-x86/usr/lib/libz.a
/home/indu/Android/android-ndk-r8b/platforms/android-9/arch-x86/usr/lib/libz.so
/home/indu/Android/android-ndk-r8b//platforms/android-9/arch-arm/usr/lib/libz.so
/home/indu/Android/android-ndk-r8b//platforms/android-4/arch-arm/usr/lib/libz.so
/home/indu/Android/android-ndk-r8b//platforms/android-8/arch-arm/usr/lib/libz.so
/home/indu/Android/android-ndk-r8b//platforms/android-5/arch-arm/usr/lib/libz.so
/home/indu/Android/android-ndk-r8b//platforms/android-3/arch-arm/usr/lib/libz.so


But I'm getting the following error when with ndk-build

/home/indu/Android/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: warning: libz.so, needed by ./obj/local/armeabi/libcrypto.so, not found (try using -rpath or -rpath-link)

./obj/local/armeabi/libcrypto.so: undefined reference to `zError'
./obj/local/armeabi/libcrypto.so: undefined reference to `inflateEnd'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflate'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflateInit_'
./obj/local/armeabi/libcrypto.so: undefined reference to `inflate'
./obj/local/armeabi/libcrypto.so: undefined reference to `deflateEnd'
./obj/local/armeabi/libcrypto.so: undefined reference to `inflateInit_'

Rgds
Indu

tera

unread,
Aug 26, 2013, 4:35:49 AM8/26/13
to
Dear Indu,

I have the exact same problem/error of the libz.

How did you solve it? Can anybody share your method? Thanks a ton,

-Tera



--
View this message in context: http://openssl.6102.n7.nabble.com/build-openssl-for-android-tp26315p46332.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
0 new messages