C++ toolchain issue on ubuntu 14.04

Hi all,

I am currently trying to run the cpp tests (e.g. tests/cpp11_*) for stm32f4discovery on ubuntu 14.04 unfortunately all tests I ran failed (see error log at the bottom of this mail). I highly suspect that this is a toolchain issue (btw: happens only with stm32f4discovery).

Did I miss something obvious like a missing package (see package list below)?

Best,

Philipp

The relevant packages I have installed are:

$ dpkg -l | grep arm-none ii gcc-arm-none-eabi 4.9.3.2015q1-0trusty13 amd64 A GNU-based tool chain for arm embedded processors ii libnewlib-arm-none-eabi 2.1.0-3 all C library and math library compiled for bare metal using Cortex A/R/M ii libstdc+±arm-none-eabi-newlib 4.9.2-20ubuntu1+7 all GNU Standard C++ Library v3 for ARM Cortex-A/R/M processors (newlib)

$ apt-cache policy gcc-arm-none-eabi gcc-arm-none-eabi: Installiert: 4.9.3.2015q1-0trusty13 Installationskandidat: 4.9.3.2015q1-0trusty13 Versionstabelle: *** 4.9.3.2015q1-0trusty13 0 500 http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu/ trusty/main amd64 Packages 100 /var/lib/dpkg/status 4.8.2-14ubuntu1+6 0 500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

The error log for cpp11_thread:

tests/cpp11_thread$ BOARD=stm32f4discovery make clean all Building application “cpp11_thread” for “stm32f4discovery” with MCU “stm32f4”.

In file included from /usr/arm-none-eabi/include/c++/4.9.3/random:38:0, from /usr/arm-none-eabi/include/c++/4.9.3/bits/stl_algo.h:66, from /usr/arm-none-eabi/include/c++/4.9.3/algorithm:62, from /home/philipp/RIOT/sys/cpp11-compat/include/riot/chrono.hpp:30, from /home/philipp/RIOT/tests/cpp11_thread/main.cpp:27: /usr/arm-none-eabi/include/c++/4.9.3/cmath:1120:11: error: ‘::log2l’ has not been declared using ::log2l; ^ /usr/arm-none-eabi/include/c++/4.9.3/cmath:1124:11: error: ‘::logbl’ has not been declared using ::logbl; ^ /usr/arm-none-eabi/include/c++/4.9.3/cmath:1146:11: error: ‘::nexttoward’ has not been declared using ::nexttoward; ^ /usr/arm-none-eabi/include/c++/4.9.3/cmath:1147:11: error: ‘::nexttowardf’ has not been declared using ::nexttowardf; ^ /usr/arm-none-eabi/include/c++/4.9.3/cmath:1148:11: error: ‘::nexttowardl’ has not been declared using ::nexttowardl; ^ In file included from /home/philipp/RIOT/sys/include/vtimer.h:28:0, from /home/philipp/RIOT/sys/cpp11-compat/include/riot/chrono.hpp:33, from /home/philipp/RIOT/tests/cpp11_thread/main.cpp:27: /home/philipp/RIOT/sys/include/timex.h: In function ‘const char* timex_to_str(timex_t, char*)’: /home/philipp/RIOT/sys/include/timex.h:185:39: error: ‘snprintf’ was not declared in this scope t.seconds, t.microseconds); ^ make[1]: *** [/home/philipp/RIOT/tests/cpp11_thread/bin/stm32f4discovery/cpp11_thread/main.o] Fehler 1 make: *** [all] Fehler 2

Hi Philipp,

I am currently trying to run the cpp tests (e.g. tests/cpp11_*) for stm32f4discovery on ubuntu 14.04 unfortunately all tests I ran failed (see error log at the bottom of this mail). I highly suspect that this is a toolchain issue (btw: happens only with stm32f4discovery).

Did I miss something obvious like a missing package (see package list below)?

I did a quick check here. Although not exactly Ubuntu? :slight_smile:

tests/cpp11_thread$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.1 (jessie) Release: 8.1 Codename: jessie

tests/cpp11_thread$ dpkg -l|grep arm-none
ii binutils-arm-none-eabi 2.25-5+5 +b1 ii gcc-arm-none-eabi 4.8.4-1+11-1 ii libnewlib-arm-none-eabi 2.1.0+git20140818.1a8323b-2 ii libstdc++-arm-none-eabi-newlib 4.8.3-9+4

$ tests/cpp11_thread$ make all
Building application "cpp11_thread" for "stm32f4discovery" with MCU "stm32f4".

"make" -C /home/aar680/git/RIOT/boards/stm32f4discovery "make" -C /home/aar680/git/RIOT/core "make" -C /home/aar680/git/RIOT/cpu/stm32f4 "make" -C /home/aar680/git/RIOT/cpu/cortexm_common "make" -C /home/aar680/git/RIOT/cpu/stm32f4/periph "make" -C /home/aar680/git/RIOT/drivers "make" -C /home/aar680/git/RIOT/sys "make" -C /home/aar680/git/RIOT/sys/auto_init "make" -C /home/aar680/git/RIOT/sys/compat/hwtimer "make" -C /home/aar680/git/RIOT/sys/cpp11-compat "make" -C /home/aar680/git/RIOT/sys/newlib "make" -C /home/aar680/git/RIOT/sys/timex "make" -C /home/aar680/git/RIOT/sys/vtimer    text data bss dec hex filename   63844 128 5360 69332 10ed4 /home/aar680/git/RIOT/tests/cpp11_thread/bin/stm32f4discovery/cpp11_thread.elf

Everything builds fine. Hope this helped a bit.

greetings Paul

Hi Paul,

thanks but the problem seems to be specific to ubuntu 14.04. I also observed this issue in a fresh ubuntu 14.04 docker container.

For now I decided to switch to a more current release of ubuntu in order to solve this problem. On 15.04 this issue doesn’t seem to exist.

Best,

Philipp

Hi,

I can also run the tests successfully on native and the stm32f4discovery board.

My Stock GCC: gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)

My ARM GCC, I use the launchpad one and export its location as described for the Codebench version[1]: gcc version 4.9.3 20150303 (release) [ARM/embedded-4_9-branch revision 221220] (GNU Tools for ARM Embedded Processors)

For my local ARM GCC its: export PATH=$PATH:/home/<myusername>/Downloads/gcc-arm-none-eabi-4_9-2015q1/bin

@Philipp could you test if exporting a local version of the ARM compiler still prevents compiling for the stm board?

Best regards, Martin

[1]