Can't create shared library with static inside

后端 未结 3 643
误落风尘
误落风尘 2020-12-10 21:32

Please help I search throw whole internet but I can\'t find answer ...

C Layer

I have created simple function int mean(int, int); and place i

3条回答
  •  [愿得一人]
    2020-12-10 22:19

    As I suppos the main reason was compiler settings, I make some modifications in makefile and my .a archive linked to shared library, here are modifications.

    GCC := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-gcc.exe
    GPP := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-g++.exe
    AR  := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-ar.exe
    
    OPTIONS  :=\
    -fpic \
    -ffunction-sections \
    -funwind-tables  \
    -fstack-protector \
    -D__ARM_ARCH_5__ \
    -D__ARM_ARCH_5T__ \
    -D__ARM_ARCH_5E__ \
    -D__ARM_ARCH_5TE__ \
    -Wno-psabi \
    -march=armv5te \
    -mtune=xscale \
    -msoft-float \
    -mthumb \
    -Os \
    -fomit-frame-pointer \
    -fno-strict-aliasing \
    -finline-limit=64 \
    -DANDROID \
    -Wa, \
    -O2 \
    -DNDEBUG \
    -g \
    
    default: all
    
    
    all: obj
        $(AR) r libtestlibrary.a *.o
    
    obj:
        $(GCC) $(OPTIONS) -c *.c
    

提交回复
热议问题