4

I am trying to build .so file for different cpu architecture in OpenH264.

README.md of OpenH264 suggest

add "ARCH=mips" or "ARCH=x86". To build for the older armeabi ABI (which has
armv5te as baseline), add "APP_ABI=armeabi" (ARCH=arm is implicit).

So I fired following command

For x86

make os=android NDKROOT=/home/neosoft/android-ndk-r10d/ ARCH=x86 TARGET=android-12

I get something like

/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [libopenh264.so] Error 1

and when I try to build it with armeabi

make os=android NDKROOT=/home/neosoft/android-ndk-r10d/ ARCH=armeabi TARGET=android-12

I get

cc -O3 -DHAVE_NEON -Wall -fno-strict-aliasing -fPIC -DLINUX -MMD -MP  -Icodec/common/arm/ -march=armv7-a -mfpu=neon -Icodec/api/svc -Icodec/common/inc   -c -o codec/common/arm/copy_mb_neon.o codec/common/arm/copy_mb_neon.S
cc: error: unrecognized command line option ‘-mfpu=neon’
make: *** [codec/common/arm/copy_mb_neon.o] Error 1

can somebody point me how to compile this lib for different cpu architecture.

Manoj
  • 2,799
  • 5
  • 30
  • 49

1 Answers1

2

For linux :
a. First run this command

export PATH=ANDROID_SDK_PATH/tools:$PATH

b. Now run this for x86 ARCH.

 make install os=android NDKROOT=/home/neosoft/android-ndk-r10d TARGET=android-14 ARCH=x86 

For other Arch just run this by replacing ARCH type

make os=android NDKROOT=/home/neosoft/android-ndk-r10d TARGET=android-14 ARCH=armeabi 

For Windows :
a. Install MinGW( https://www.youtube.com/watch?v=DHekr3EtDOA).
b. Install MYSY in MinGW/bin folder.
c. Install nasm in MinGW/bin/1.0/bin folder.
d. Go to MinGW\bin\1.0\ location and run msys.bat.
e. Run below command by replacing ARCH type.

make install os=android NDKROOT=/home/neosoft/android-ndk-r10d TARGET=android-14 ARCH=x86 
fahad_sust
  • 526
  • 1
  • 6
  • 21