【问题标题】:crosstool-NG linux x86 32Bit build fails on 32Bit vm-machine, Assembler messagescrosstool-NG linux x86 32Bit build 在 32Bit vm-machine 上失败,汇编程序消息
【发布时间】:2015-06-15 15:00:34
【问题描述】:

我们想使用 crosstool-NG ct-ng 编译一个定义好的 linux x86 32Bit 工具链:

glibc 2.9
gcc 4.8.4

我使用的是 ubuntu 14.04 32Bit:
Linux ubuntu 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:45:15 UTC 2015 i686 i686 i686 GNU/Linux。

crosstool-NG 失败:
Build failed in step 'Installing C library headers & start files'

编译时

/home/user/crosstool-x86-linux-32/.build/i386-unknown-linux-gnu/build/build-libc-startfiles/csu/crtn.o

它因几个汇编程序消息而失败:

[ALL ] /tmp/ccCj5ny0.s: Assembler messages: [ALL ] /tmp/ccCj5ny0.s:92: Error: can't resolve .LFE8' {*UND* section} -.LFB8' {UND section} (和类似的错误......)
在那个特定问题之前,我们遇到了类似的问题

../sysdeps/generic/initfini.c: Assembler messages: ../sysdeps/generic/initfini.c:123: Error: open CFI at the end of file; missing .cfi_endproc directive ../sysdeps/generic/initfini.c:123: Error: open CFI at the end of file; missing .cfi_endproc directive

我们使用此帖子http://www.openwall.com/lists/owl-dev/2011/10/18/4 中的目标/主机/构建 cflags 中的“-fno-dwarf2-cfi-asm”暂时“修复”了错误。

把我们带到这里...

我很想知道这个错误的根源是什么,除了 glibc 太旧(它可能是......)。

ct-ng 的 .config 和 build.log 见附件。 http://s000.tinyupload.com/download.php?file_id=60582934753963239188&t=6058293475396323918817262

【问题讨论】:

    标签: linux gcc glibc toolchain crosstool-ng


    【解决方案1】:

    我已经研究了很长时间,我通过修补 ./.build/src/glibc-2.9/sysdeps/i386/Makefile 解决了这个特殊问题:

    ifeq ($(subdir),csu)
    CFLAGS-initfini.s += -fno-unwind-tables -fno-asynchronous-unwind-tables
    endif
    
    ifeq ($(subdir),nptl)
    CFLAGS-pt-initfini.s += -fno-unwind-tables -fno-asynchronous-unwind-tables
    endif
    

    修复后我遇到了问题

    [ALL  ]    make[3]: *** No rule to make target `.build/i386-unknown-linux-gnu/build/build-libc-final/nptl/pthread_spin_trylock.o', needed by `lib-noranlib'.  Stop.
    

    根据这篇文章: https://sourceware.org/ml/crossgcc/2012-06/msg00023.html 已通过将 CT_ARCH_CPU 和 CT_ARCH_TUNE 设置为 i686 解决。

    我的 crosstool-NG 版本 (crosstool-ng-1.21.0-41-gc45cfb5) 显示

    Target-options->Tune for CPU
    

    只有当

    Target-options->Emit assembly for CPU
    

    为空。我假设 Emit assembly for CPU 使用 mcpu 可能会给我相同的结果。

    为了避免这个问题集(如上面的链接所示)

    Target-options->Emit assembly for CPU
    

    到 i686。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-14
      • 2015-07-10
      相关资源
      最近更新 更多