简体   繁体   English

ARM GCC:冲突的CPU体系结构

[英]ARM GCC: Conflicting CPU architectures

After upgarding to ubuntu 18.04 I can no longer compile my application. 升级到ubuntu 18.04之后,我无法再编译我的应用程序。 I'm using mbed-cli with an st nucleo board. 我正在将mbed-cli与st核子板一起使用。 This is the output from the command mbed compile 这是命令mbed compile的输出

[Warning] test.c@1926,32: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
Link: sensors
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o: Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o): Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o)
collect2: error: ld returned 1 exit status
[ERROR] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o: Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o): Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o)
collect2: error: ld returned 1 exit status

[mbed] ERROR: "/usr/bin/python" returned error code 1.
[mbed] ERROR: Command "/usr/bin/python -u /home/user/examples/mbed-os/tools/make.py -t GCC_ARM -m nucleo_f411re --source . --build ./BUILD/nucleo_f411re/GCC_ARM" in "/home/user/examples"

It is a Ubuntu 18.04 specific issue. 这是Ubuntu 18.04的特定问题。 It has already been raised here 它已经在这里提出

The workaround is to install arm-none-eabi-gcc from the PPA. 解决方法是从PPA安装arm-none-eabi-gcc Here are the instructions: 以下是说明:

  • Remove the installed one: 删除已安装的一个:

     sudo apt remove gcc-arm-none-eabi 
  • Install the one from the PPA: 从PPA安装一个:

     sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa sudo apt-get update sudo apt-get install gcc-arm-embedded 

Unfortunately, I cannot comment OlivierM answer, but have important addition. 不幸的是,我无法评论OlivierM的答案,但有重要的补充。

As stated before by OlivierM, you should delete installed software and install new from embedded repository, but if you installed gcc-arm-none-eabi from main rep, it will also install binutils-arm-none-eabi, which will conflict with gcc-arm-embedded. 如OlivierM之前所述,您应该删除已安装的软件并从嵌入式存储库中安装新软件,但是如果从主代表安装了gcc-arm-none-eabi,它还将安装binutils-arm-none-eabi,这将与gcc冲突嵌入式。

  • So you should remove gcc-arm-none-eabi and binutils-arm-none-eabi: 因此,您应该删除gcc-arm-none-eabi和binutils-arm-none-eabi:

     sudo apt-get remove binutils-arm-none-eabi sudo apt-get remove gcc-arm-none-eabi 
  • Now install from the PPA: 现在从PPA安装:

     sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa sudo apt-get update sudo apt-get install gcc-arm-embedded 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM