Gccv5.4 未定义对“__normal___udivdi3”的引用

Gccv5.4 undefined reference to `__normal___udivdi3'

我已将 gcc 从 4.6 版更新到 5.4 版。需要明确的是,我有两个版本我正在使用 sudo update-alternatives --config g++ 在版本之间切换。

vies7605@eso9265:~/Projects/u-boot/u-boot-x86$ sudo update-alternatives --config g++
There are 2 choices for the alternative g++ (providing /usr/bin/g++).

  Selection    Path              Priority   Status
------------------------------------------------------------
  0            /usr/bin/g++-4.6   20        auto mode
  1            /usr/bin/g++-4.6   20        manual mode
* 2            /usr/bin/g++-5     20        manual mode

Press enter to keep the current choice[*], or type selection number: 

vies7605@eso9265:~/Projects/u-boot/u-boot-x86$ sudo update-alternatives --config gcc
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
  0            /usr/bin/gcc-4.6   20        auto mode
  1            /usr/bin/gcc-4.6   20        manual mode
* 2            /usr/bin/gcc-5     20        manual mode

我正在使用 gcc 编译器构建 u-boot 源代码(最新 git 版本 x86)。当我使用 4.6 版本时,构建很好。 但是当我使用 gcc 5.4 版时,构建失败并显示错误消息,

arch/x86/lib/built-in.o: In function `__wrap___udivdi3':
/home/vies7605/Projects/u-boot/u-boot-x86/arch/x86/lib/gcc.c:25: undefined reference to `__normal___udivdi3'
make: *** [u-boot] Error 1

我不确定为什么会这样,有关此主题的任何帮助都会有所帮助。

vies7605@eso9265:~/Projects/u-boot/u-boot-x86$ gcc --version
gcc (Ubuntu 5.4.0-3ubuntu1~12.04) 5.4.0 20160603
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

您似乎没有设置 CONFIG_USE_PRIVATE_LIBGCC。

问题是我的笔记本电脑是 64 位系统,而 u-boot 是为 Minnowboard 目标 (x86) 以 32 位模式构建的

安装 multilib 版本的 gcc ,问题解决。

sudo apt-get install gcc-6-multilib g++-6-multilib 
sudo apt-get install gcc-5-multilib g++-5-multilib