红联Linux门户
Linux帮助

关于linux和arm的问题

发布时间:2010-12-24 13:21:34来源:红联作者:wucongdonglai
最近看linux设备驱动开发详解:
……
由于linux2.6.15.5直接提供了S3C2410评估版SMDK2410的支持,因此为它编译linux 2.6.15.5非常快捷,首先运行以下命令:
make ARCH=arm CROSS_COMPILE=arm-linux-menuconfig (指定体系结构为ARM,交叉编译器为arm-linux-gcc)
在弹出的菜单中直接选择“Load an Alternate Configuration FIle”,把默认配置文件路径输入即可
……
但是不管我是否准备了交叉编译链arm-linux-gcc,都是不行,都说没有找到arm-linux-menuconfiggcc!
然后我觉得可能不对,就改成
make ARCH=arm CROSS_COMPILE=arm-linux-
但是还是说arm-linux-gcc,而事实上我的环境里面是可以实行arm-linux-gcc的命令的!
还有就是,linux设备驱动详解这本书之前都没有讲过交叉编译,突然来了这个命令,是不是redhat9里面本身带有交叉编译链啊!那个系统我没用过,不清楚啊
文章评论

共有 6 条评论

  1. wucongdonglai 于 2010-12-28 08:47:41发表:

    7# deepwhite
    恩,好,呵呵

  2. deepwhite 于 2010-12-27 18:33:11发表:

    内核没有配置好,应该是。
    仔细看看文档,或者让你们同事在旁边给你示范一下吧。

  3. wucongdonglai 于 2010-12-27 11:44:16发表:

    3# deepwhite
    恩,确实如white兄说的,该打上那个空格的!我这是交叉链没有做好!后来做好了就好了!
    不过蛮奇怪的!
    我后来
    make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
    可以成功,没有问题!
    而我
    make ARCH=arm CROSS_COMPILE=arm-linux-(就相当于直接make)
    反而倒是出现一大堆错误!
    rch/arm/kernel/asm-offsets.c: In function `main':
    arch/arm/kernel/asm-offsets.c:59: error: structure has no member named `cpu_domain'
    arch/arm/kernel/asm-offsets.c:60: error: structure has no member named `cpu_context'
    arch/arm/kernel/asm-offsets.c:61: error: structure has no member named `used_cp'
    arch/arm/kernel/asm-offsets.c:62: error: structure has no member named `tp_value'
    arch/arm/kernel/asm-offsets.c:63: error: structure has no member named `fpstate'
    arch/arm/kernel/asm-offsets.c:64: error: structure has no member named `vfpstate'
    arch/arm/kernel/asm-offsets.c:65: error: structure has no member named `fpstate'
    arch/arm/kernel/asm-offsets.c:67: error: structure has no member named `ARM_r0'
    arch/arm/kernel/asm-offsets.c:68: error: structure has no member named `ARM_r1'
    arch/arm/kernel/asm-offsets.c:69: error: structure has no member named `ARM_r2'
    arch/arm/kernel/asm-offsets.c:70: error: structure has no member named `ARM_r3'
    arch/arm/kernel/asm-offsets.c:71: error: structure has no member named `ARM_r4'
    arch/arm/kernel/asm-offsets.c:72: error: structure has no member named `ARM_r5'
    arch/arm/kernel/asm-offsets.c:73: error: structure has no member named `ARM_r6'
    arch/arm/kernel/asm-offsets.c:74: error: structure has no member named `ARM_r7'
    arch/arm/kernel/asm-offsets.c:75: error: structure has no member named `ARM_r8'
    arch/arm/kernel/asm-offsets.c:76: error: structure has no member named `ARM_r9'
    arch/arm/kernel/asm-offsets.c:77: error: structure has no member named `ARM_r10'
    arch/arm/kernel/asm-offsets.c:78: error: structure has no member named `ARM_fp'
    arch/arm/kernel/asm-offsets.c:79: error: structure has no member named `ARM_ip'
    arch/arm/kernel/asm-offsets.c:80: error: structure has no member named `ARM_sp'
    arch/arm/kernel/asm-offsets.c:81: error: structure has no member named `ARM_lr'
    arch/arm/kernel/asm-offsets.c:82: error: structure has no member named `ARM_pc'
    arch/arm/kernel/asm-offsets.c:83: error: structure has no member named `ARM_cpsr'
    arch/arm/kernel/asm-offsets.c:84: error: structure has no member named `ARM_ORIG_r0'
    arch/arm/kernel/asm-offsets.c:100: error: invalid application of `sizeof' to incomplete type `machine_desc'
    make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
    make: *** [prepare0] Error 2
    [root@localhost linux-2.6.15.5]#
    感觉蛮奇怪的!按理说不是一样的么!

  4. wucongdonglai 于 2010-12-27 11:37:27发表:

    4# shenhao0129
    确实,容易漏打

  5. deepwhite 于 2010-12-24 15:26:35发表:

    应该是[code]make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig[/code]吧。
    注意 menuconfig 之前的那个空格。

    下面的文字取自内核的 Makefile , 你可以参考一下:

    锟斤拷锟斤拷:

    # Cross compiling and selecting different set of gcc/bin-utils
    # ---------------------------------------------------------------------------
    #
    # When performing cross compilation for other architectures ARCH shall be set
    # to the target architecture. (See arch/* for the possibilities).
    # ARCH can be set during invocation of make:
    # make ARCH=ia64
    # Another way is to have ARCH set in the environment.
    # The default ARCH is the host where make is executed.

    # CROSS_COMPILE specify the prefix used for all executables used
    # during compilation. Only gcc and related bin-utils executables
    # are prefixed with $(CROSS_COMPILE).
    # CROSS_COMPILE can be set on the command line
    # make CROSS_COMPILE=ia64-linux-
    # Alternatively CROSS_COMPILE can be set in the environment.
    # A third alternative is to store a setting in .config so that plain
    # "make" in the configured kernel build directory always uses that.
    # Default value for CROSS_COMPILE is not to prefix executables
    # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile

  6. 328463020 于 2010-12-24 14:15:14发表:

    你改下环境变量试试