2

I am trying to crosscompile Newlib library for ARM devices using the arm-none-eabi-XXX from CodeSourcery but i am having some issues. When running ./configure and/or make its showing me messages that arm-none-eabi-cc cannot be found. My path is set up correctly. I can call arm-none-eabi-xxx from terminal as root and as user.

The command:

sudo ./configure --target=arm-none-eabi  --prefix=/usr/local/arm-eabi/bin --disable-newlib-supplied-syscalls

Result:

checking for arm-none-eabi-cc... no
checking for arm-none-eabi-gcc... no
checking for arm-none-eabi-c++... no
checking for arm-none-eabi-g++... no


sudo make:
/bin/sh: arm-none-eabi-cc: command not found

But path set up correctly...

kris@caspinol /usr/local/newlib $ arm
arm2hpdl                 arm-none-eabi-c++        arm-none-eabi-elfedit    arm-none-eabi-gcov       arm-none-eabi-ld         arm-none-eabi-ranlib     arm-none-eabi-sprite     
arm-none-eabi-addr2line  arm-none-eabi-cc         arm-none-eabi-g++        arm-none-eabi-gdb        arm-none-eabi-nm         arm-none-eabi-readelf    arm-none-eabi-strings    
arm-none-eabi-ar         arm-none-eabi-c++filt    arm-none-eabi-gcc        arm-none-eabi-gdbtui     arm-none-eabi-objcopy    arm-none-eabi-run        arm-none-eabi-strip      
arm-none-eabi-as         arm-none-eabi-cpp        arm-none-eabi-gcc-4.6.3  arm-none-eabi-gprof      arm-none-eabi-objdump    arm-none-eabi-size       
kris@caspinol /usr/local/newlib $ arm

Am I missing some arguments during configure stage??

Any help greatly appreciated.

Thanks in advance

2 Answers 2

0

I'm very sorry for being this late. I just experienced this problem, and I tried solving it in all the ways people suggested on the net (hence I came across this question). The problem seems to be that 'sudo' does not pass the environment variables; the $PATH is (cleared and) re-initialized, so it's futile to set up $PATH before issuing sudo make install.

I did a man sudo... Didn't help me out. I also tried man su, and found su -m (or su -e). Those do not seem to work as advertised. So finally I found out that you can...

sudo env "PATH=$PATH" make install && echo "Success!"

If you do not see the "Success!" message, then it might be because you need to run make install TWICE! There seem to be a bug somewhere in the newlib distribution, which causes an error due to a missing directory; this is created on second try. I do not know why that is not fixed. My solution is...

make CFLAGS_FOR_TARGET="-D__IEEE_BIG_ENDIAN -D__IEEE_BYTES_LITTLE_ENDIAN -D__BUFSIZ__=64" && sudo env="PATH=$PATH" make install && sudo env="PATH=$PATH" make install && echo "Success!"
0

Sorry to resurrect a zombie thread but this is still an issue for sudo make install of newlib-4.1.0 cross-compiled for arm-none-eabi on Ubuntu 20.04 LTS. The solution offered by @user309044 is just the ticket, but instead of ... sudo env="PATH=$PATH" ... the correct syntax is ... sudo env "PATH=$PATH" ... i.e. replace the first '=' with a space.

You must log in to answer this question.