![binutils 캐나다 크로스 컴파일 설치 중 오류가 발생했습니다.](https://linux55.com/image/96152/binutils%20%EC%BA%90%EB%82%98%EB%8B%A4%20%ED%81%AC%EB%A1%9C%EC%8A%A4%20%EC%BB%B4%ED%8C%8C%EC%9D%BC%20%EC%84%A4%EC%B9%98%20%EC%A4%91%20%EC%98%A4%EB%A5%98%EA%B0%80%20%EB%B0%9C%EC%83%9D%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
Android NDK를 사용하여 Android용 binutils를 컴파일하려고 하므로 찾은 가이드를 사용하여 NDK를 설치했습니다.여기(특히 "고수준 방법") Lua를 성공적으로 컴파일하여 작동함을 증명했습니다.
내가 따라온 단계는 다음과 같습니다.
export NDK=/path/to/ndk
export SYSROOT=$NDK/platforms/android-23/arch-arm
$NDK/build/tools/make_standalone_toolchain.py --arch=arm --api=23 --install-dir /tmp/android-toolchain
export PATH=/tmp/android-toolchain/bin:$PATH
mkdir build-binutils
cd binutils
export TARGET=arm-linux-androideabi
export HOST=$TARGET
export BUILD=x86_64-linux
../binutils-2.27/configure --host=$HOST --target=$TARGET --build=$BUILD --with-sysroot=$SYSROOT --disable-nls --disable-werror
make
make install
make install
다음 출력으로 실패합니다.
This is not dpkg install-info anymore, but GNU install-info
See the man page for ginstall-info for command line arguments
./libtool: line 1118: arm-linux-androideabi-ranlib: command not found
make[5]: *** [install-bfdlibLTLIBRARIES] Error 127
make[4]: *** [install-am] Error 2
make[3]: *** [install-recursive] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-bfd] Error 2
make: *** [install] Error 2
이것은 arm-linux-androideabi-ranlib
잘 실행됩니다.
$ arm-linux-androideabi-ranlib
Usage: arm-linux-androideabi-ranlib [options] archive
Generate an index to speed access to archives
The options are:
@<file> Read options from <file>
--plugin <name> Load the specified plugin
-D Use zero for symbol map timestamp
-U Use actual symbol map timestamp (default)
-t Update the archive's symbol map timestamp
-h --help Print this help message
-v --version Print version information
arm-linux-androideabi-ranlib: supported targets: elf32-littlearm elf32- bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
크로스 컴파일 툴체인을 설치하는 올바른 방법은 무엇입니까?
답변1
범인을 찾았습니다. 실제로 sudo make install
running 이 아닌 running 중이 어서 make install
사용자 전환으로 인해 임시 경로가 무시되고 있었습니다. 해결책은 실행 sudo su
한 다음 PATH를 업데이트하고 다시 실행하는 것 입니다.make install