zoukankan      html  css  js  c++  java
  • u-boot编译浮点匹配问题

    上午用arm-linux-gcc-3.3.2编译u-boot-1.1.6,我按照教程将  u-boot-1.1.6/cpu/arm920t/config.mk 中的软浮点运算舍去。

    #   // 原u-boot-1.1.6/cpu/arm920t/config.mk
    # (C) Copyright 2002
    # Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
    #
    # See file CREDITS for list of people who contributed to this
    # project.
    #
    # This program is free software; you can redistribute it and/or
    # modify it under the terms of the GNU General Public License as
    # published by the Free Software Foundation; either version 2 of
    # the License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    # MA 02111-1307 USA
    #

    PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8
       -msoft-float

    PLATFORM_CPPFLAGS += -march=armv4
    # =========================================================================
    #
    # Supply options according to compiler version
    #
    # =========================================================================
    PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
    PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))


    #   // 原u-boot-1.1.6/cpu/arm920t/config.mk
    # (C) Copyright 2002
    # Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
    #
    # See file CREDITS for list of people who contributed to this
    # project.
    #
    # This program is free software; you can redistribute it and/or
    # modify it under the terms of the GNU General Public License as
    # published by the Free Software Foundation; either version 2 of
    # the License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    # MA 02111-1307 USA
    #

    PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8
     #  -msoft-float

    PLATFORM_CPPFLAGS += -march=armv4
    # =========================================================================
    #
    # Supply options according to compiler version
    #
    # =========================================================================
    PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
    PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))

    arm-linux-ld: ERROR: lib_arm/libarm.a(board.o) uses hardware FP, whereas u-boot uses software FP
    File in wrong format: failed to merge target specific data of file lib_arm/libarm.a(board.o)
    arm-linux-ld: ERROR: /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/libgcc.a(_udivdi3.oS) uses hardware FP, whereas u-boot uses software FP
    File in wrong format: failed to merge target specific data of file /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/libgcc.a(_udivdi3.oS)
    arm-linux-ld: ERROR: /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/libgcc.a(_clz.oS) uses hardware FP, whereas u-boot uses software FP
    File in wrong format: failed to merge target specific data of file /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/libgcc.a(_clz.oS)

    在网上搜查解决方案,方案一:

    PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8

    PLATFORM_CPPFLAGS += -march=armv4
    # =========================================================================
    #
    # Supply options according to compiler version
    #
    # =========================================================================
    PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32)
    PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malig ment-traps,))
     。

    编译之后还是出现软硬浮点错误,后来再寻求答案。

    方案二:

    将编译器换成3.4.5。编译器换成3.4.5之后,一编译就通过。

    总结:问题已经解决,但还是不知道为什么教程里用3.3.2版本的编译器能通过我用3.3.2版本就不能通过

  • 相关阅读:
    PAT (Advanced Level) Practice 1129 Recommendation System (标记+排序)
    PAT (Advanced Level) Practice 1135 Is It A Red-Black Tree (30分) (红黑树知识+建树+判断)
    PAT (Advanced Level) Practice 1134 Vertex Cover (25分) (存边+标记点!!)
    PAT (Advanced Level) Practice 1133 Splitting A Linked List (25分) (静态链表的遍历)
    PAT (Advanced Level) Practice 1139 First Contact (30分) (unordered_map用来标记+哈希)
    PAT (Advanced Level) Practice 1132 Cut Integer (20分) (atoi、stoi区别、stringstream使用)
    PAT (Advanced Level) Practice 1138 Postorder Traversal (25分) (不键树、法一找规律法二先序中序变后序)
    区间DP学习 LibreOJ-10147 石子合并
    2020 Nowcoder Training
    UVA1347 Tour 动态规划
  • 原文地址:https://www.cnblogs.com/ATMvip/p/3214367.html
Copyright © 2011-2022 走看看