I'm trying to cross-compile OpenSSH for an Android Plateform (Armv7) using the Android-NDK. To do this, I followed instructions based on this post : Cross Compile OpenSSH for ARM.
I replace the "arm-linux-gnueabi-gcc" by the android equivalent : "arm-linux-androideabi-gcc". I managed to compile zlib and openssl, but when it comes to openssh, things become more complicated ...
Here is what I've done :
export HOST=arm-linux-androideabi
./configure --host=$HOST --target=$HOST --prefix=$HOME/OpenSSH/opensshArm
After that I had the following output :
configure: error: *** OpenSSL headers missing - please install first or check config.log ***
So I modified my ./configure by this one :
./configure --host=$HOST --target=$HOST --prefix=$HOME/OpenSSH/opensshArm --with-ssl-dir=$HOME/OpenSSH/out/usr
Where $HOME/out/ is the output directory used to compile zlib and openssl.
Here is where I'm stuck : I launch the "make" and here is thi output :
make[1]: Entering directory `/home/test/OpenSSH/openssh-6.4p1/openbsd-compat'
arm-linux-androideabi-gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wno-pointer-sign -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -fno-builtin-memset -I. -I.. -I. -I./.. -I/home/test/OpenSSH/out/usr/include -DHAVE_CONFIG_H -c bsd-arc4random.c
In file included from /home/test/OpenSSH/out/usr/include/openssl/crypto.h:120,
from /home/test/OpenSSH/out/usr/include/openssl/bn.h:133,
from ../buffer.h:49,
from ../entropy.h:30,
from ../includes.h:177,
from bsd-arc4random.c:17:
/home/test/toolchain/bin/../sysroot/usr/include/stdlib.h:168: error: expected identifier or '(' before numeric constant
make[1]: *** [bsd-arc4random.o] Error 1
make[1]: Leaving directory `/home/test/OpenSSH/openssh-6.4p1/openbsd-compat'
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2
Any helps ?
Related
buttler#buttler:~/kodi$ **make -C tools/depends/target/cmakebuildsys BUILD_DIR=$HOME/kodi-build**<br/>
make: Entering directory '/home/buttler/kodi/tools/depends/target/cmakebuildsys'<br/>
mkdir -p /home/buttler/kodi-build<br/>
cd /home/buttler/kodi-build; /home/buttler/android-tools/xbmc-depends/x86_64-linux-gnu-native/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/home/buttler/android-tools/xbmc-depends/arm-linux-androideabi-21-debug/share/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=/home/buttler/android-tools/xbmc-depends/arm-linux-androideabi-21-debug -DCMAKE_BUILD_TYPE=Debug -DENABLE_INTERNAL_CROSSGUID=OFF -DENABLE_INTERNAL_FFMPEG=OFF /home/buttler/kodi<br/>
-- The CXX compiler identification is GNU 9.2.1<br/>
-- The C compiler identification is GNU 9.2.1<br/>
-- The ASM compiler identification is GNU<br/>
-- Found assembler: /usr/bin/cc<br/>
-- Check for working CXX compiler: /usr/bin/c++<br/>
-- Check for working CXX compiler: /usr/bin/c++ -- broken<br/>
CMake Error at /home/buttler/android-tools/xbmc-depends/x86_64-linux-gnu-native/share/cmake-3.12/Modules/CMakeTestCXXCompiler.cmake:45 (message):<br/>
The C++ compiler
"/usr/bin/c++"
is not able to compile a simple test program.
It fails with the following output:<br/>
Change Dir: /home/buttler/kodi-build/CMakeFiles/CMakeTmp<br/>
Run Build Command:"/usr/bin/make" "cmTC_39029/fast"<br/>
make[1]: Entering directory '/home/buttler/kodi-build/CMakeFiles/CMakeTmp'<br/>
/usr/bin/make -f CMakeFiles/cmTC_39029.dir/build.make CMakeFiles/cmTC_39029.dir/build<br/>
make[2]: Entering directory '/home/buttler/kodi-build/CMakeFiles/CMakeTmp'<br/>
Building CXX object CMakeFiles/cmTC_39029.dir/testCXXCompiler.cxx.o<br/>
/usr/bin/c++ -DANDROID -D__ANDROID_API__=21 -fexceptions -funwind-tables -fstack-<br/>protector-strong -no-canonical-prefixes -fPIC -DPIC -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -frtti -g -D_DEBUG -I/home/buttler/android-tools/xbmc-depends/arm-linux-androideabi-21-debug/include/android-21 -isystem /home/buttler/android-tools/xbmc-depends/arm-linux-androideabi-21-debug/include -o CMakeFiles/cmTC_39029.dir/testCXXCompiler.cxx.o -c /home/buttler/kodi-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx<br/>
c++: error: unrecognized command line option ‘-mfloat-abi=softfp’<br/>
c++: error: unrecognized command line option ‘-mfpu=neon’<br/>
make[2]: *** [CMakeFiles/cmTC_39029.dir/build.make:66: CMakeFiles/cmTC_39029.dir/testCXXCompiler.cxx.o] Error 1<br/>
make[2]: Leaving directory '/home/buttler/kodi-build/CMakeFiles/CMakeTmp'<br/>
make[1]: ** [Makefile:121: cmTC_39029/fast] Error 2<br/>
make[1]: Leaving directory '/home/buttler/kodi-build/CMakeFiles/CMakeTmp'<br/>
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!<br/>
See also "/home/buttler/kodi-build/CMakeFiles/CMakeOutput.log".<br/>
See also "/home/buttler/kodi-build/CMakeFiles/CMakeError.log".<br/>
make: *** [Makefile:17: all] Error 1<br/>
make: Leaving directory '/home/buttler/kodi/tools/depends/target/cmakebuildsys'<br/>
I need to upgrade my OpenSSL library to openssl-1.0.0o and I want to know if this version has android support.
I am following the steps in this thread, while trying to build it in cygwin, but I get an error on 'make all':
/cygdrive/d/ndk+openssl/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/pr
ebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/cygdrive/d/ndk+openssl
/android-ndk-r10d/platforms/android-19/arch-arm/ -I. -I.. -I../include -D_WINDL
L -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H -DTERMIOS -DL_ENDI
AN -fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPEN
SSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_A
SM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM -c -o cryptlib.o cryptlib.c
/cygdrive/d/ndk+openssl/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/pr
ebuilt/linux-x86/bin/arm-linux-androideabi-gcc: /cygdrive/d/ndk+openssl/android-
ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/arm-linux-a
ndroideabi-gcc: cannot execute binary file
<builtin>: recipe for target 'cryptlib.o' failed
make[1]: *** [cryptlib.o] Error 126
make[1]: Leaving directory '/cygdrive/d/ndk+openssl/openssl-1.0.0o/crypto'
Makefile:247: recipe for target 'build_crypto' failed
make: *** [build_crypto] Error 1
Any help would be appreciated. Thank you.
Your build environment is broken: cross-compiler is not working at all on your host machine. You can't build any source with that compiler on that host. You should build android and related libs in correct build environment. In short words you should use some linux (x64?) host, not cygwin.
I am compiling the VLC for Android on Ubuntu 12.04, basing on this instruction
Always get this error when compiling the libgmp
ibstdc++/4.7/include -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -DNDEBUG -I/home/jerry/workspaces/vlc/vlc/contrib/arm-linux-androideabi/include -g -c -o mpn/add.lo mpn/add.c
/bin/bash ./libtool --tag=CC --mode=compile arm-linux-androideabi-gcc --sysroot=/home/jerry/workspaces/android-ndk-r8e/platforms/android-9/arch-arm -std=gnu99 -DHAVE_CONFIG_H -I. -D__GMP_WITHIN_GMP -g -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -O2 -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/include -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -DNDEBUG -I/home/jerry/workspaces/vlc/vlc/contrib/arm-linux-androideabi/include -g -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -O2 -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/include -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -DNDEBUG -I/home/jerry/workspaces/vlc/vlc/contrib/arm-linux-androideabi/include -g -c -o mpn/add_1.lo mpn/add_1.c
make[3]: *** No rule to make target `mpn/add_n.lo', needed by `libgmp.la'. Stop.
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/jerry/workspaces/vlc/vlc/contrib/android/gmp'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/jerry/workspaces/vlc/vlc/contrib/android/gmp'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/jerry/workspaces/vlc/vlc/contrib/android/gmp'
make: *** [.gmp] Error 2
Does anyone know to correct this problem?
I had the same error and GMP is still at version 4.2.1 but this was not the problem for me. A lot of other packages also failed. The problem was due to two different (and somehow incompatible) versions of libtool. Version 2.2.10 is provided by vlc itself in vlc/extras/tools, the other came from the distribution (Mint) at version 2.4.2. make clean in this tools-folder solved it for me, if it doesn't for you, you could try to set LIBTOOL_VERSION=2.4.2 or whatever version your distro provides in configure.mak.
The root cause was that at when config.status concatenates the config with ltmain.sh, some major parts of ltmain.sh are lost, so no compilation was done at all, hence the missing dependency.
After that everything compiled fine (didn't try to install though).
-rw-r--r-- 1 user user 8437456 Jun 5 21:00 VLC-debug.apk
It is a bug of the GMP, I fixed it by upgrading the GMP to v5.0+
This problem occurs because gmp/Makefile does not include gmp/mpn/Makeasm.am.
I don't know why but just copying gmp/mpn/Makeasm.am to the end of gmp/Makefile.am worked for me.
Upgrading gmp to version 5.1.2 did not help me.
Compiled fine with 5.1.1 https://ftp.gnu.org/gnu/gmp/gmp-5.1.1.tar.lz
I got similer error with gmp-6.0.0 and gmp-6.2.1 too, they were slightly different though.
In order to use ffmpeg in android , I tried to build ffmpeg by using build_libstagefright in
ffmpeg/tools/lib_stagefright
but it alwalys appear a error which i coundn't solve it.
the message in the bottom of ffmpeg/config.log is
arm-linux-androideabi-g++ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/base/media/libstagefright -I../android-source/frameworks/base/include/media/stagefright/openmax -I/home/user/android-ndk/sources/cxx-stl/gnu-libstdc++/include -I/home/user/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon -march=armv7-a -std=c99 -fomit-frame-pointer -fPIC -marm -Wno-multichar -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -c -o /tmp/ffconf.6ZzEMs87.o /tmp/ffconf.5jbfvJxK.cpp
./configure: line 701: /home/user/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: cannot execute binary file
ERROR: libstagefright_h264 not found
Anyone have the solution of this ??
my Build Environment is
Window 7
Cygwin
android-NDK-r8b linux version
I found a method ,let me cross this error.
In file of ffmpeg/configure
origin :
enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
fixed :
enabled libstagefright && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
When I fix libstagefright_h264 to libstagefright here, it seems be normal until the next error.
CC libavcodec/lagarithrac.o
CC libavcodec/latm_parser.o
CXX libavcodec/libstagefright.o
/bin/sh: /home/user/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux- x86/bin/arm-linux-androideabi-g++: cannot execute binary file
CC libavcodec/lcldec.o
common.mak:51: recipe for target `libavcodec/libstagefright.o' failed
make: *** [libavcodec/libstagefright.o] Error 126
make: *** Waiting for unfinished jobs....
PS: ffmpeg version is 1.0
Take a look at ffmpeg/config.log - there has to be an error description on the last line.
PS. On windows i used MinGW|MSYS to successfully compile ffmpeg
I'm trying to compile SoundTouch on Android. I started with this configure line:
./configure CPPFLAGS="-I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/" LDFLAGS="-Wl,-rpath-link=/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -L/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -nostdlib -lc" --host=arm-eabi --enable-shared=yes CFLAGS="-nostdlib -O3 -mandroid" host_alias=arm-eabi --no-create --no-recursion
Because the Android NDK targets ARM, I also had to change the Makefile to remove the -msse2 flags to progress.
When I run 'make', I get:
/bin/sh ../../libtool --tag=CXX --mode=compile arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c -o FIRFilter.lo FIRFilter.cpp
libtool: compile: arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c FIRFilter.cpp -o FIRFilter.o
FIRFilter.cpp:46:21: error: stdexcept: No such file or directory
FIRFilter.cpp: In member function 'virtual void soundtouch::FIRFilter::setCoefficients(const soundtouch::SAMPLETYPE*, uint, uint)':
FIRFilter.cpp:177: error: 'runtime_error' is not a member of 'std'
FIRFilter.cpp: In static member function 'static void* soundtouch::FIRFilter::operator new(size_t)':
FIRFilter.cpp:225: error: 'runtime_error' is not a member of 'std'
make[2]: *** [FIRFilter.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
This isn't very surprising, since the -nostdlib flag was required. Android seems to have neither stdexcept nor stdlib. How can I get past this block of compiling SoundTouch?
At a guess, there may be some flag I don't know about that I should use. I could refactor the code not to use stdexcept. There may be a way to pull in the original stdexcept source and reference that. I might be able to link to a precompiled stdexcept library.
The default provided gcc version provided with the android ndk does not support exceptions. See http://www.crystax.net/android/ndk.php for an alternative build which does.