Qt build static library for all architectures - android

I try build static library for Android (*.a). My pro-file:
QT -= gui
TEMPLATE = lib
CONFIG += staticlib
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS
ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64
SOURCES += \
untitled3.cpp
HEADERS += \
untitled3.h
Files untitled3.cpp and untitled3.h very simple. When I build project I get the only one library *.a, but expected get four libs for all architectures: armeabi-v7a arm64-v8a x86 x86_64
When I build at first, compilation finished with error:
10:13:57: Running steps for project untitled3...
10:13:57: Starting: "C:\Qt\Qt5.14.1\5.14.1\android\bin\qmake.exe" C:\Users\range\Documents\untitled3\untitled3.pro -spec android-clang "CONFIG+=debug" "CONFIG+=qml_debug" ANDROID_ABIS="armeabi-v7a arm64-v8a x86 x86_64"
Info: creating stash file C:\Users\range\Documents\andr_out\.qmake.stash
WARNING: Targets of builds 'Armeabi-v7a' and 'Arm64-v8a' conflict: libuntitled3.a.
10:13:57: The process "C:\Qt\Qt5.14.1\5.14.1\android\bin\qmake.exe" exited normally.
10:13:57: Starting: "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" -f C:/Users/range/Documents/andr_out/Makefile qmake_all
make: Nothing to be done for 'qmake_all'.
10:13:57: The process "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" exited normally.
10:13:57: Starting: "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" -j12
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.Armeabi-v7a all
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.Arm64-v8a all
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.X86 all
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.X86_64 all
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target armv7a-linux-androideabi21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -marm -O0 -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Iarmeabi-v7a -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o armeabi-v7a\untitled3.obj ..\untitled3\untitled3.cpp
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Iarm64-v8a -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o arm64-v8a\untitled3.obj ..\untitled3\untitled3.cpp
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target i686-linux-android21 -mstackrealign -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Ix86 -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o x86\untitled3.obj ..\untitled3\untitled3.cpp
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target x86_64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Ix86_64 -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o x86_64\untitled3.obj ..\untitled3\untitled3.cpp
del libuntitled3.a
del libuntitled3.a
del libuntitled3.a
del libuntitled3.a
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a arm64-v8a\untitled3.obj
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a armeabi-v7a\untitled3.obj
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a x86\untitled3.obj
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a x86_64\untitled3.obj
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android-ranlib: libuntitled3.a: Permission denied
make[1]: *** [Makefile.Arm64-v8a:67: libuntitled3.a] Error 1
make: *** [Makefile:62: arm64-v8a-all] Error 2
make: *** Waiting for unfinished jobs....
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android-ranlib: unable to rename 'libuntitled3.a'; reason: File exists
make[1]: *** [Makefile.X86_64:67: libuntitled3.a] Error 1
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
make: *** [Makefile:90: x86_64-all] Error 2
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android-ranlib: unable to rename 'libuntitled3.a'; reason: File exists
make[1]: *** [Makefile.X86:67: libuntitled3.a] Error 1
make: *** [Makefile:76: x86-all] Error 2
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
10:13:58: The process "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" exited with code 2.
Error while building/deploying project untitled3 (kit: Android for armeabi-v7a,arm64-v8a,x86,x86_64 (Clang Qt 5.14.1 for Android))
When executing step "Make"
10:13:58: Elapsed time: 00:01.
When I build at second, compilation finished successfully, but in output dir I find one *.a - lib:
In folders armeabi-v7a arm64-v8a x86 x86_64 exist only *.obj - files, but not exist .a - files.
My question: how correct build static library (.a) for android for all (4) architectures?
P.S.: Qt version for Android: 5.14.1; Qt Creator version: 4.11.0, based on Qt version: 5.14.0

have you tried building 4 seperate projects for each android architecture (a .pro for each architecture) to see what the result is? it’s obviously not ideal when the project gets larger, but from diagnostics point of view it’s worth a try.

Related

Qt Android Error: arm-linux-androideabi-g++: error: unrecognized command line option '-fstack-protector-strong'

I have an error while building android application with newly installed Qt 5.8.0 for Android in Windows 10
This is my compile output:
11:06:25: Running steps for project untitled5...
11:06:26: Starting: "C:\Qt\Qt5.8.0_Android\5.8\android_armv7\bin\qmake.exe" C:\Users\mir.moezi\Documents\untitled5\untitled5.pro -spec android-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
11:06:28: The process "C:\Qt\Qt5.8.0_Android\5.8\android_armv7\bin\qmake.exe" exited normally.
11:06:29: Starting: "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe" qmake_all
mingw32-make: Nothing to be done for 'qmake_all'.
11:06:31: The process "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
11:06:31: Starting: "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe"
C:\Qt\Qt5.8.0_Android\5.8\android_armv7\bin\uic.exe ..\untitled5\mainwindow.ui -o ui_mainwindow.h
C:\Qt\Android\android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=C:\Qt\Android\android-ndk-r10/platforms/android-16/arch-arm/ -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\untitled5 -I. -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include\QtWidgets -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include\QtGui -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include\QtCore -I. -I. -I..\..\..\..\Qt\Android\android-ndk-r10\sources\cxx-stl\gnu-libstdc++\4.8\include -I..\..\..\..\Qt\Android\android-ndk-r10\sources\cxx-stl\gnu-libstdc++\4.8\libs\armeabi-v7a\include -I..\..\..\..\Qt\Android\android-ndk-r10\platforms\android-16\arch-arm\usr\include -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\mkspecs\android-g++ -o main.obj ..\untitled5\main.cpp
arm-linux-androideabi-g++: error: unrecognized command line option '-fstack-protector-strong'
Makefile:1291: recipe for target 'main.obj' failed
mingw32-make: *** [main.obj] Error 1
11:06:33: The process "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled5 (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.8.0))
When executing step "Make"
11:06:33: Elapsed time: 00:08.
Please help me to solve this error!
Here is my packages installed :
qt-opensource-windows-x86-android-5.8.0
JDK.7.Update.80.x64
apache-ant-1.10.1-bin
Android-NDK32-r10-windows-x86_64
Android.SDK.Release.v24.4.1.Windowsinstaller_r24.4.1-windows
what is '-fstack-protector-strong' ?
I think this prevents Qt Creator from continuing !
This problem was because of my android NDK, it was a little old.
I removed Android-NDK32-r10-windows-x86_64 and installed Android-NDK32-r14-windows-x86_64 and now it works fine.

"qmake" and "make" QtRemoteObjects (from git) for Qt 5.7 Android on Windows 7 does not work

I have cloned the QtRemoteObjects repository from: http://code.qt.io/cgit/playground/qtremoteobjects.git/
on my Windows 7 using GitBash.exe.
The project files are download to "D:\Daten\Android\qtremoteobjects\". Based on the article on this website: https://www.kdab.com/qt-android-create-android-service-using-qt/ I run this command in GitBash:
$ cd d:/Daten/Android/qtremoteobjects/
$ git c:/Qt5.7.0/5.7/android_armv7/bin/qmake -r && make && make install
QMAKE PART
For the qmake part these errors show up:
Reading D:/Daten/Android/qtremoteobjects/tests/auto/cmake/cmake.pro
Das System kann den angegebenen Pfad nicht finden.
meaning the system could not find the given path. And the next two errors are:
WARNING: Failure to find: rep_server_source.h
Project MESSAGE: cmake executable not found. Not running CMake unit tests
First question: Why doesnt the system find the path for cmake.pro and rep_server_source.h and why isnt the cmake executable not found even though I have separately installed CMake.
MAKE PART
The next error that shows up is:
bash: make: command not found
As a solution to this I separated the qmake and make process. I first just ran qmake
$ git c:/Qt5.7.0/5.7/android_armv7/bin/qmake -r
and when qmake is finished (and the same errors as above still show up) i run mingw32-make.exe from Qt5.7->Tools in the qtremoteobjects folder:
$ c:/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make.exe
and this is the result:
cd src/ && ( test -e Makefile || C:/Qt5.7.0/5.7/android_x86/bin/qmake.exe
D:/Daten/Android/qtremoteobjects/src/src.pro -o Makefile ) && C:/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make -f Makefile
mingw32-make[1]: Entering directory 'D:/Daten/Android/qtremoteobjects/src'
cd remoteobjects/ && ( test -e Makefile || C:/Qt5.7.0/5.7/android_x86/bin/qmake.exe D:/Daten/Android/qtremoteobjects/src/remoteobjects/remoteobjects.pro -o Makefile ) && C:/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make -f Makefile
mingw32-make[2]: Entering directory 'D:/Daten/Android/qtremoteobjects/src/remoteobjects'
D:\Daten\Android\android-ndk-r10e/toolchains/x86-4.9/prebuilt/windows/bin/i686-linux-android-g++ -c -ffunction-sections -funwind-tables -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -mfpmath=sse -O2 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wno-psabi -W -Wvla -D_REENTRANT -fPIC -DQT_NO_XKBCOMMON -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_URL_CAST_FROM_STRING -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Ic:/utils/openssl-android-master/include -I../../include -I../../include/QtRemoteObjects -I../../include/QtRemoteObjects/5.6.1 -I../../include/QtRemoteObjects/5.6.1/QtRemoteObjects -I. -IC:/Qt5.7.0/5.7/android_x86/include -IC:/Qt5.7.0/5.7/android_x86/include/QtNetwork -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0 -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0/QtCore -IC:/Qt5.7.0/5.7/android_x86/include/QtCore -I.moc -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include -isystem D:/Daten/Android/android-ndk-r10e/platforms/android-9/arch-x86/usr/include -IC:/Qt5.7.0/5.7/android_x86/mkspecs/android-g++ -o .obj/qconnection_local_backend.obj qconnection_local_backend.cpp
Makefile:1720: recipe for target '.obj/qconnection_local_backend.obj' failed
process_begin: CreateProcess(NULL, D:\Daten\Android\android-ndk-r10e/toolchains/x86-4.9/prebuilt/windows/bin/i686-linux-android-g++ -c -ffunction-sections -funwind-tables -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -mfpmath=sse -O2 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wno-psabi -W -Wvla -D_REENTRANT -fPIC -DQT_NO_XKBCOMMON -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_URL_CAST_FROM_STRING -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Ic:/utils/openssl-android-master/include -I../../include -I../../include/QtRemoteObjects -I../../include/QtRemoteObjects/5.6.1 -I../../include/QtRemoteObjects/5.6.1/QtRemoteObjects -I. -IC:/Qt5.7.0/5.7/android_x86/include -IC:/Qt5.7.0/5.7/android_x86/include/QtNetwork -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0 -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0/QtCore -IC:/Qt5.7.0/5.7/android_x86/include/QtCore -I.moc -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include -isystem D:/Daten/Android/android-ndk-r10e/platforms/android-9/arch-x86/usr/include -IC:/Qt5.7.0/5.7/android_x86/mkspecs/android-g++ -o .obj/qconnection_local_backend.obj qconnection_local_backend.cpp, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
mingw32-make[2]: *** [.obj/qconnection_local_backend.obj] Error 2
mingw32-make[2]: Leaving directory 'D:/Daten/Android/qtremoteobjects/src/remoteobjects'
Makefile:44: recipe for target 'sub-remoteobjects-make_first-ordered' failed
mingw32-make[1]: *** [sub-remoteobjects-make_first-ordered] Error 2
mingw32-make[1]: Leaving directory 'D:/Daten/Android/qtremoteobjects/src'
Makefile:46: recipe for target 'sub-src-make_first' failed
mingw32-make: *** [sub-src-make_first] Error 2
Second Question Why is make not successful here? what do these errors mean? What is wrong with '.obj/qconnection_local_backend.obj'
Is it because I am running make on Windows?
Thanks,

linphone-android "Error while using running prepare.py"

I am building linphone-android on Ubuntu 14.04.
According to the the README file, I finish all pre-installation, run the check_tools.sh, and find no problem.
But, then running the prepare.py, I meet the below problem(in cmake/CMakeFiles/CMakeError.log):
Determining if the C compiler works failed with the following output:
Change Dir: /home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec3545077747/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3545077747.dir/build.make CMakeFiles/cmTryCompileExec3545077747.dir/build
make[1]: Entering directory `/home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3545077747.dir/testCCompiler.c.o
/opt/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -DANDROID -fPIE -isystem /opt/android/ndk/sources/android/cpufeatures -isystem /opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -isystem /opt/android/ndk/sources/android/support/include -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fno-strict-aliasing -o CMakeFiles/cmTryCompileExec3545077747.dir/testCCompiler.c.o -c /home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp/testCCompiler.c
error: unknown target CPU 'armv5te'
make[1]: Leaving directory `/home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec3545077747.dir/testCCompiler.c.o] Error 1
make: *** [cmTryCompileExec3545077747/fast] Error 2
Bravo!
I update my cmake to the newest version , and work it out!

Exec format error when compiling android kernel

I am trying to build a kernel for Xperia SP.
First I have git-cloned the kernel source from here:
https://github.com/Tomoms/android_kernel_sony_msm8x60
then git-cloned this toolchain:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7
then I went to:
KERNEL_FOLDER/arch/arm/configs
and copied msm8960_defconfig (as i think Xperia SP has msm8960) to root of KERNEL_FOLDER and renamed it to .config
then I opened the terminal in the KERNEL_FOLDER directory and typed
make ARCH=arm CROSS_COMPILE=~/toolchains/arm-eabi-4.7/bin/arm-eabi-
and got this
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/basic/fixdep
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/home/pc/toolchains/arm-eabi-4.7/bin/arm-eabi-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem /home/pc/toolchains/arm-eabi-4.7/bin/arm-eabi-gcc -print-file-name=include [Errno 8] Exec format error -I/home/pc/android/kernel/android_kernel_sony_msm8x60/arch/arm/include -Iarch/arm/include/generated -Iinclude -include /home/pc/android/kernel/android_kernel_sony_msm8x60/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -Os -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fomit-frame-pointer -g -mtune=cortex-a7 -mfpu=neon-vfpv4 -fgraphite -floop-parallelize-all -ftree-loop-linear -floop-interchange -floop-strip-mine -floop-block -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(bounds) -DKBUILD_MODNAME=KBUILD_STR(bounds) -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c [Errno 8] Exec format error
make[1]: *** [kernel/bounds.s] Error 8
make: *** [prepare0] Error 2
People used to get this error when building on 32bit systems. Ensure you are building on 64bit linux.

stdexcept On Android

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.

Categories

Resources