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

【记录】Cygwin下为arm920t配置crosstool-ng

crosstool-ng crifan 4112浏览 0评论

【背景】

折腾:

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

期间,需要在cygwin下,去为了arm920t配置crosstool-ng。

【折腾过程】

1.可以直接去ct-ng menuconfig,但是为了更加省事,所以还是先选用一个,和arm920t最接近的一个配置。

2.看了看之前

ct-ng list-samples

的结果,觉得和此处arm920t,相近的有:

[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

所以,先去看看cortex a8,cortex a15,davinci,相关的参数核心参数是啥。

(1)参考:

http://www.arm.com/zh/products/processors/cortex-a/cortex-a8.php

可知:

cortex a8:

ARMv7-A

有MMU

有硬件浮点单元:VFPv3

(2)参考:

http://www.arm.com/zh/products/processors/cortex-a/cortex-a15.php

可知:

ARMv7-A

有MMU

有硬件浮点单元:VFPv4

(3)参考:

http://en.wikipedia.org/wiki/Texas_Instruments_DaVinci

可知:

DaVinci

有很多型号:

Dual-core models have both ARM and DSP:

    DM6443 – ARM9 + TI C64x+ DSP + DaVinci Video (Decode) – Video Accelerator and Networking for display

    DM6446 – ARM9 + TI C64x+ DSP + DaVinci Video (Encode and Decode) – Video Accelerator and Networking for capture and display

    DM6467 – ARM9 + TI C64x+ DSP + DaVinci Video (Encode and Decode) – Video Accelerator and Networking for high def capture and display

    DM8148 – Cortex-A8 + TI C674x DSP + DaVinci Video (full HD Encode and Decode) – Video Accelerator and Networking for high def capture and display

    DM8168 – Cortex-A8 + TI C674x DSP + DaVinci Video (triple full HD Encode and Decode) – Video Accelerator and Networking for high def capture and display

There are DSP-only models:

    DM643x – TI C64x+ DSP

    DM64x – TI C64x+ DSP

There are ARM-only models:

    DM335 – a DM355 variant (pin compatible) without the MJCP

    DM355 – ARM9 + DaVinci Video (Encode and Decode) – MPEG4/JPEG coprocessor (MJCP)

    DM357 – a DM6446 variant (pin-compatible) with the DSP replaced by a dedicated video coprocessor (HMJCP)

    DM365 – enhanced DM355, including addition of a high def second video coprocessor (HDVICP)

并且,对于此处的目标,是TQ2440的开发板,用的CPU是S3C2440,是基于arm920t的

所以去查查确切的参数:

参考:

S3C2440 – 32-BIT CMOS MICROCONTROLLER – Samsung semiconductor

ARM920T

支持MMU

无FPU

 

2.看起来,总体来说,最接近的,好像是davinci,所以,就去调用默认的arm-davinci-linux-gnueabi 的配置吧:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng arm-davinci-linux-gnueabi
  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
  CONF  config/config.in
#
# configuration saved
#

***********************************************************

Initially reported by: Dragan Marinkovic <[email protected]>
URL:

***********************************************************

Now configured for "arm-davinci-linux-gnueabi"

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng show-arm-davinci-linux-gnueabi
[G..]   arm-davinci-linux-gnueabi
    OS             : linux-2.6.33.20
    Companion libs : gmp-4.3.2 mpfr-2.4.2 libelf-0.8.13
    binutils       : binutils-2.20.1a
    C compiler     : gcc-4.3.2 (C,C++)
    C library      : glibc-2.9 (threads: nptl)
    Tools          : dmalloc-5.5.2 duma-2_5_15 gdb-6.8a ltrace-0.5.3 strace-4.5.19

3.然后就可以去ct-ng menuconfig修改配置了:

此处暂时只是简单记录一下配置,等之后确认配置是可以成功编译的,再贴出来。

4.贴出主要部分的截图:

  • 由于此处make是3.82的,所以选上:
    • [*] Try features marked as EXPERIMENTAL
    • [*] Build some companion tools
    •     [*]   make
  • [*] Debug crosstool-NG
  • [*]   Save intermediate steps
  • [*]     gzip saved states (NEW)
  • [*]   Interactive shell on failed commands
  • (/home/develop/crosstool-ng/src) Local tarballs directory
  • (/home/develop/crosstool-ng/x-tools/${CT_TARGET}) Prefix directory
  • (2) Number of parallel jobs

Paths and misc options for arm920t

5.Target options

  • Target Architecture (arm)
  • [*] Use the MMU
  • Endianness: (Little endian)
  • Bitness: (32-bit)

而关于Architecture level,Emit assembly for CPU,Tune for CPU分别填写何值,则专门去研究了一下:

【整理】crosstool-ng中的Architecture level,Emit assembly for CPU,Tune for CPU对于TQ2440的S3C2440的ARM920T填写何值

所得到的结论是:

针对S3C2440,对应的参数分别是:

(1)Architecture level=CT_ARCH_ARCH=-march=armv4t

(2)Emit assembly for CPU=CT_ARCH_CPU=-mcpu=arm9tdmi

(3)Tune for CPU=CT_ARCH_TUNE=-mtune=arm920t

6.再加上:

  • (-O) Target CFLAGS

最后总体配置为:

Target options for arm920t

7.再去设置Toolchain options:

  • (arm920t) Tuple’s vendor string

configure Toolchain options for arm920t

8.Operating System:

对于linux的kernel版本,需要去针对于,当前tq2440所提供的要匹配。

去:

2010年6月 最新TQ2440光盘下载 (Linux内核,WinCE的eboot,uboot均有更新)

提供的是:

Linux-2.6.30.4

的版本的,所以想要去设置版本为:

linux-2.6.30.4

但是发现默认选项中没有此版本,

所以只能设置为自定义版本,并且说动去把下载到的:

linux-2.6.30.4_20100531.rar

解压后,重新打包为对应的:

linux-2.6.30.4.tar.bz2

放到对应的位置。

结果悲催的是,此rar,解压还出错了,虽然最后是可以解压的,但是中间有警告。

所以,还是打算,去官网下载原版:

linux-2.6.30.4.tar.bz2

然后放到对应的位置。

最后配置为:

  • Linux kernel version (custom tarball or directory)  —> 
    • custom tarball or directory
    • (/home/develop/crosstool-ng/src/linux-2.6.30.4.tar.bz2) Path to custom source, tarball or directory

如图:

Operating System custom linux for arm920t

9.Binary utilities:

  • binutils version (2.20.1a)  —>

如图:

Binary utilities for arm920t

10.C compiler:

都用默认配置:

  • C compiler (gcc)  —>
  • gcc version (4.3.2)  —>
  • [*] C++
  • [*] Use __cxa_atexit
  • <M> Use sjlj for exceptions
  • <M> Enable 128-bit long doubles

如图:

C compiler for arm920t

11.C-library:

此处,关于c库选择,看了之前自己整理的:

【整理】uclibc,eglibc,glibc之间的区别和联系

后,决定去选用eglibc,应该可以使得以后也继续正常使用,而且同时保证和glibc二进制都兼容,应该不会有啥问题。

另外,关于线程模型选择,由于之前看了些介绍后发现,还是用(此处默认的)nptl比较好。

  • C library (eglibc)  —>
  • eglibc version (2_17)  —>
  • (HEAD) Revision to use
  • Threading implementation to use: (nptl)  —>
  • [*] Install a cross ldd-like helper

 

C-library for arm920t

12.Debug facilities:

默认配置。

  • strace  —>
  • dmalloc  —>
  • duma  —>
  • gdb  —>
  • ltrace  —>

如图:

Debug facilities for arm920t

13.Companion libraries:

都是默认配置:

  • GMP version (4.3.2)  —>
  • MPFR version (2.4.2)  —>
  • libelf version (0.8.13)  —>

如图:

 Companion libraries for arm920t

14.Companion tools

由于当前的cygwin中的make是3.82的:

Administrator@PC-20130611GART /home/develop/crosstool-ng/src
$ make --version
GNU Make 3.82.90
Built for i686-pc-cygwin
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

所以,由于之前的经验:

【已解决】crosstool-ng在Installing C library headers & start files期间出错:Makefile:240: *** mixed implicit and normal rules. Stop.

可知,此处需要选上对应的make:

  • [*] Build some companion tools
  • [*]   make

如图:

 Companion tools for arm920t

15. Test suite:

此处为了多尝试点东西,也还是选上吧:

  • [*] GCC test suite

如图:

Test suite for arm920t

 

16.至此,配置完毕,保存退出:

Save an Alternate Configuration File  for arm920t

Enter a filename to which this configuration config

 

【总结】

此处,大部分都是用默认配置。

先这么配置着再说。

等之后真正在此处cygwin下,编译crosstool-ng成功后,会去贴出来完整的配置的。

转载请注明:在路上 » 【记录】Cygwin下为arm920t配置crosstool-ng

发表我的评论
取消评论

表情

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

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