arm-none-eabi-gcc [bare metal] cannot find -lstdc++_nano...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

arm-none-eabi-gcc [bare metal] cannot find -lstdc++_nano...

yczo
Hello everybody, recently I tried to set up a bare metal arm for Cortex M3 from scratch on my gentoo.
I used

binutils-2.26.tar.gz  
gcc-4.9.3.tar.gz  
gdb-7.11.tar.xz  
newlib-2.3.0.20160104.tar.gz

but when I try to compile, shows the following error:

/arm/cortex-M3/lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot find -lstdc++_nano
/arm/cortex-M3/lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot find -lg_nano
/arm/cortex-M3/lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot find -lc_nano
[/code]
Please, can somebody hel me?
 Thanks in advance.

pd: Here ist the sequence  that i used
[code]
tar xvf binutils-2.26.tar.gz && tar xvf gcc-4.9.3.tar.gz && tar xvf newlib-2.3.0.20160104.tar.gz && tar xvf gdb-7.11.tar.xz

#export paths
export Objetivo=arm-none-eabi && export Prefijo=/arm/cortex-M3


#binutils compile
cd binutils-2.26

./configure --target=$Objetivo --prefix=$Prefijo --disable-newlib-supplied-syscalls --enable-interwork --enable-multilib --with-gnu-as --with-gnu-ld --enable-newlib-nano-malloc --disable-nls --disable-libssp --with-sysroot --disable-werror
make -j8 all && make install

# The meaning of flags:
# --with-mode=thumb ........ use Thumb instruction set
# --enable-interwork ....... supports calling between ARM and Thumb instruction set
# --enable-multilib ........ builds for any other unspecified configuration
# --with-gnu-as ............ use only GNU Assembler
# --with-gnu-ld ............ use only GNU Linker
# --disable-nls ............ output only in English


#gcc compile
PATH="${PATH}:/arm/cortex-M3/bin:"
cd ../gcc-4.9.3 && mkdir objdir && cd objdir
../configure --target=$Objetivo --prefix=$Prefijo --without-headers --disable-shared --disable-newlib-supplied-syscalls --enable-interwork --with-gnu-as --with-gnu-ld --enable-newlib-nano-malloc --with-system-zlib --enable-multilib --enable-languages="c,c++" --with-newlib --with-headers=../../newlib-2.3.0.20160104/newlib/libc/include --disable-libssp --disable-nls --with-cpu=cortex-m3 --with-tune=cortex-m3 --with-mode=thumb --with-float=soft

#I could not find arm-none-eabi-cc
ln -s  $Prefijo/bin/arm-none-eabi-gcc $Prefijo/bin/arm-none-eabi-cc


# The meaning of flags (see https://gcc.gnu.org/install/configure.html):
# --with-system-zlib ...... use the system's zlib library
# --with-newlib ........... newlib is going to be used as the target C library
# --without-headers ....... do not use target headers from libc (newlib) when building, because newlib is not build yet.
# --disable-shared ........ only static libraries, because shared are not supported on the target platform
# make clean


#newlib compile

cd ../../newlib-2.3.0.20160104
./configure --target=$Objetivo --prefix=$Prefijo --disable-newlib-supplied-syscalls --enable-interwork --enable-multilib --with-gnu-as --with-gnu-ld --enable-newlib-nano-malloc --disable-nls --disable-libssp --with-sysroot --disable-werror

make -j8 all && make install

# The meaning of flags:
# --disable-newlib-supplied-syscalls ... disable syscalls, because we are building for bare-metal target.
# --enable-newlib-nano-malloc ... enable nano implementation of malloc suitable for devices with limited memory resources
# make clean

#gcc final compile

cd ../gcc-4.9.3/objdir/
../configure --target=$Objetivo --prefix=$Prefijo --disable-shared --disable-newlib-supplied-syscalls --enable-interwork --with-gnu-as --with-gnu-ld --enable-newlib-nano-malloc --with-system-zlib --enable-multilib --enable-languages="c,c++" --with-newlib --with-headers=../../newlib-2.3.0.20160104/newlib/libc/include --disable-libssp --disable-nls --with-cpu=cortex-m3 --with-tune=cortex-m3 --with-mode=thumb --with-float=soft
make -j8 all && make install

#GDB compile
cd ../../gdb-7.11
./configure --target=$Objetivo --prefix=$Prefijo --disable-newlib-supplied-syscalls --enable-interwork --enable-multilib --with-gnu-as --with-gnu-ld --enable-newlib-nano-malloc --disable-nls --disable-libssp --with-sysroot --disable-werror
make -j8 all && make install