当前位置: 技术问答>linux和unix
用crosstool 制作交叉编译工具链
来源: 互联网 发布时间:2017-01-29
本文导语: 下面是用crosstools制作交叉编译工具链, 以下是编译过程: whw@whw-Aspire-4752:~/toolchain-build$ sudo ../toolchain-install/bin/ct-ng build [INFO ] Performing some trivial sanity checks [INFO ] Build started 20111215.183007 [INFO ] Buildin...
下面是用crosstools制作交叉编译工具链,
以下是编译过程:
whw@whw-Aspire-4752:~/toolchain-build$ sudo ../toolchain-install/bin/ct-ng build
[INFO ] Performing some trivial sanity checks
[INFO ] Build started 20111215.183007
[INFO ] Building environment variables
[EXTRA] Preparing working directories
[EXTRA] Installing user-supplied crosstool-NG configuration
[EXTRA] =================================================================
[EXTRA] Dumping internal crosstool-NG configuration
[EXTRA] Building a toolchain for:
[EXTRA] build = x86_64-unknown-linux-gnu
[EXTRA] host = x86_64-unknown-linux-gnu
[EXTRA] target = arm-unknown-linux-gnueabi
[EXTRA] Dumping internal crosstool-NG configuration: done in 0.14s (at 00:10)
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components' tarballs
[INFO ] Retrieving needed toolchain components' tarballs: done in 0.13s (at 00:10)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[INFO ] Extracting and patching toolchain components: done in 16.14s (at 00:26)
[INFO ] =================================================================
[INFO ] Installing GMP
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP: done in 104.41s (at 02:11)
[INFO ] =================================================================
[INFO ] Installing MPFR
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR: done in 21.51s (at 02:32)
[INFO ] =================================================================
[INFO ] Installing PPL
[EXTRA] Configuring PPL
[EXTRA] Building PPL
[EXTRA] Installing PPL
[INFO ] Installing PPL: done in 200.58s (at 05:53)
[INFO ] =================================================================
[INFO ] Installing CLooG/ppl
[EXTRA] Configuring CLooG/ppl
[EXTRA] Building CLooG/ppl
[EXTRA] Installing CLooG/ppl
[INFO ] Installing CLooG/ppl: done in 6.73s (at 05:59)
[INFO ] =================================================================
[INFO ] Installing binutils
[EXTRA] Configuring binutils
[EXTRA] Building binutils
[EXTRA] Installing binutils
[INFO ] Installing binutils: done in 54.53s (at 06:54)
[INFO ] =================================================================
[INFO ] Installing static core C compiler
[EXTRA] Configuring static core C compiler
[EXTRA] Building static core C compiler
[EXTRA] Installing static core C compiler
[INFO ] Installing static core C compiler: done in 138.29s (at 09:12)
[INFO ] =================================================================
[INFO ] Installing kernel headers
[EXTRA] Installing kernel headers
[EXTRA] Checking installed headers
[INFO ] Installing kernel headers: done in 7.88s (at 09:20)
[INFO ] =================================================================
[INFO ] Installing C library headers & start files
[EXTRA] Configuring C library
[EXTRA] Installing C library headers
[EXTRA] Installing C library start files
[INFO ] Installing C library headers & start files: done in 40.89s (at 10:01)
[INFO ] =================================================================
[INFO ] Installing shared core C compiler
[EXTRA] Configuring shared core C compiler
[EXTRA] Building shared core C compiler
[EXTRA] Installing shared core C compiler
[INFO ] Installing shared core C compiler: done in 151.75s (at 12:33)
[INFO ] =================================================================
[INFO ] Installing C library
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Installing C library: done in 691.04s (at 24:04)
[INFO ] =================================================================
[INFO ] Installing final compiler
[EXTRA] Configuring final compiler
[EXTRA] Building final compiler
[EXTRA] Installing final compiler
[INFO ] Installing final compiler: done in 306.70s (at 29:11)
[INFO ] =================================================================
[INFO ] Installing libelf for the target
[EXTRA] Configuring libelf
[EXTRA] Building libelf
[EXTRA] Installing libelf
[INFO ] Installing libelf for the target: done in 10.14s (at 29:21)
[INFO ] =================================================================
[INFO ] Installing binutils for target
[EXTRA] Configuring binutils for target
[EXTRA] Building binutils' libraries (libiberty bfd) for target
[EXTRA] Installing binutils' libraries (libiberty bfd) for target
[INFO ] Installing binutils for target: done in 109.15s (at 31:10)
[INFO ] =================================================================
[INFO ] Installing dmalloc
[EXTRA] Configuring dmalloc
[EXTRA] Building dmalloc
[EXTRA] Installing dmalloc
[INFO ] Installing dmalloc: done in 12.20s (at 31:22)
[INFO ] =================================================================
[INFO ] Installing D.U.M.A.
[EXTRA] Copying sources
[EXTRA] Building libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing shared library link
[EXTRA] Installing wrapper script
[INFO ] Installing D.U.M.A.: done in 4.87s (at 31:27)
[INFO ] =================================================================
[INFO ] Installing cross-gdb
[EXTRA] Configuring cross-gdb
[EXTRA] Building cross-gdb
[EXTRA] Installing cross-gdb
[INFO ] Installing cross-gdb: done in 139.21s (at 33:46)
[INFO ] =================================================================
[INFO ] Installing native gdb
[EXTRA] Building static target ncurses
[EXTRA] Building static target expat
[EXTRA] Configuring native gdb
[EXTRA] Building native gdb
[EXTRA] Installing native gdb
[EXTRA] Cleaning up ncurses
[INFO ] Installing native gdb: done in 278.90s (at 38:25)
[INFO ] =================================================================
[INFO ] Installing gdbserver
[EXTRA] Configuring gdbserver
[EXTRA] Building gdbserver
[EXTRA] Installing gdbserver
[INFO ] Installing gdbserver: done in 9.17s (at 38:35)
[INFO ] =================================================================
[INFO ] Installing ltrace
[EXTRA] Copying sources to build dir
[EXTRA] Configuring ltrace
[EXTRA] Building ltrace
[EXTRA] Installing ltrace
[INFO ] Installing ltrace: done in 6.08s (at 38:41)
[INFO ] =================================================================
[INFO ] Installing strace
[EXTRA] Configuring strace
[EXTRA] Building strace
[EXTRA] Installing strace
[INFO ] Installing strace: done in 31.27s (at 39:12)
[INFO ] =================================================================
[INFO ] Cleaning-up the toolchain's directory
[INFO ] Stripping all toolchain executables
[EXTRA] Installing the populate helper
[EXTRA] Installing a cross-ldd helper
[EXTRA] Creating toolchain aliases
[EXTRA] Removing access to the build system tools
[INFO ] Cleaning-up the toolchain's directory: done in 4.96s (at 39:17)
[INFO ] Build completed at 20111215.190924
[INFO ] (elapsed: 39:16.66)
[INFO ] Finishing installation (may take a few seconds)...
以下是工具链的测试:
whw@whw-Aspire-4752:~/toolchain-build$ arm-none-linux-gnueabi-gcc –v
arm-none-linux-gnueabi-gcc:找不到命令
怎么回事?
以下是编译过程:
whw@whw-Aspire-4752:~/toolchain-build$ sudo ../toolchain-install/bin/ct-ng build
[INFO ] Performing some trivial sanity checks
[INFO ] Build started 20111215.183007
[INFO ] Building environment variables
[EXTRA] Preparing working directories
[EXTRA] Installing user-supplied crosstool-NG configuration
[EXTRA] =================================================================
[EXTRA] Dumping internal crosstool-NG configuration
[EXTRA] Building a toolchain for:
[EXTRA] build = x86_64-unknown-linux-gnu
[EXTRA] host = x86_64-unknown-linux-gnu
[EXTRA] target = arm-unknown-linux-gnueabi
[EXTRA] Dumping internal crosstool-NG configuration: done in 0.14s (at 00:10)
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components' tarballs
[INFO ] Retrieving needed toolchain components' tarballs: done in 0.13s (at 00:10)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[INFO ] Extracting and patching toolchain components: done in 16.14s (at 00:26)
[INFO ] =================================================================
[INFO ] Installing GMP
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP: done in 104.41s (at 02:11)
[INFO ] =================================================================
[INFO ] Installing MPFR
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR: done in 21.51s (at 02:32)
[INFO ] =================================================================
[INFO ] Installing PPL
[EXTRA] Configuring PPL
[EXTRA] Building PPL
[EXTRA] Installing PPL
[INFO ] Installing PPL: done in 200.58s (at 05:53)
[INFO ] =================================================================
[INFO ] Installing CLooG/ppl
[EXTRA] Configuring CLooG/ppl
[EXTRA] Building CLooG/ppl
[EXTRA] Installing CLooG/ppl
[INFO ] Installing CLooG/ppl: done in 6.73s (at 05:59)
[INFO ] =================================================================
[INFO ] Installing binutils
[EXTRA] Configuring binutils
[EXTRA] Building binutils
[EXTRA] Installing binutils
[INFO ] Installing binutils: done in 54.53s (at 06:54)
[INFO ] =================================================================
[INFO ] Installing static core C compiler
[EXTRA] Configuring static core C compiler
[EXTRA] Building static core C compiler
[EXTRA] Installing static core C compiler
[INFO ] Installing static core C compiler: done in 138.29s (at 09:12)
[INFO ] =================================================================
[INFO ] Installing kernel headers
[EXTRA] Installing kernel headers
[EXTRA] Checking installed headers
[INFO ] Installing kernel headers: done in 7.88s (at 09:20)
[INFO ] =================================================================
[INFO ] Installing C library headers & start files
[EXTRA] Configuring C library
[EXTRA] Installing C library headers
[EXTRA] Installing C library start files
[INFO ] Installing C library headers & start files: done in 40.89s (at 10:01)
[INFO ] =================================================================
[INFO ] Installing shared core C compiler
[EXTRA] Configuring shared core C compiler
[EXTRA] Building shared core C compiler
[EXTRA] Installing shared core C compiler
[INFO ] Installing shared core C compiler: done in 151.75s (at 12:33)
[INFO ] =================================================================
[INFO ] Installing C library
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Installing C library: done in 691.04s (at 24:04)
[INFO ] =================================================================
[INFO ] Installing final compiler
[EXTRA] Configuring final compiler
[EXTRA] Building final compiler
[EXTRA] Installing final compiler
[INFO ] Installing final compiler: done in 306.70s (at 29:11)
[INFO ] =================================================================
[INFO ] Installing libelf for the target
[EXTRA] Configuring libelf
[EXTRA] Building libelf
[EXTRA] Installing libelf
[INFO ] Installing libelf for the target: done in 10.14s (at 29:21)
[INFO ] =================================================================
[INFO ] Installing binutils for target
[EXTRA] Configuring binutils for target
[EXTRA] Building binutils' libraries (libiberty bfd) for target
[EXTRA] Installing binutils' libraries (libiberty bfd) for target
[INFO ] Installing binutils for target: done in 109.15s (at 31:10)
[INFO ] =================================================================
[INFO ] Installing dmalloc
[EXTRA] Configuring dmalloc
[EXTRA] Building dmalloc
[EXTRA] Installing dmalloc
[INFO ] Installing dmalloc: done in 12.20s (at 31:22)
[INFO ] =================================================================
[INFO ] Installing D.U.M.A.
[EXTRA] Copying sources
[EXTRA] Building libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing shared library link
[EXTRA] Installing wrapper script
[INFO ] Installing D.U.M.A.: done in 4.87s (at 31:27)
[INFO ] =================================================================
[INFO ] Installing cross-gdb
[EXTRA] Configuring cross-gdb
[EXTRA] Building cross-gdb
[EXTRA] Installing cross-gdb
[INFO ] Installing cross-gdb: done in 139.21s (at 33:46)
[INFO ] =================================================================
[INFO ] Installing native gdb
[EXTRA] Building static target ncurses
[EXTRA] Building static target expat
[EXTRA] Configuring native gdb
[EXTRA] Building native gdb
[EXTRA] Installing native gdb
[EXTRA] Cleaning up ncurses
[INFO ] Installing native gdb: done in 278.90s (at 38:25)
[INFO ] =================================================================
[INFO ] Installing gdbserver
[EXTRA] Configuring gdbserver
[EXTRA] Building gdbserver
[EXTRA] Installing gdbserver
[INFO ] Installing gdbserver: done in 9.17s (at 38:35)
[INFO ] =================================================================
[INFO ] Installing ltrace
[EXTRA] Copying sources to build dir
[EXTRA] Configuring ltrace
[EXTRA] Building ltrace
[EXTRA] Installing ltrace
[INFO ] Installing ltrace: done in 6.08s (at 38:41)
[INFO ] =================================================================
[INFO ] Installing strace
[EXTRA] Configuring strace
[EXTRA] Building strace
[EXTRA] Installing strace
[INFO ] Installing strace: done in 31.27s (at 39:12)
[INFO ] =================================================================
[INFO ] Cleaning-up the toolchain's directory
[INFO ] Stripping all toolchain executables
[EXTRA] Installing the populate helper
[EXTRA] Installing a cross-ldd helper
[EXTRA] Creating toolchain aliases
[EXTRA] Removing access to the build system tools
[INFO ] Cleaning-up the toolchain's directory: done in 4.96s (at 39:17)
[INFO ] Build completed at 20111215.190924
[INFO ] (elapsed: 39:16.66)
[INFO ] Finishing installation (may take a few seconds)...
以下是工具链的测试:
whw@whw-Aspire-4752:~/toolchain-build$ arm-none-linux-gnueabi-gcc –v
arm-none-linux-gnueabi-gcc:找不到命令
怎么回事?
|
你的"target = arm-unknown-linux-gnueabi"应该是arm-unknown-linux-gnueabi-gcc吧,还有就是你的环境变量设置了没?