[Spice-devel] Porting snappy/libspicec-glib.so onto Android-ARM

Shuxiang Lim shohyanglim at gmail.com
Thu Mar 31 01:10:44 PDT 2011


Mae govannon!
     Well,this has nearly been solved by recross-compiling the openssl
statically and building libssl/libcrpt.a into libspicec, but I still cannot
use the system ones, never mind.
*root at gnollwood:/angmar/gtk/spice-gtk-0.5/gtk# l libspicec.so snappy
-rwxr-xr-x 1 root root 5.6M 2011-03-31 15:54 libspicec.so
-rwxr-xr-x 1 root root  62K 2011-03-31 15:54 snappy
now the libspicec has "NO" dependences at all!
    Namaarie!

*
On Thu, Mar 31, 2011 at 3:15 PM, Shuxiang Lim <shohyanglim at gmail.com> wrote:

> Hi,
>   I wonder if there anybody has tried my solution,for I've got no feedback
> till now?
>   Now,because the deps of spicec-gtk are so MANY,thus use the static libs
> shall be economic,
> hence the new snappy/libspicec.so:
> *# arm-eabi-readelf -d libspicec.so
> Dynamic section at offset 0x38bf98 contains 22 entries:
>   Tag        Type                         Name/Value
>  0x00000001 (NEEDED)                     Shared library: [libdl.so]
>  0x00000001 (NEEDED)                     Shared library: [libstdc++.so]
>  0x00000001 (NEEDED)                     Shared library: [libz.so]
>  0x00000001 (NEEDED)                     Shared library: [libc.so]
>  0x00000001 (NEEDED)                     Shared library: [libcrypto.so]
>  0x00000001 (NEEDED)                     Shared library: [libssl.so]
>  0x00000001 (NEEDED)                     Shared library: [libm.so]
> ...*
> all the deps of libspicec.so can be found in android system,the other deps
> such as glibs are all built staticaly into libspicec.
>   But I got another bug, when staticaly linked,libcrypto and libssl will
> spit SEGFAULT in running(the same as when using the shared ones in Android
> system),but my self-compiled shared libssl and libcrypto work well, why?
> Does this mean there is some buggy use in
> spice-channel.c :spice_channel_send_auth()? The static or system's shared
> libssl/libcrypto always die at RSA_size() or BIO_free() in
> spice_channel_send_auth()).
>   Would Somebody do a try or check on this?
>   I'm keen on that.
>   Rgrds.
>
>
> On Fri, Mar 25, 2011 at 3:52 PM, Shuxiang Lim <shohyanglim at gmail.com>wrote:
>
>> Hi!
>>   There already exist libssl.so and libcrypto.so in Android (in
>> /system/lib/ of my device),
>> but my snappy/libspicec.so got only SEGFAULT if using them,I hope someone
>> has time to check why.
>>   Besides these. All the functions in snappy/libspicec.so works well with
>> all my built libs.
>>   .eg. I use this cmd to start qemu to fore the use
>> pixman/jpeg/zlib/openssl:
>> *#sudo qemu-system-x86_64 ... -spice port=5900,password=gnoll,\
>> jpeg-wan-compression=always,\
>> zlib-glz-wan-compression=always
>>    On the device:
>> #LD_LIBRARY_PATH=./lib ./snappy -h 192.168.1.31 -p 5900 -w gnoll -o
>> ahoo.ppm
>> (snappy:3157): GSpice-DEBUG: spice-session.c:803 session: disconnecting 0
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:127 main-1:0:
>> spice_channel_constructed
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:1400 Open coroutine starting
>> 0x22018
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:1257 Started background
>> coroutine 0x22044
>> (snappy:3157): GSpice-DEBUG: spice-session.c:900 Resolving host
>> 192.168.1.31 5900
>> (snappy:3157): GSpice-DEBUG: spice-session.c:913 Trying one socket
>> (snappy:3157): GSpice-DEBUG: spice-session.c:864 Socket pending
>> (snappy:3157): GSpice-DEBUG: spice-session.c:879 Finally connected
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:931 main-1:0:
>> spice_channel_recv_link_msg: 0 caps
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:793 main-1:0: channel up,
>> state 5
>> (snappy:3157): GSpice-DEBUG: spice-session.c:1015 set mm time: 25115964
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:127 cursor-4:0:
>> spice_channel_constructed
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:127 display-2:0:
>> spice_channel_constructed
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:127 inputs-3:0:
>> spice_channel_constructed
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:1400 Open coroutine starting
>> 0x2a000
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:1257 Started background
>> coroutine 0x2a02c
>> (snappy:3157): GSpice-DEBUG: spice-session.c:900 Resolving host
>> 192.168.1.31 5900
>> (snappy:3157): GSpice-DEBUG: spice-session.c:913 Trying one socket
>> (snappy:3157): GSpice-DEBUG: spice-session.c:864 Socket pending
>> (snappy:3157): GSpice-DEBUG: spice-session.c:879 Finally connected
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:931 display-2:0:
>> spice_channel_recv_link_msg: 0 caps
>> (snappy:3157): GSpice-DEBUG: spice-channel.c:793 display-2:0: channel up,
>> state 5
>> (snappy:3157): GSpice-DEBUG: channel-display.c:522 display: create primary
>> canvas
>> (snappy:3157): GSpice-DEBUG: snappy.c:44 primary_create: 640x480, format
>> 32
>> wrote screen shot to ahoo.ppm
>> *  Best Rgrds.
>>
>>
>> On Fri, Mar 25, 2011 at 3:17 PM, Shuxiang Lim <shohyanglim at gmail.com>wrote:
>>
>>>
>>> All the files bz2ed.
>>>
>>> On Fri, Mar 25, 2011 at 2:58 PM, Shuxiang Lim <shohyanglim at gmail.com>wrote:
>>>
>>>> amakefile attathed.
>>>>
>>>>
>>>> On Fri, Mar 25, 2011 at 2:41 PM, Shuxiang Lim <shohyanglim at gmail.com>wrote:
>>>>
>>>>> Hi,guys!
>>>>>    This is my instructions and patches for porting
>>>>> snappy/libspicec-glib.so extracted from spicec-gtk-0.5 onto Android-ARM.
>>>>>    It's still nascent and raw though, more hacking is needed!
>>>>>    These are my steps, suppose you're familiar with cross compiling.
>>>>>
>>>>> 1.I use the android NDK provided by Mozzila which has nearly full C++
>>>>> support:
>>>>>
>>>>> http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2
>>>>> and I have modified Andrew Ross's perl script:agcc to extract and use
>>>>> the toolchain from this NDK (attached)
>>>>> 2. Then I cross compile glib2.28.1 onto Android in this order:
>>>>> 1)libiconv-1.13.1.tar.gz:
>>>>> configured by:
>>>>> *CC=agcc CXX=agcc LD=arm-eabi-ld RANLIB=arm-eabi-ranlib \
>>>>> PKG_CONFIG_LIBDIR=/data/local/lib/pkgconfig:/data/local/share/pkgconfig/
>>>>> \
>>>>>     ./configure \
>>>>>     --prefix=/data/local \
>>>>>     --host=arm-eabi-linux \*
>>>>> *    --enable-shared \*
>>>>>  2)gettext-0.18.1.1.tar.gz
>>>>> configured by:
>>>>> *CC=agcc CPPFLAGS="-I/data/local/include" LDFLAGS="-L/data/local/lib"
>>>>> CXX=agcc LD=arm-eabi-ld RANLIB=arm-eabi-ranlib \
>>>>> PKG_CONFIG_LIBDIR=/data/local/lib/pkgconfig:/data/local/share/pkgconfig/
>>>>> \
>>>>>     ./configure \
>>>>>     --prefix=/data/local \
>>>>>     --host=arm-eabi-linux \
>>>>>     --enable-shared \
>>>>>     --cache-file=arm.cache \
>>>>>     --without-included-regex \
>>>>>     --disable-java --disable-openmp --without-libiconv-prefix
>>>>> --without-libintl-prefix --without-libglib-2.0-prefix
>>>>> --without-libcroco-0.6-prefix --with-included-libxml
>>>>> --without-libncurses-prefix --without-libtermcap-prefix
>>>>> --without-libcurses-prefix --without-libexpat-prefix --without-emacs
>>>>>   * But the build of gettext will not fully succeed,never mind, I need
>>>>> only libintl.so so just make install.
>>>>>
>>>>> 3)  glib-2.28.1.tar.gz
>>>>> 1st, do patching with my attached file
>>>>> *#patch -p0 < ** glib-android.patch*
>>>>>  2nd, write this into the cache file arm.cache:
>>>>> *#cat > arm.cache
>>>>> ac_cv_android_arm=yes
>>>>> glib_cv_stack_grows=no
>>>>> ** glib_cv_uscore=no*
>>>>> *ac_cv_func_posix_getpwuid_r=no
>>>>> ac_cv_func_posix_getgrgid_r=no*
>>>>> ctrl-D
>>>>> 3rd, make sure you have the tools such as glib-genmarshaller of right
>>>>> vision in your host machine(you may need to first install glib on your host
>>>>> machine)
>>>>> 4th, autoconf;then configured  the same as libiconv.
>>>>> 5td, make;make install
>>>>>
>>>>> 3. Also I have to port pixman and openssl and jpeg onto android.
>>>>> 1)pixman-0.20.0,jpeg-6b: config. make;make install same as libiconv
>>>>> 2)openssl-1.0.0: config by:
>>>>> ./config no-asm shared --prefix=/data/local/
>>>>> then modify the Makefile:gcc-->agcc remove the -m64..etc.
>>>>> make;make install
>>>>>
>>>>> 4. for snappy and libspicec-glib.so
>>>>> 1).tar xf spice-gtk-0.5.tar.gz
>>>>> 2).#patch -p0 < snappy-android.patch (file attached)
>>>>> 3).ensure to succeed in the normal ./configure and make on the current
>>>>> host machine to generate config.h and some other files.
>>>>> *#CC=gcc \
>>>>> ./configure \
>>>>> --prefix=/usr/local/mylocal \
>>>>> --enable-shared \
>>>>> --cache-file=arm.cache \
>>>>> --with-coroutine=gthread
>>>>> #make
>>>>>
>>>>> *4).#cd gtk/
>>>>> 5). you may use or reference my attached file :amakfile
>>>>>   #make clean -f amakefile
>>>>>   #make -f amakefile
>>>>> 6) put the lib*.so files and exec. file snappy onto android device and
>>>>> run.
>>>>> *#LD_LIBRARY_PATH=/system/lib:/data/local/lib ./snappy -h 192.168.1.31
>>>>> -p 5900 -o ahoo.ppm*
>>>>>
>>>>> You may have check my snapped image ahoo.jpeg<--ahoo.ppm and run-logs
>>>>> in my blogs:
>>>>> http://blog.csdn.net/rozenix/archive/2011/03/25/6277742.aspx
>>>>> http://blog.csdn.net/rozenix/archive/2011/03/25/6277647.aspx
>>>>>
>>>>> That's it! Mail me if you've got any problem!
>>>>> Happy hacking!
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110331/68a8d29a/attachment-0001.htm>


More information about the Spice-devel mailing list