Android Openssl library - libcrypto.so and libssl.so

5,469 views
Skip to first unread message

Abhyudai Shanker

unread,
Jun 22, 2010, 2:17:09 AM6/22/10
to andro...@googlegroups.com
I am tryin to 'make' the code I have downloaded from the link :
http://www.google.com/url?sa=D&q=http://android.git.kernel.org/%3Fp%3Dplatform/external/openssl.git%3Ba%3Dsummary&usg=AFQjCNHSVU0QjNdHMsLAuZX-ln7YKqEmCA

This code provides libcrypto.so and libssl.so which I am interested in.

I am basically trying to get libcrypto.so and libssl.so which would required to run my openssl based code on my htc nexus one phone.

However, when i try to run the above downloaded code, it compiles all the files required for libcrypto.so but gives the error:
make: *** No rule to make target `/cygdrive/c/android-ndk-r4/
samples/DMVPNC/bin/
ndk/local/armeabi/libdl.so', needed by `/cygdrive/c/android-ndk-r4/samples/DMVPN
C/bin/ndk/local/armeabi/libcrypto.so'.  Stop.

However, other projects which require the same libdl.so are getting it.

I am not able to understand why this is happening. Please guide me as to how i should proceed

Looking forward to hear from you

Abhyudai Shanker

David Turner

unread,
Jun 22, 2010, 2:47:01 AM6/22/10
to andro...@googlegroups.com
Remove the line that says LOCAL_SHARED_LIBRARIES := libdl in your Android.mk files.
These are only useful for the full build, when generating platform images.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Abhyudai Shanker

unread,
Jun 24, 2010, 6:04:17 AM6/24/10
to andro...@googlegroups.com
Thanks for your quick reply David,

The thing worked.

I would just like to add that in addition to David's solution, the .s files that were mentioned in the crypto folder android.mk had to be converted to .S (i.e. capital 's').

then it just works!!!!

Abhyudai Shanker

unread,
Jun 24, 2010, 6:05:20 AM6/24/10
to andro...@googlegroups.com
just replace the small '.s' a capital '.S' in android.mk.

Ó. Egilsson

unread,
Jul 8, 2010, 6:44:25 AM7/8/10
to android-ndk
I am doing extactly the same thing.

However, the dl library is causing me troubles.
Modified parts of Android.mk look like this:

//////////////////////////
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../.. \
$(LOCAL_PATH)/../include

#LOCAL_SHARED_LIBRARIES += libz
#ifneq ($(TARGET_SIMULATOR),true)
# LOCAL_SHARED_LIBRARIES += libdl
#endif

LOCAL_LDLIBS += -ldl
LOCAL_MODULE:= crypto
include $(BUILD_STATIC_LIBRARY)
//////////////////////////

But the errors I get:
...
Compile thumb : crypto <= /cygdrive/i/android/projects/gvtalk/jni/
openssl/crypto/0.9.9-dev/sha/sha512-armv4.S
StaticLibrary : libcrypto.a
SharedLibrary : libjingle.so
/cygdrive/i/android/projects/gvtalk/bin/ndk/local/armeabi/
libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
/cygdrive/i/android/projects/gvtalk/jni/openssl/crypto/dso/dso_dlfcn.c:
261: undefined reference to `dlsym'
/cygdrive/i/android/projects/gvtalk/jni/openssl/crypto/dso/dso_dlfcn.c:
265: undefined reference to `dlerror'
/cygdrive/i/android/projects/gvtalk/bin/ndk/local/armeabi/
libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
/cygdrive/i/android/projects/gvtalk/jni/openssl/crypto/dso/dso_dlfcn.c:
227: undefined reference to `dlsym'
/cygdrive/i/android/projects/gvtalk/jni/openssl/crypto/dso/dso_dlfcn.c:
231: undefined reference to `dlerror'
/cygdrive/i/android/projects/gvtalk/bin/ndk/local/armeabi/
libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
/cygdrive/i/android/projects/gvtalk/jni/openssl/crypto/dso/dso_dlfcn.c:
203: undefined reference to `dlclose'
...


It's like we ain't linking to the dl library? Any ideas ?



On Jun 24, 11:05 am, Abhyudai Shanker <abhyudai.shan...@gmail.com>
wrote:
> just replace the small '.s' a capital '.S' in android.mk.
>
> On Thu, Jun 24, 2010 at 3:34 PM, Abhyudai Shanker <
>
> abhyudai.shan...@gmail.com> wrote:
> > Thanks for your quick reply David,
>
> > The thing worked.
>
> > I would just like to add that in addition to David's solution, the .s files
> > that were mentioned in the crypto folder android.mk had to be converted to
> > .S (i.e. capital 's').
>
> > then it just works!!!!
>
> > On Tue, Jun 22, 2010 at 12:17 PM, David Turner <di...@android.com> wrote:
>
> >> Remove the line that says LOCAL_SHARED_LIBRARIES := libdl in your
> >> Android.mk files.
> >> These are only useful for the full build, when generating platform images.
>
> >> On Mon, Jun 21, 2010 at 11:17 PM, Abhyudai Shanker <
> >> abhyudai.shan...@gmail.com> wrote:
>
> >>> I am tryin to 'make' the code I have downloaded from the link :
>
> >>>http://www.google.com/url?sa=D&q=http://android.git.kernel.org/%3Fp%3...
>
> >>> This code provides libcrypto.so and libssl.so which I am interested in.
>
> >>> I am basically trying to get *libcrypto.so and libssl.so* which would
> >>> required to run my openssl based code on my htc nexus one phone.
>
> >>> However, when i try to run the above downloaded code, it compiles all the
> >>> files required for libcrypto.so but gives the error:
> >>> make: *** No rule to make target `/cygdrive/c/android-ndk-r4/
> >>> samples/DMVPNC/bin/
> >>> ndk/local/armeabi/libdl.so', needed by
> >>> `/cygdrive/c/android-ndk-r4/samples/DMVPN
> >>> C/bin/ndk/local/armeabi/libcrypto.so'.  Stop.
>
> >>> However, other projects which require the same libdl.so are getting it.
>
> >>> I am not able to understand why this is happening. Please guide me as to
> >>> how i should proceed
>
> >>> Looking forward to hear from you
>
> >>> Abhyudai Shanker
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "android-ndk" group.
> >>> To post to this group, send email to andro...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/android-ndk?hl=en.
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-ndk" group.
> >> To post to this group, send email to andro...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>
> >> .

Ó. Egilsson

unread,
Jul 8, 2010, 8:07:40 AM7/8/10
to android-ndk
Sometimes I pretend to be very clever when I can answer my own
questions :)

Of course I had to link the libjingle library to the dl library, by
adding the line
LOCAL_LDLIBS += -ldl

to my library's Android.mk

Abhyudai Shanker

unread,
Jul 8, 2010, 9:05:08 AM7/8/10
to andro...@googlegroups.com
:-)

To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

Ó. Egilsson

unread,
Jul 8, 2010, 9:12:08 AM7/8/10
to android-ndk
And, to save someone else from potential premature hairloss:

If, when linking to libssl and libcrypto you get "undefined reference"
errors, like:
/cygdrive/i/android/projects/gvtalk/jni/openssl/ssl/t1_enc.c:285:
undefined reference to `COMP_CTX_free'
/cygdrive/i/android/projects/gvtalk/jni/openssl/ssl/t1_enc.c:290:
undefined reference to `COMP_CTX_new'
/cygdrive/i/android/projects/gvtalk/jni/openssl/ssl/t1_enc.c:322:
undefined reference to `COMP_CTX_free'
/cygdrive/i/android/projects/gvtalk/jni/openssl/ssl/t1_enc.c:327:
undefined reference to `COMP_CTX_new'

It could be that libssl is not before your libcrypto in the line
LOCAL_STATIC_LIBRARIES := ssl crypto ...


On Jul 8, 2:05 pm, Abhyudai Shanker <abhyudai.shan...@gmail.com>
wrote:
> :-)
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> > > > >>> .
> > > > >>> For more options, visit this group at
> > > > >>>http://groups.google.com/group/android-ndk?hl=en.
>
> > > > >>  --
> > > > >> You received this message because you are subscribed to the Google
> > Groups
> > > > >> "android-ndk" group.
> > > > >> To post to this group, send email to andro...@googlegroups.com.
> > > > >> To unsubscribe from this group, send email to
> > > > >> android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages