最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】Cygwin下用crosstool-ng为arm制作交叉编译器

crosstool-ng crifan 3887浏览 0评论

【背景】

之前,已经在另外一个win7上,基于cygwin,弄出了for xscale的arm-xscale-linux-gnueabi的交叉编译器:

【记录】重试使用最新版本1.18.0的crosstool-ng去配置和编译xscale的交叉编译器

并且,也在该win7下,VMWare中的Ubuntu下,弄了该for xscale的arm-xscale-linux-gnueabi的交叉编译器:

【记录】Ubuntu下用crosstool-ng为xscale建立交叉编译器arm-xscale-linux-gnueabi-gcc

此处,打算,在K470的win7 x64,6G内存+SSD下,在当前的cygwin下:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ cygpath.exe --version
cygpath (cygwin) 1.7.17
Path Conversion Utility
Copyright (C) 1998 - 2012 Red Hat, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

去再去弄个,for arm的,即针对TQ2440用的S3C2440的arm920t,弄个交叉编译器。

【折腾过程】

1.下载最新的源码:

Administrator@PC-20130611GART /home/develop/crosstool-ng
$ wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.18.0.tar.bz2
--2013-08-24 16:46:23--  http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.18.0.tar.bz2
Resolving crosstool-ng.org (crosstool-ng.org)... 140.211.15.107
Connecting to crosstool-ng.org (crosstool-ng.org)|140.211.15.107|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1884219 (1.8M) [application/x-bzip]
Saving to: `crosstool-ng-1.18.0.tar.bz2'
  
100%[====================================================================================================>] 1,884,219    256K/s   in 8.4s
  
2013-08-24 16:46:32 (219 KB/s) - `crosstool-ng-1.18.0.tar.bz2' saved [1884219/1884219]
  
  
Administrator@PC-20130611GART /home/develop/crosstool-ng
$ ls
crosstool-ng-1.18.0.tar.bz2  src
  
Administrator@PC-20130611GART /home/develop/crosstool-ng
$ tar xjf crosstool-ng-1.18.0.tar.bz2
  
Administrator@PC-20130611GART /home/develop/crosstool-ng
$ cd crosstool-ng-1.18.0/
  
Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ls
COPYING   Makefile.in  TODO       config     configure.ac  ct-ng.comp  docs     licenses.d  samples  steps.mk
LICENSES  README       bootstrap  configure  contrib       ct-ng.in    kconfig  patches     scripts

2.继续参考,之前自己的:

【记录】重试使用最新版本1.18.0的crosstool-ng去配置和编译xscale的交叉编译器

【记录】Ubuntu下用crosstool-ng为xscale建立交叉编译器arm-xscale-linux-gnueabi-gcc

去折腾,先要把crosstool-ng安装到当前的cygwin中:

【记录】Cygwin下配置编译和安装crosstool-ng

3.然后,就可以接着去把对应的路径,加到PATH中:

修改.bashrc文件:

home\Administrator\.bashrc

期间竟然出错:

【已解决】Win7中用Notepad++编辑cygwin下面的文件结果保存出错:请检查文件是否在别的程序中打开

解决后,再去在.bashrc最后添加上:

PATH=$PATH:/opt/crosstool-ng/bin

然后再重新启动cygwin,就可以找到ct-ng了:

Administrator@PC-20130611GART /home/develop/crosstool-ng
$ which ct-ng
/opt/crosstool-ng/bin/ct-ng
  
Administrator@PC-20130611GART /home/develop/crosstool-ng
$ ct-ng --help
Usage: make [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -B, --always-make           Unconditionally make all targets.
  -C DIRECTORY, --directory=DIRECTORY
                              Change to DIRECTORY before doing anything.
  -d                          Print lots of debugging information.
  --debug[=FLAGS]             Print various types of debugging information.
  -e, --environment-overrides
                              Environment variables override makefiles.
  --eval=STRING               Evaluate STRING as a makefile statement.
  -f FILE, --file=FILE, --makefile=FILE
                              Read FILE as a makefile.
  -h, --help                  Print this message and exit.
  -i, --ignore-errors         Ignore errors from recipes.
  -I DIRECTORY, --include-dir=DIRECTORY
                              Search DIRECTORY for included makefiles.
  -j [N], --jobs[=N]          Allow N jobs at once; infinite jobs with no arg.
  -k, --keep-going            Keep going when some targets can't be made.
  -l [N], --load-average[=N], --max-load[=N]
                              Don't start multiple jobs unless load is below N.
  -L, --check-symlink-times   Use the latest mtime between symlinks and target.
  -n, --just-print, --dry-run, --recon
                              Don't actually run any recipe; just print them.
  -o FILE, --old-file=FILE, --assume-old=FILE
                              Consider FILE to be very old and don't remake it.
  -p, --print-data-base       Print make's internal database.
  -q, --question              Run no recipe; exit status says if up to date.
  -r, --no-builtin-rules      Disable the built-in implicit rules.
  -R, --no-builtin-variables  Disable the built-in variable settings.
  -s, --silent, --quiet       Don't echo recipes.
  -S, --no-keep-going, --stop
                              Turns off -k.
  -t, --touch                 Touch targets instead of remaking them.
  --trace                     Print tracing information.
  -v, --version               Print the version number of make and exit.
  -w, --print-directory       Print the current directory.
  --no-print-directory        Turn off -w, even if it was turned on implicitly.
  -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
                              Consider FILE to be infinitely new.
  --warn-undefined-variables  Warn when an undefined variable is referenced.
  
This program built for i686-pc-cygwin
Report bugs to <[email protected]>
  
Administrator@PC-20130611GART /home/develop/crosstool-ng
$

4.再去创建对应的build文件夹,以及列表看看sample:

Administrator@PC-20130611GART /home/develop/crosstool-ng
$ mkdir crosstool-ng-1.18.0_build
  
Administrator@PC-20130611GART /home/develop/crosstool-ng
$ ls
crosstool-ng-1.18.0  crosstool-ng-1.18.0.tar.bz2  crosstool-ng-1.18.0_build  src
  
Administrator@PC-20130611GART /home/develop/crosstool-ng
$ cd crosstool-ng-1.18.0_build/
  
Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ls
  
Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng list-samples
Status  Sample name
  LN    config
  MKDIR config.gen
  IN    config.gen/arch.in
  IN    config.gen/kernel.in
  IN    config.gen/cc.in
  IN    config.gen/binutils.in
  IN    config.gen/libc.in
  IN    config.gen/debug.in
[G.X]   alphaev56-unknown-linux-gnu
[G.X]   alphaev67-unknown-linux-gnu
[G.X]   arm-bare_newlib_cortex_m3_nommu-eabi
[G.X]   arm-cortex_a15-linux-gnueabi
[G..]   arm-cortex_a8-linux-gnueabi
[G..]   arm-davinci-linux-gnueabi
[G..]   arm-unknown-eabi
[G..]   arm-unknown-linux-gnueabi
[G.X]   arm-unknown-linux-uclibcgnueabi
[G..]   armeb-unknown-eabi
[G.X]   armeb-unknown-linux-gnueabi
[G.X]   armeb-unknown-linux-uclibcgnueabi
[G.X]   armv6-rpi-linux-gnueabi
[G.X]   avr32-unknown-none
[G..]   bfin-unknown-linux-uclibc
[G..]   i586-geode-linux-uclibc
[G.X]   i586-mingw32msvc,i686-none-linux-gnu
[G.X]   i686-nptl-linux-gnu
[G.X]   i686-unknown-mingw32
[G.X]   m68k-unknown-elf
[G.X]   m68k-unknown-uclinux-uclibc
[G.X]   mips-ar2315-linux-gnu
[G.X]   mips-malta-linux-gnu
[G..]   mips-unknown-elf
[G.X]   mips-unknown-linux-uclibc
[G.X]   mips64el-n32-linux-uclibc
[G.X]   mips64el-n64-linux-uclibc
[G..]   mipsel-sde-elf
[G..]   mipsel-unknown-linux-gnu
[G..]   powerpc-405-linux-gnu
[G..]   powerpc-860-linux-gnu
[G.X]   powerpc-e300c3-linux-gnu
[G.X]   powerpc-e500v2-linux-gnuspe
[G..]   powerpc-unknown-linux-gnu
[G..]   powerpc-unknown-linux-uclibc
[G..]   powerpc-unknown_nofpu-linux-gnu
[G.X]   powerpc64-unknown-linux-gnu
[G.X]   s390-ibm-linux-gnu
[G.X]   s390x-ibm-linux-gnu
[G..]   sh4-unknown-linux-gnu
[G..]   x86_64-unknown-linux-gnu
[G..]   x86_64-unknown-linux-uclibc
[G.X]   x86_64-unknown-mingw32
 L (Local)       : sample was found in current directory
 G (Global)      : sample was installed with crosstool-NG
 X (EXPERIMENTAL): sample may use EXPERIMENTAL features
 B (BROKEN)      : sample is currently broken
  
Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$

5.然后接着就是去折腾for arm的交叉编译器了:

【记录】Cygwin下安装crosstool-ng后去为arm920t制作交叉编译器

6.

【总结】

转载请注明:在路上 » 【记录】Cygwin下用crosstool-ng为arm制作交叉编译器

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.175 seconds, using 22.25MB memory