0

我正在尝试安装用于 ARM 交叉编译的工具链。我已经安装了 GCC 4.8。

arm-none-linux-gnueabi-gcc 的安装失败,输出如下:

$ sudo port install arm-none-linux-gnueabi-*
--->  Cleaning arm-none-linux-gnueabi-binutils
--->  Computing dependencies for arm-none-linux-gnueabi-gcc
--->  Fetching archive for arm-none-linux-gnueabi-gcc
--->  Attempting to fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 from http://lil.fr.packages.macports.org/arm-none-linux-gnueabi-gcc
--->  Attempting to fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/arm-none-linux-gnueabi-gcc
--->  Attempting to fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 from http://packages.macports.org/arm-none-linux-gnueabi-gcc
--->  Fetching distfiles for arm-none-linux-gnueabi-gcc
--->  Verifying checksums for arm-none-linux-gnueabi-gcc
--->  Extracting arm-none-linux-gnueabi-gcc
--->  Applying patches to arm-none-linux-gnueabi-gcc
--->  Configuring arm-none-linux-gnueabi-gcc
--->  Building arm-none-linux-gnueabi-gcc
Error: org.macports.build for port arm-none-linux-gnueabi-gcc returned: command execution failed
Please see the log file for port arm-none-linux-gnueabi-gcc for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port arm-none-linux-gnueabi-gcc failed

日志文件内容:

version:1
...
:info:build make[1]: *** [cp/decl.o] Error 1
:info:build make[1]: *** Waiting for unfinished jobs....
...
:info:build 10 warnings generated.
:info:build 7 warnings generated.
:info:build 5 warnings generated.
:info:build 60 warnings generated.
:info:build 6 warnings generated.
:info:build 125 warnings generated.
:info:build 20 warnings generated.
:info:build rm arm-none-linux-gnueabi-cpp.pod fsf-funding.pod gcov.pod arm-none-linux-gnueabi-gcc.pod gfdl.pod gpl.pod
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build/gcc'
:info:build make: *** [all-gcc] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build" && /usr/bin/make -j8 -w all AR_FOR_TARGET=arm-none-linux-gnueabi-ar AS_FOR_TARGET=arm-none-linux-gnueabi-as LD_FOR_TARGET=arm-none-linux-gnueabi-ld NM_FOR_TARGET=arm-none-linux-gnueabi-nm RANLIB_FOR_TARGET=arm-none-linux-gnueabi-ranlib 
:info:build Exit code: 2
:error:build org.macports.build for port arm-none-linux-gnueabi-gcc returned: command execution failed
:debug:build Error code: CHILDSTATUS 20512 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: targets not executed for arm-none-linux-gnueabi-gcc: org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Please see the log file for port arm-none-linux-gnueabi-gcc for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/main.log

感谢您分享您的想法。

4

1 回答 1

1

使用 FSF gcc 构建它。

例如

    port install arm-none-linux-gnueabi-gcc  configure.compiler=macports-gcc-4.8

PS确保你安装了gcc-4.8。

此问题是由以下命令引起的:

    cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build" && /usr/bin/make -j8 -w all AR_FOR_TARGET=arm-none-linux-gnueabi-ar AS_FOR_TARGET=arm-none-linux-gnueabi-as LD_FOR_TARGET=arm-none-linux-gnueabi-ld NM_FOR_TARGET=arm-none-linux-gnueabi-nm RANLIB_FOR_TARGET=arm-none-linux-gnueabi-ranlib 

从 clang 发出这个命令的输出:

    ...
    In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/gcc-2005q3/gcc/cp/decl.c:11405:
    ./gtype-cp.h:410:7: warning: switch condition has boolean value
          switch (((*x).u).h.is_lang_type_class)
          ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ./gtype-cp.h:412:14: warning: overflow converting case value to switch condition type (2 to 0) [-Wswitch]
            case 2:
                 ^
    ./gtype-cp.h:431:14: error: duplicate case value '0'
            case 0:
                 ^
    ./gtype-cp.h:412:14: note: previous case defined here
            case 2:
                 ^
    ./gtype-cp.h:857:7: warning: switch condition has boolean value
          switch (((*x).u).h.is_lang_type_class)
          ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ./gtype-cp.h:859:14: warning: overflow converting case value to switch condition type (2 to 0) [-Wswitch]
            case 2:
                 ^
    ./gtype-cp.h:879:14: error: duplicate case value '0'
            case 0:
                 ^
    ./gtype-cp.h:859:14: note: previous case defined here
            case 2:
                 ^
    ./gtype-cp.h:1475:3: warning: switch condition has boolean value
      switch (((*x).u).h.is_lang_type_class)
      ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ./gtype-cp.h:1477:10: warning: overflow converting case value to switch condition type (2 to 0) [-Wswitch]
        case 2:
             ^
    ./gtype-cp.h:1511:10: error: duplicate case value '0'
        case 0:
             ^
    ./gtype-cp.h:1477:10: note: previous case defined here
        case 2:
于 2014-01-11T14:48:59.177 回答