Porting snappy/libspicec.so onto Android-ARM

本文档介绍了Snappy及libspicec-glib.so从spicec-gtk-0.5移植到Android-ARM平台的过程。包括使用NDKr4c和gcc进行交叉编译,glib、pixman、openssl和jpeg等依赖库的具体配置步骤,以及最终运行snappy应用的命令。

   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 NDK r4c and agcc built and setup as previous blogs
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 in the blog:


http://blog.youkuaiyun.com/rozenix/archive/2011/03/25/6277742.aspx


#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

(you may should change

/* TLS */
#if defined(PIXMAN_NO_TLS)
into
/* TLS */
#define PIXMAN_NO_TLS
#if defined(PIXMAN_NO_TLS)

in /pixman/piman-compiler.c)

  and add this onto pixman/pixman-cpu.c:

typedef struct
{
    uint32_t a_type;              /* Entry type */
    union
    {
    uint32_t a_val;           /* Integer value */
    } a_un;
} elf_aux_entry;
typedef elf_aux_entry Elf32_auxv_t ;
)

 

2)openssl-1.0.0: config by:
./Configure linux-generic32 no-asm shared --prefix=/data/local
then modify the Makefile:

gcc-->agcc

change ar/nm/ranlib to their arm-eabi- peers,

set CFLAGS as

CFLAG= -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -UDSO_DLFCN -UHAVE_DLFCN_H -UTERMIO -O3 -fomit-frame-pointer -Wall

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 ;

patch file is in the blog:


http://blog.youkuaiyun.com/rozenix/archive/2011/03/25/6277742.aspx

 

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 make use or reference my attached file :amakfile

in:

http://blog.youkuaiyun.com/rozenix/archive/2011/03/25/6277742.aspx
  #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

 This the run-log:

 

http://blog.youkuaiyun.com/rozenix/archive/2011/03/25/6277742.aspx

 

 This is the snapped image:


That's it! Mail me if you've got any problems!
Happy hacking!

