[英]Make keeps using native gcc instead of Android NDK
First of all, I know only basics about makefile and I'm new to Android NDK. 首先,我只知道关于makefile的基础知识,而且我是Android NDK的新手。
I've got x64 Linux Mint 17.1 and Android NDK r8e , and I'm trying to build NetHack for Android . 我有x64 Linux Mint 17.1和Android NDK r8e ,我正在尝试为Android构建NetHack 。
As stated in README , basic idea is to modify makefile with local Android NDK path: 如README中所述 ,基本思想是使用本地Android NDK路径修改makefile:
NDK = /path/to/android-ndk-r8d
SYSROOT=$(NDK)/platforms/android-9/arch-arm
CC = $(NDK)/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=$(SYSROOT)
But I keep getting this error: 但我一直收到这个错误:
cc -m32 -o makedefs makedefs.o ./monst.o ./objects.o /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
cc -m32 -o makedefs makedefs.o ./monst.o ./objects.o / usr / bin / ld:在搜索时跳过不兼容的/usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a lgcc
Apparently /usr/bin/ld is being used instead of arm-linux-androideabi-ld and it doesn't look for libgcc.a in Android NDK folder. 显然使用/ usr / bin / ld而不是arm-linux-androideabi-ld ,它不会在Android NDK文件夹中查找libgcc.a 。 Am I missing some environment variable or make argument?
我错过了一些环境变量还是参数?
Thanks. 谢谢。
Here's complete output: 这是完整的输出:
touch ../src/config.h-t
/opt/android/ndk/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android/ndk/android-ndk-r8e/platforms/android-9/arch-arm -DANDROID -Wno-format -fsigned-char -I../include -c monst.c
/opt/android/ndk/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android/ndk/android-ndk-r8e/platforms/android-9/arch-arm -DANDROID -Wno-format -fsigned-char -I../include -c objects.c
make[2]: Entering directory `/home/rzhilich/Projects/NetHack-Android/util'
cc -m32 -Wno-format -I../include -c -o makedefs.o makedefs.c
makedefs.c: In function ‘do_rumors’:
makedefs.c:361:2: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Data);
^
makedefs.c: In function ‘do_date’:
makedefs.c:560:2: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^
makedefs.c: In function ‘do_dungeon’:
makedefs.c:1232:2: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Data);
^
makedefs.c: In function ‘do_monstr’:
makedefs.c:1354:5: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^
makedefs.c: In function ‘do_permonst’:
makedefs.c:1395:2: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^
makedefs.c: In function ‘do_objs’:
makedefs.c:1711:2: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^
makedefs.c: In function ‘do_vision’:
makedefs.c:1866:5: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^
makedefs.c:1891:5: warning: format not a string literal and no format arguments [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^
cc -m32 -Wno-format -I../include -c ../src/monst.c -o monst.o
cc -m32 -Wno-format -I../include -c ../src/objects.c -o objects.o
cc -m32 -o makedefs makedefs.o ./monst.o ./objects.o
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/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
collect2: error: ld returned 1 exit status
make[2]: *** [makedefs] Error 1
make[2]: Leaving directory `/home/rzhilich/Projects/NetHack-Android/util'
make[1]: *** [../util/makedefs] Error 2
make[1]: Leaving directory `/home/rzhilich/Projects/NetHack-Android/src'
make: *** [nethack] Error 2
Apparently installation instruction isn't complete. 显然安装说明不完整。 For some reason util folder is not build using Android NDK gcc, but with system default cc .
由于某种原因, util文件夹不是使用Android NDK gcc构建的,而是使用系统默认cc 。 After installing following packages:
安装以下包后:
I've set system default gcc version to 4.6 using update-alternatives
. 我使用
update-alternatives
将系统默认gcc版本设置为4.6。 And it solved my issue. 它解决了我的问题。
see how iw
http://z4ziggy.wordpress.com/category/aircrack/ 怎么看
iw
http://z4ziggy.wordpress.com/category/aircrack/
and tcpdump
are built https://github.com/chatch/tcpdump-android.git 和
tcpdump
构建https://github.com/chatch/tcpdump-android.git
The important thing is 重要的是
echo "| CREATING TOOLCHAIN |"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.