Solved arm-none-eabi-gcc, does not see standard libraries

r2com

Member

Reaction score: 5
Messages: 82

I need to use arm-none-eabi-gcc to compile for some embedded processor, i already use that compiler on win10 to build targets for embedded stuff, so I decided to try doing it in FreeBSD.

I did install from port (using poudriere) successfully the arm-none-eabi-gcc 10.2 version, and it launches and works.

however, when I try to compile basic simplest file which has "#include<cstdint>" the compiler screams:
fatal error: cstdint: no such file or directory

btw, just as a test, compiling simplest minimalistic file with that line using just "gcc" (installed with pkg) works just fine, and it does not complain about not findint cstdint

did arm-none-eabi-gcc during install not get its proper standard libraries, or what else is going on here?
 

Jose

Daemon

Reaction score: 1,083
Messages: 1,313

It probably installed them in /usr/local. Try adding -I /usr/local/include to your CFLAGS. BTW, pkg info -l gcc should show you all the files the package installed.
 
OP
R

r2com

Member

Reaction score: 5
Messages: 82

adding that option did not help, same error.

pkg info -l gcc returns:
/usr/local/bin/g++
/usr/local/bin/gcc
/usr/local/bin/gfortran

anything else i should look into?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,765
Messages: 39,367

I need to use arm-none-eabi-gcc to compile for some embedded processor, i already use that compiler on win10 to build targets for embedded stuff, so I decided to try doing it in FreeBSD.
I had a similar issue when trying to build for the Raspberry Pi Pico. Try devel/gcc-arm-embedded instead.
 
OP
R

r2com

Member

Reaction score: 5
Messages: 82

the thing is, I tried installing that with pkg, and after successful install I tried again. its a same thing..

btw... I was so confused when I found out about this "gcc-arm-embedded" so its basically installed same latest version but then why did I go through the trouble of building from ports of the "arm-none-eabi-gcc"

anyway... what should I do now? you think I should uninstall all arm-none-eabi-gcc and install again gcc-arm-embedded and try again or?
 

Jose

Daemon

Reaction score: 1,083
Messages: 1,313

That file is not a standard C header. It's installed by devel/boost-libs on my system.

Code:
find /usr/local/include | grep -i cstdint                                                                         
/usr/local/include/boost/asio/detail/cstdint.hpp
/usr/local/include/boost/cstdint.hpp

pkg which /usr/local/include/boost/cstdint.hpp                                                                    
/usr/local/include/boost/cstdint.hpp was installed by package boost-libs-1.72.0_3
 
OP
R

r2com

Member

Reaction score: 5
Messages: 82

it is not standard C header it is standard C++ header, and I do not think that one needs to install boost to get that file,at least it is not the case when I install arm-non-eabi on win10, then I can compile files with #include<cstdin> without need of installing any boost on system.

and also, I do have that cstdint.hpp file as well, but that did not help me, I again see that error...

so what would be the proper workaround for this?
 

Jose

Daemon

Reaction score: 1,083
Messages: 1,313

it is not standard C header it is standard C++ header, and I do not think that one needs to install boost to get that file,at least it is not the case when I install arm-non-eabi on win10, then I can compile files with #include<cstdin> without need of installing any boost on system.

and also, I do have that cstdint.hpp file as well, but that did not help me, I again see that error...

so what would be the proper workaround for this?
You would have to add -I /usr/local/include/boost to your CFLAGS (CPPFLAGS?) in order for that file to be picked up.
 
OP
R

r2com

Member

Reaction score: 5
Messages: 82

alright, so basically I just found out that after removing "arm-none-eabi-gcc" and installing "gcc-arm-embedded" the executable was not in path, what I did is, I directly called compiler like that:
/usr/local/gcc-arm-embedded-10-2020-q4-major/bin/arm-none-eabi-gcc to compile, and now it did compile and did not complain about cstdint, so just like SirDice said, after using that one, problem is gone.

I guess I will have to add that weird location to path executable, feel free to let me know if there is more elegant way of handling it, and for now Ill call it solved.
 
Top