鸿蒙l0设备上适配恒玄开发版适配libmodbus报错[OHOS ERROR] [44/124] gcc cross compiler obj/third_party/libmodbus/src/libmodbus_static.modbus-rtu.o [OHOS ERROR] FAILED: obj/third_party/libmodbus/src/libmodbus_static.modbus-rtu.o [OHOS ERROR] ccache arm-none-eabi-gcc -D_XOPEN_SOURCE=700 -DOHOS_DEBUG -D__LITEOS__ -D__LITEOS_M__ -DSECUREC_IN_KERNEL=0 -D_BSD_SOURCE=1 -I../../../third_party/libmodbus -I../../../third_party/libmodbus/src -I../../../device/soc/bestechnic/aos_bsp/include/rtos/liteos/liteos_m/kal/cmsis -I../../../device/soc/bestechnic/aos_bsp/rtos/liteos/liteos_m -I../../../device/soc/bestechnic/aos_bsp/platform/hal -I../../../commonlibrary/utils_lite/include -I../../../base/iothardware/peripheral/interfaces/inner_api -I../../../kernel/liteos_m/arch/arm/common -I../../../kernel/liteos_m/arch/arm/cortex-m33/gcc/NTZ -I../../../kernel/liteos_m/arch/arm/include -I../../../kernel/liteos_m/arch/include -I../../../kernel/liteos_m/kernel/include -I../../../kernel/liteos_m/kal/libc/newlib/porting/include -I../../../third_party/bounds_checking_function/include -I../../../kernel/liteos_m/kal/posix/include -I../../../kernel/liteos_m/components/backtrace -I../../../kernel/liteos_m/components/cpup -I../../../kernel/liteos_m/components/exchook -I../../../kernel/liteos_m/components/fs/vfs -I../../../third_party/littlefs -I../../../third_party/littlefs/bd -I../../../kernel/liteos_m/components/fs/littlefs -I../../../device/soc/bestechnic/bes2600/liteos_m/components/net/lwip-2.1/porting/include -I../../../kernel/liteos_m/components/net/lwip-2.1/porting/include -I../../../third_party/lwip/src/include -I../../../kernel/liteos_m/components/power -I../../../kernel/liteos_m/components/signal -I../../../kernel/liteos_m/utils -Igen/device/board/fnlink/shields/v200zr-evb-t1 -I../../../device/soc/bestechnic/aos_bsp/rtos/liteos/liteos_m/kal/cmsis -I../../../device/soc/bestechnic/aos_bsp/platform/cmsis/inc -I../../../device/soc/bestechnic/aos_bsp/platform/drivers/ana -I../../../device/soc/bestechnic/aos_bsp/services/wifi_app/wifi_console -I../../../device/soc/bestechnic/aos_bsp/utils/crc32 -I../../../device/soc/bestechnic/aos_bsp/utils/kfifo -I../../../device/soc/bestechnic/aos_bsp/net/wifi -I../../../device/soc/bestechnic/aos_bsp/platform/hal/best2003 -I../../../device/soc/bestechnic/aos_bsp/services/norflash_api -I../../../device/soc/bestechnic/aos_bsp/utils/eshell -I../../../device/soc/bestechnic/aos_bsp/services/aiot/ota_secboot -I../../../device/soc/bestechnic/aos_bsp/net -I../../../device/soc/bestechnic/bes2600/liteos_m/components/drivers/display/hal -I../../../device/soc/bestechnic/bes2600/liteos_m/components/drivers/flash -I../../../device/soc/bestechnic/bes2600/liteos_m/components/drivers/mipi_dsi -I../../../device/soc/bestechnic/bes2600/liteos_m/components/drivers/touch -I../../../device/soc/bestechnic/bes2600/liteos_m/components/drivers/touch/include -I../../../device/soc/bestechnic/bes2600/liteos_m/components/fs -I../../../device/soc/bestechnic/bes2600/liteos_m/components/ui -I../../../device/soc/bestechnic/bes2600/liteos_m/components/utils/include -I../../../device/soc/bestechnic/bes2600/liteos_m/components/bt/inc -Os -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -fdata-sections -mthumb -mthumb-interwork -DPLAYER_TOOL -DCHIP_BEST2003 -DOS_HEAP_SIZE=0x600000 -DCHIP_HAS_UART=3 -DRTOS -DDEBUG=1 -DCMSIS_OS_VER=2 -DOS_HWI_MAX_NUM=96 -DCONFIG_DISPLAY_A064 -DLFS_MAX_OPEN_DIRS=32 -DMBEDTLS_CMSIS_FILE=\"rtos/liteos/liteos_m/kal/cmsis/cmsis_os.h\" -DMINE_HARMONY_SOFTBUS -DLOSCFG_BASE_CORE_HILOG -DPTHREAD_KEYS_MAX=128 -DWIFI_STATE_NOT_AVALIABLE=0 -DTCP_USER_TIMEOUT=18 -D_stext=__text_start__ -D_etext=__text_end__ -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -fdata-sections -mthumb -mthumb-interwork -DPLAYER_TOOL -DCHIP_BEST2003 -DOS_HEAP_SIZE=0x600000 -DCHIP_HAS_UART=3 -DRTOS -DDEBUG=1 -DCMSIS_OS_VER=2 -DOS_HWI_MAX_NUM=96 -DCONFIG_DISPLAY_A064 -DLFS_MAX_OPEN_DIRS=32 -DMBEDTLS_CMSIS_FILE=\"rtos/liteos/liteos_m/kal/cmsis/cmsis_os.h\" -DMINE_HARMONY_SOFTBUS -DLOSCFG_BASE_CORE_HILOG -DPTHREAD_KEYS_MAX=128 -DWIFI_STATE_NOT_AVALIABLE=0 -DTCP_USER_TIMEOUT=18 -D_stext=__text_start__ -D_etext=__text_end__ -mcpu=cortex-m33 -fno-common -fno-builtin -fno-strict-aliasing -Wall -fsigned-char -fstack-protector-all -imacros /home/zkxi/workspace/L0_332/src/out/v200zr/display_demo/config.h -std=c99 -c ../../../third_party/libmodbus/src/modbus-rtu.c -o obj/third_party/libmodbus/src/libmodbus_static.modbus-rtu.o [OHOS ERROR] In file included from ../../../third_party/libmodbus/src/modbus-rtu-private.h:19, [OHOS ERROR] from ../../../third_party/libmodbus/src/modbus-rtu.c:18: [OHOS ERROR] /root/toolchain/gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/include/termios.h:4:10: fatal error: sys/termios.h: No such file or directory [OHOS ERROR] 4 | #include <sys/termios.h> [OHOS ERROR] | ^~~~~~~~~~~~~~~ [OHOS ERROR] compilation terminated. 这是怎么回事,给出具体的修改方案?
09-10
FAILED: esp-idf/LvglHandler/CMakeFiles/__idf_LvglHandler.dir/LvglHandler.c.obj ccache D:\APP\esp-idf\Espressif\tools\xtensa-esp-elf\esp-14.2.0_20241119\xtensa-esp-elf\bin\xtensa-esp32s3-elf-gcc.exe -DESP_PLATFORM -DIDF_VER=\"v5.4.1-dirty\" -DLV_CONF_INCLUDE_SIMPLE -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/build/config -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/LvglHandler -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/newlib/platform_include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/freertos/config/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/freertos/config/include/freertos -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/freertos/config/xtensa/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/freertos/FreeRTOS-Kernel/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/freertos/esp_additions/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/include/soc -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/include/soc/esp32s3 -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/dma/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/ldo/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/debug_probe/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/port/esp32s3/. -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_hw_support/port/esp32s3/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/heap/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/heap/tlsf -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/log/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/soc/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/soc/esp32s3 -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/soc/esp32s3/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/soc/esp32s3/register -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/hal/platform_port/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/hal/esp32s3/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/hal/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_rom/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_rom/esp32s3/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_rom/esp32s3/include/esp32s3 -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_rom/esp32s3 -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_common/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_system/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_system/port/soc -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_system/port/include/private -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/xtensa/esp32s3/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/xtensa/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/xtensa/deprecated_include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/include/apps -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/include/apps/sntp -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/lwip/src/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/port/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/port/freertos/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/port/esp32xx/include -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/port/esp32xx/include/arch -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/lwip/port/esp32xx/include/sys -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/managed_components/lvgl__lvgl -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/managed_components/lvgl__lvgl/src -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/managed_components -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/managed_components/lvgl__lvgl/examples -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/managed_components/lvgl__lvgl/demos -ID:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1/components/esp_timer/include -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/View -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/View/Style -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/Public -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/SysCfgDeal -ID:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/SysStateDisplay -mlongcalls -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -fdiagnostics-color=always -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-error=extra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mdisable-hardware-atomics -Og -fno-shrink-wrap -fmacro-prefix-map=D:/gitlab/AIoT_Pad/base/AIoT-Pad/Src=. -fmacro-prefix-map=D:/APP/esp-idf/Espressif/frameworks/esp-idf-v5.4.1=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/LvglHandler/CMakeFiles/__idf_LvglHandler.dir/LvglHandler.c.obj -MF esp-idf\LvglHandler\CMakeFiles\__idf_LvglHandler.dir\LvglHandler.c.obj.d -o esp-idf/LvglHandler/CMakeFiles/__idf_LvglHandler.dir/LvglHandler.c.obj -c D:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/LvglHandler/LvglHandler.c D:/gitlab/AIoT_Pad/base/AIoT-Pad/Src/components/LvglHandler/LvglHandler.c:28:10: fatal error: lv_port_disp_template.h: No such file or directory 28 | #include "lv_port_disp_template.h"
最新发布
09-10
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值