Thursday, January 31, 2008

trying building shared library for google android

There is an article Shared library "Hello World!" for Android, describes how to create a simple shared library for google android, and shows how to link with the shared library to create a dynamic linked executable. The steps are correct, but it is not easy to create a shared library for google android with an existing linux distribution open source software.

Here is some findings when I tried to create a shared library for google android with a open source software:
1. pthread related functions are implemented in google android libc.so
2. no stderr, stdin, stdout definition are found in google android
3. some function mangling is different, such as strtod, strtol, isspace, and etc. Some can be fixed with some MACRO variable, such as __NO_INLINE__. Need to identify one by one, read the include head files in CROSS_COMPILE_FOLDER /arm-none-linux-gnueabi/libc/usr/include/
4. no mkstemp64, open64, and other xxx64 functions found

Following are the pthread found in google android /system/lib/libc.so:
42: 0000a41c 32 FUNC GLOBAL DEFAULT 7 pthread_cond_signal
61: 0000a26c 56 FUNC GLOBAL DEFAULT 7 pthread_mutexattr_gettype
64: 0000a510 32 FUNC GLOBAL DEFAULT 7 pthread_attr_destroy
69: 0000a144 16 FUNC GLOBAL DEFAULT 7 pthread_attr_getstacksize
71: 0000afa0 620 FUNC GLOBAL DEFAULT 7 pthread_create
75: 0000a3a8 28 FUNC GLOBAL DEFAULT 7 pthread_getspecific
86: 0000a050 72 FUNC GLOBAL DEFAULT 7 pthread_attr_init
92: 0000ad60 304 FUNC GLOBAL DEFAULT 7 pthread_exit
119: 0000a1b0 24 FUNC GLOBAL DEFAULT 7 pthread_attr_getstack
165: 0000a15c 24 FUNC GLOBAL DEFAULT 7 pthread_attr_getstackaddr
177: 0000a8c8 228 FUNC GLOBAL DEFAULT 7 pthread_key_delete
202: 0000a254 24 FUNC GLOBAL DEFAULT 7 pthread_mutexattr_destroy
208: 0000a22c 16 FUNC GLOBAL DEFAULT 7 pthread_equal
265: 0000a1ec 16 FUNC GLOBAL DEFAULT 7 pthread_attr_getguardsize
299: 0000aad8 188 FUNC GLOBAL DEFAULT 7 pthread_cond_timedwait_mo
340: 0000ac58 176 FUNC GLOBAL DEFAULT 7 pthread_detach
352: 0000a0f0 16 FUNC GLOBAL DEFAULT 7 pthread_attr_getschedpoli
368: 0000a154 8 FUNC GLOBAL DEFAULT 7 pthread_attr_setstackaddr
387: 0000a4b0 96 FUNC GLOBAL DEFAULT 7 pthread_getschedparam
441: 0000a43c 32 FUNC GLOBAL DEFAULT 7 pthread_cond_broadcast
459: 0000a45c 84 FUNC GLOBAL DEFAULT 7 pthread_setschedparam
471: 0000a9ac 176 FUNC GLOBAL DEFAULT 7 pthread_key_create
499: 0000a3cc 80 FUNC GLOBAL DEFAULT 7 pthread_kill
505: 0000aa5c 124 FUNC GLOBAL DEFAULT 7 pthread_cond_timeout_np
512: 0000a1fc 44 FUNC GLOBAL DEFAULT 7 pthread_getattr_np
514: 0000a120 36 FUNC GLOBAL DEFAULT 7 pthread_attr_setstacksize
546: 0000a3c4 8 FUNC GLOBAL DEFAULT 7 pthread_sigmask
559: 0000a35c 16 FUNC GLOBAL DEFAULT 7 pthread_cond_init
643: 0000a174 60 FUNC GLOBAL DEFAULT 7 pthread_attr_setstack
647: 0000a2a4 64 FUNC GLOBAL DEFAULT 7 pthread_mutexattr_settype
681: 0000a0d0 20 FUNC GLOBAL DEFAULT 7 pthread_attr_getdetachsta
694: 0000a690 180 FUNC GLOBAL DEFAULT 7 pthread_mutex_unlock
772: 0000a228 4 FUNC GLOBAL DEFAULT 7 pthread_self
778: 0000a23c 24 FUNC GLOBAL DEFAULT 7 pthread_mutexattr_init
788: 00009630 0 FUNC GLOBAL DEFAULT 7 __pthread_clone
818: 0000a344 24 FUNC GLOBAL DEFAULT 7 pthread_mutex_destroy
826: 0000a744 388 FUNC GLOBAL DEFAULT 7 pthread_mutex_lock
831: 0000ac50 8 FUNC GLOBAL DEFAULT 7 pthread_cond_wait
845: 0000a1c8 36 FUNC GLOBAL DEFAULT 7 pthread_attr_setguardsize
858: 0000a55c 308 FUNC GLOBAL DEFAULT 7 pthread_mutex_trylock
869: 0000a36c 24 FUNC GLOBAL DEFAULT 7 pthread_cond_destroy
874: 0000a0e4 12 FUNC GLOBAL DEFAULT 7 pthread_attr_setschedpoli
886: 0000a2e4 96 FUNC GLOBAL DEFAULT 7 pthread_mutex_init
920: 0000a100 16 FUNC GLOBAL DEFAULT 7 pthread_attr_setschedpara
936: 0000a098 56 FUNC GLOBAL DEFAULT 7 pthread_attr_setdetachsta
942: 0000ad08 88 FUNC GLOBAL DEFAULT 7 pthread_join
952: 0000ab94 188 FUNC GLOBAL DEFAULT 7 pthread_cond_timedwait
963: 0000a110 16 FUNC GLOBAL DEFAULT 7 pthread_attr_getschedpara
967: 0000a384 36 FUNC GLOBAL DEFAULT 7 pthread_setspecific

6 comments:

Shilpa said...

Hi,

I am also facing the same issue.Can you pls elaborate more on this?

Thanks,
Shilpa

rtm said...

please give more information about your problems, errors, maybe I can give some helps.

murali said...

i have a pbm i.e. my google maps application is working in my system but it is giving an error in the othe system as missing_shared_library .can any one help me?its urgent yaar

rtm said...

it is helpful to root cause if you paste your command line, and the error information from your screen.

Chhavi Garg said...

the google map application is nt running in my system.Facing error like MISSING SHARED LIBRARY.cn u help??its urgent

Chhavi Garg said...
This comment has been removed by the author.