Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Failed to run "build_android.sh" i686-linux-android-g++: error: unrecognized command line option '-fno-limit-debug-info' #2539

Open
avrum opened this issue Jul 24, 2018 · 0 comments

Comments

@avrum
Copy link

avrum commented Jul 24, 2018

Issue description

I want to compile all the android native libraries (.a & .so) to x86 processor.
While running the "build_android.sh" script i'm getting failed error regarding the make file.

Code example

I tried running both for x86 and arm64, failed to do so in both scenarios:

./scripts/build_android.sh -DANDROID_ABI=arm64-v8a -DANDROID_TOOLCHAIN=clang
./scripts/build_android.sh -DANDROID_ABI=x86 -DANDROID_TOOLCHAIN=clang

System Info

Mac 10.12.6
Android NDK - R14
cmake version 3.12.0
clang Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0

The error while running the build with x86 is :

Android: Selected GCC toolchain 'x86-4.9'
-- Check for working CXX compiler: /Users/myuser/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-g++
-- Check for working CXX compiler: /Users/myuser/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-g++ -- broken
CMake Error at /usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler

"/Users/myuser/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-g++"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /Users/myuser/Workspaces/pytorch_source_code/pytorch/build_android/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_6ad89/fast"
/Users/myuser/Downloads/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_6ad89.dir/build.make CMakeFiles/cmTC_6ad89.dir/build
Building CXX object CMakeFiles/cmTC_6ad89.dir/testCXXCompiler.cxx.o
/Users/myuser/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-g++ --target=i686-none-linux-android --sysroot=/Users/myuser/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86   -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86/usr/include -isystem /Users/myuser/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86/usr/include/i686-linux-android  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -frtti -fexceptions   -O0 -fno-limit-debug-info  -fPIE   -o CMakeFiles/cmTC_6ad89.dir/testCXXCompiler.cxx.o -c /Users/myuser/Workspaces/pytorch_source_code/pytorch/build_android/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
i686-linux-android-g++: error: unrecognized command line option '-fno-limit-debug-info'
make[1]: *** [CMakeFiles/cmTC_6ad89.dir/testCXXCompiler.cxx.o] Error 1
make: *** [cmTC_6ad89/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/myuser/Workspaces/pytorch_source_code/pytorch/build_android/CMakeFiles/CMakeOutput.log".
See also "/Users/myuser/Workspaces/pytorch_source_code/pytorch/build_android/CMakeFiles/CMakeError.log".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant