Can't link BOTAN library with eclipse - c++

I have installed and built the BOTAN cryptographic library.
Everything seems correctly installed, since I have the following entries in /usr/local/lib directory:
-rw-r--r-- 1 root root 7676350 2012-06-03 11:01 libbotan-1.10.a
lrwxrwxrwx 1 root root 20 2012-06-03 11:01 libbotan-1.10.so -> libbotan-1.10.so.0.1
lrwxrwxrwx 1 root root 20 2012-06-03 11:01 libbotan-1.10.so.0 -> libbotan-1.10.so.0.1
-rwxr-xr-x 1 root root 3396354 2012-06-03 11:01 libbotan-1.10.so.0.1
and in the /usr/local/include one too:
drwxr-xr-x 3 root root 4096 2012-06-03 11:01 botan-1.10
And eventually I managed to include the libraries in the main of my program, and write code without error.
However when building my project (on Eclipse Indigo) I get the following output on console, with the red stderr fashion:
error while loading shared libraries: libbotan-1.10.so.0: cannot open shared object file: No such file or directory
The code I'm trying to execute is the following:
try
{
cout << "In try" << endl;
Botan::LibraryInitializer init;
}catch(std::exception& e)
{
cout << "In catch" << endl;
cerr << e.what() << endl;
}
I have the following doubts:
Is it a problem of the Linker? (And if yes, why isn't the linker throwing the error, but the stderr?)
If not, how can I figure out to let my program find the libbotan-1.10.so.0 file which is actually there? (in /usr/local/lib).
Note that my environment variable $LD_LIBRARY_PATH is currently set, and has the following value:
$> echo $LD_LIBRARY_PATH
$> /usr/local/lib/
Compiler Command Line:
Invoking: GCC C++ Compiler
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"mainOobClient.d" -MT"mainOobClient.d" -o "mainOobClient.o" "../mainOobClient.cpp"
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"oobClientClass.d" -MT"oobClientClass.d" -o "oobClientClass.o" "../oobClientClass.cpp"
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o "MTVS_oobClient" ./mainOobClient.o ./oobClientClass.o -lbotan-1.10
Complete Build Output:
Build of configuration Debug for project MTVS_oobClient
make all
Building file: ../mainOobClient.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"mainOobClient.d" -MT"mainOobClient.d" -o "mainOobClient.o" "../mainOobClient.cpp"
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
Finished building: ../mainOobClient.cpp
Building file: ../oobClientClass.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"oobClientClass.d" -MT"oobClientClass.d" -o "oobClientClass.o" "../oobClientClass.cpp"
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFmainOobClient.d' '-MTmainOobClient.d' '-o' 'mainOobClient.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/cc1plus -quiet -v -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -MMD mainOobClient.d -MFmainOobClient.d -MP -MTmainOobClient.d -MQ mainOobClient.o -dD -D_GNU_SOURCE ../mainOobClient.cpp -D_FORTIFY_SOURCE=2 -quiet -dumpbase mainOobClient.cpp -mtune=generic -march=i686 -auxbase-strip mainOobClient.o -g3 -O3 -Wall -std=c++0x -version -fmessage-length=0 -fstack-protector -o /tmp/ccLIYQkV.s
Finished building: ../oobClientClass.cpp
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
Building target: MTVS_oobClient
Invoking: GCC C++ Linker
g++ ./mainOobClient.o ./oobClientClass.o -lbotan-1.10 -L/usr/local/lib -o "MTVS_oobClient"
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../../../i686-linux-gnu/include"
ignoring duplicate directory "/usr/include/c++/4.5.2"
as it is a non-system directory that duplicates a system directory
Finished building target: MTVS_oobClient
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/botan-1.10
/usr/include/c++/4.5
/usr/include/c++/4.5/i686-linux-gnu
/usr/include/c++/4.5/backward
/usr/local/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include-fixed
/usr/include/i386-linux-gnu
/usr/include
End of search list.
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0c5cb630517b5952f4898dfa56d7e8e5
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFmainOobClient.d' '-MTmainOobClient.d' '-o' 'mainOobClient.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
as -V -Qy --32 -o mainOobClient.o /tmp/ccLIYQkV.s
GNU assembler version 2.21.0 (i686-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.21.0.20110327
COMPILER_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../:/lib/:/usr/lib/:/usr/lib/i386-linux-gnu/
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFmainOobClient.d' '-MTmainOobClient.d' '-o' 'mainOobClient.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFoobClientClass.d' '-MToobClientClass.d' '-o' 'oobClientClass.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/cc1plus -quiet -v -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -MMD oobClientClass.d -MFoobClientClass.d -MP -MToobClientClass.d -MQ oobClientClass.o -dD -D_GNU_SOURCE ../oobClientClass.cpp -D_FORTIFY_SOURCE=2 -quiet -dumpbase oobClientClass.cpp -mtune=generic -march=i686 -auxbase-strip oobClientClass.o -g3 -O3 -Wall -std=c++0x -version -fmessage-length=0 -fstack-protector -o /tmp/ccTuqeWw.s
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../../../i686-linux-gnu/include"
ignoring duplicate directory "/usr/include/c++/4.5.2"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/botan-1.10
/usr/include/c++/4.5
/usr/include/c++/4.5/i686-linux-gnu
/usr/include/c++/4.5/backward
/usr/local/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include-fixed
/usr/include/i386-linux-gnu
/usr/include
End of search list.
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0c5cb630517b5952f4898dfa56d7e8e5
../oobClientClass.cpp: In member function ‘void oobClientClass::authenticateTransaction()’:
../oobClientClass.cpp:126:29: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
../oobClientClass.cpp:164:63: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result
../oobClientClass.cpp:59:6: warning: ‘confirmationChoice’ may be used uninitialized in this function
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFoobClientClass.d' '-MToobClientClass.d' '-o' 'oobClientClass.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
as -V -Qy --32 -o oobClientClass.o /tmp/ccTuqeWw.s
GNU assembler version 2.21.0 (i686-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.21.0.20110327
COMPILER_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../:/lib/:/usr/lib/:/usr/lib/i386-linux-gnu/
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFoobClientClass.d' '-MToobClientClass.d' '-o' 'oobClientClass.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
**** Build Finished ****

The error is coming at run-time. You need to specify the rpath for the binary at build time - Where you have the:
-L/usr/local/lib
You also need:
-Wl,-rpath=/usr/local/lib
This instructs ld to use this path when trying to find the library at run-time. Your LD_LIBRARY_PATH is probably being overridden by the launcher of eclipse, which is why the variable is not being used.
Alternatives:
Make sure that /usr/local/lib is in the /etc/ld.so.conf, and that ldconfig has been run after installing the library.
Link to the .a, using the command line:
g++ -o "MTVS_oobClient" ./mainOobClient.o ./oobClientClass.o -L/usr/local/lib -Wl,-Bstatic -lbotan-1.10 -Wl,-Bdynamic
or using:
g++ -o "MTVS_oobClient" ./mainOobClient.o ./oobClientClass.o /usr/local/lib/libbotan-1.10.a
... both should have the same effect

Since the program build ends correctly, it is clear that it's a run-time problem due to the fact that the program can't find the Shared Library.
I looked for other people with same run-time issue and found out the solution (that I'll briefly sum up) thanks to another SO question.
What I did was to build the dynamically-linked executable, that wishes to be linked against libbotan-1.10.so.0 at execution time. The linking during the build phase was done with command line option -L/usr/local/lib.
There are a few options to make botan (or any other library) available at run-time:
Create a symlink to botan in a directory listed in /etc/ld.so.conf (or /lib or /usr/lib)
Copy botan to a directory listed in /etc/ld.so.conf (or /lib or /usr/lib) (defaults)
Add the directory containing botan to /etc/ld.so.conf
Set LD_LIBRARY_PATH=/usr/local/lib before running your executable.
Recompile the program statically. (It will work, but don't bother.)
After any of the first 3, rerun ldconfig so the linker cache is updated. (You can then run ldconfig -v to verify it's resolvable.)
Note those aren't steps, they're options. You only need to do 1 of them.
Updating the linker cache with ldconfig made it work for me.

Related

x86_64-linux-musl-g++: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory, on alpine container

I am having a problem compiling C/C++ code on an alpine (and ubuntu) container with MUSL toolchain (http://musl.cc/x86_64-linux-musl-cross.tgz )
The error is seen when the container is run on a CentOS workstation (and also Ubuntu)
[user#centoshost ~]# uname -a
Linux centoshost 3.10.0-957.12.1.el7.x86_64 #1 SMP Mon Apr 29 14:59:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[user#centoshost ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core
[user#centoshost ~]#
The same container image when run on an Ubuntu 18.04/CentOS 7 VM (Oracle VirtualBox) is able to compile. The docker version is same (18.09.5) on VM and the workstation.
The error:
bash-5.1# /x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -v test.cpp
Using built-in specs.
COLLECT_GCC=/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++
Target: x86_64-linux-musl
Configured with: ../src_gcc/configure --enable-languages=c,c++,fortran CC='gcc -static --static' CXX='g++ -static --static' FC='gfortran -static --static' CFLAGS='-g0 -O2 -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels' CXXFLAGS='-g0 -O2 -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels' FFLAGS='-g0 -O2 -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels' LDFLAGS='-s -static --static' --enable-default-pie --enable-static-pie --disable-bootstrap --disable-assembly --disable-werror --target=x86_64-linux-musl --prefix= --libdir=/lib --disable-multilib --with-sysroot=/x86_64-linux-musl --enable-tls --disable-libmudflap --disable-libsanitizer --disable-gnu-indirect-function --disable-libmpx --enable-libstdcxx-time=rt --enable-deterministic-archives --enable-libstdcxx-time --enable-libquadmath --enable-libquadmath-support --disable-decimal-float --with-build-sysroot=/tmp/m1032/build/local/x86_64-linux-musl/obj_sysroot AR_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/ar AS_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/gas/as-new LD_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/ld/ld-new NM_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/nm-new OBJCOPY_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/objcopy OBJDUMP_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/objdump RANLIB_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/ranlib READELF_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/readelf STRIP_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/strip-new --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu 'CC_FOR_BUILD=cc -static --static' 'CXX_FOR_BUILD=g++ -static --static'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20210116 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
cc1plus -quiet -v -iprefix /x86_64-linux-musl-cross/bin/../lib/gcc/x86_64-linux-musl/10.2.1/ -isysroot /x86_64-linux-musl-cross/bin/../x86_64-linux-musl -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test -version -o /tmp/ccDckJiL.s
x86_64-linux-musl-g++: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
compilation terminated.
I also tried adding the path to cc1plus to PATH env variable. For this i got a different error:
bash-5.1# PATH=$PATH:/x86_64-linux-musl-cross/libexec/gcc/x86_64-linux-musl/10.2.1/
bash-5.1# /x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ -v test.cpp
Using built-in specs.
COLLECT_GCC=/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++
Target: x86_64-linux-musl
Configured with: ../src_gcc/configure --enable-languages=c,c++,fortran CC='gcc -static --static' CXX='g++ -static --static' FC='gfortran -static --static' CFLAGS='-g0 -O2 -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels' CXXFLAGS='-g0 -O2 -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels' FFLAGS='-g0 -O2 -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels' LDFLAGS='-s -static --static' --enable-default-pie --enable-static-pie --disable-bootstrap --disable-assembly --disable-werror --target=x86_64-linux-musl --prefix= --libdir=/lib --disable-multilib --with-sysroot=/x86_64-linux-musl --enable-tls --disable-libmudflap --disable-libsanitizer --disable-gnu-indirect-function --disable-libmpx --enable-libstdcxx-time=rt --enable-deterministic-archives --enable-libstdcxx-time --enable-libquadmath --enable-libquadmath-support --disable-decimal-float --with-build-sysroot=/tmp/m1032/build/local/x86_64-linux-musl/obj_sysroot AR_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/ar AS_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/gas/as-new LD_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/ld/ld-new NM_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/nm-new OBJCOPY_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/objcopy OBJDUMP_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/objdump RANLIB_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/ranlib READELF_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/readelf STRIP_FOR_TARGET=/tmp/m1032/build/local/x86_64-linux-musl/obj_binutils/binutils/strip-new --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu 'CC_FOR_BUILD=cc -static --static' 'CXX_FOR_BUILD=g++ -static --static'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20210116 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
cc1plus -quiet -v -iprefix /x86_64-linux-musl-cross/bin/../lib/gcc/x86_64-linux-musl/10.2.1/ -isysroot /x86_64-linux-musl-cross/bin/../x86_64-linux-musl -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test -version -o /tmp/ccogMFKi.s
GNU C++14 (GCC) version 10.2.1 20210116 (x86_64-linux-musl)
compiled by GNU C version 10.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include/c++/10.2.1"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include/c++/10.2.1/x86_64-linux-musl"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include/c++/10.2.1/backward"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/x86_64-linux-musl/10.2.1/include"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/../../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include/c++/10.2.1"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/../../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include/c++/10.2.1/x86_64-linux-musl"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/../../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include/c++/10.2.1/backward"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../x86_64-linux-musl/usr/local/include"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/../../lib/gcc/x86_64-linux-musl/10.2.1/../../../../x86_64-linux-musl/include"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../x86_64-linux-musl/usr/include"
ignoring nonexistent directory "/x86_64-linux-musl-cross/bin/../lib/gcc/../../lib/gcc/x86_64-linux-musl/10.2.1/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
cc1plus: fatal error: test.cpp: Operation not permitted
compilation terminated.
I am running as root and 'test.cpp' has 644 permissions.
Found some solutions for the issue.
Running the Alpine Container as "privileged" solved the issue with the musl toolchain.
Also the previous version of the musl toolchain (Released in January 2021), did not give me the issue.

Cross-compiling for Raspberry Pi: can't find bits/c++config.h

I'm trying to setup a c++ 11 cross-compiler (version 4.9.2-r2) for the raspberry pi (Raspbian-jessie) on windows 7 x64.
I am working in CodeLite and I added the cross compiler under settings->build settings. I've also set the compiler as the one to use for my project.
The problem I am having is this error:
c:\sysgcc\raspberry\arm-linux-gnueabihf\include\c++\4.9\iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
I searched on the internet for this problem but I am only finding people who are trying to cross compile for 64 bit linux on a 32 bit version or visa versa but nothing related to the Pi.
Edit 1:
As requested in the comments, this is the complete output when I compile with the -v option:
C:\Windows\system32\cmd.exe /C mingw32-make -e -f Makefile
"----------Building project:[ TestProject01 - Release ]----------"
mingw32-make[1]: Entering directory 'C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01'
Using built-in specs.
COLLECT_GCC=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++.exe
COLLECT_LTO_WRAPPER=c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/lto-wrapper.exe
Target: arm-linux-gnueabihf
Configured with: ../gcc-4.9.2/src/configure --enable-win32-registry=SysGCC-arm-linux-gnueabihf-4.9.2 --prefix /q/gnu/linux/raspberry-jessie/out/ --disable-nls --without-libiconv-prefix --with-sysroot=/q/gnu/linux/raspberry-jessie/out/arm-linux-gnueabihf/sysroot --enable-languages=c,c++ --enable-shared --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --with-arch-directory=arm --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --target arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-std=c++11' '-O2' '-Wall' '-v' '-D' 'NDEBUG' '-I' '.' '-I' '.' '-MG' '-MP' '-MT' './Release/main.cpp.o' '-MF' './Release/main.cpp.o.d' '-MM' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/cc1plus.exe -E -quiet -v -I . -I . -imultilib . -imultiarch arm-linux-gnueabihf -iprefix c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/ -isysroot c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot -MM -MF ./Release/main.cpp.o.d -MG -MP -MT ./Release/main.cpp.o -D_GNU_SOURCE -D NDEBUG main.cpp -march=armv6 -mfloat-abi=hard -mfpu=vfp -mtls-dialect=gnu -std=c++11 -Wall -O2
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9"
ignoring nonexistent directory "C:/MinGW/msys/1.0/include/arm-linux-gnueabihf/c++/4.9/."
ignoring nonexistent directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include"
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
ignoring duplicate directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf"
ignoring duplicate directory "."
#include "..." search starts here:
#include <...> search starts here:
.
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include
End of search list.
COMPILER_PATH=c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/;c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../libexec/gcc/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/
LIBRARY_PATH=c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../lib/gcc/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/lib/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-std=c++11' '-O2' '-Wall' '-v' '-D' 'NDEBUG' '-I' '.' '-I' '.' '-MG' '-MP' '-MT' './Release/main.cpp.o' '-MF' './Release/main.cpp.o.d' '-MM' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++.exe -c "C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01/main.cpp" -std=c++11 -O2 -Wall -v -DNDEBUG -o ./Release/main.cpp.o -I. -I.
Using built-in specs.
COLLECT_GCC=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++.exe
Target: arm-linux-gnueabihf
Configured with: ../gcc-4.9.2/src/configure --enable-win32-registry=SysGCC-arm-linux-gnueabihf-4.9.2 --prefix /q/gnu/linux/raspberry-jessie/out/ --disable-nls --without-libiconv-prefix --with-sysroot=/q/gnu/linux/raspberry-jessie/out/arm-linux-gnueabihf/sysroot --enable-languages=c,c++ --enable-shared --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --with-arch-directory=arm --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --target arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-c' '-std=c++11' '-O2' '-Wall' '-v' '-D' 'NDEBUG' '-o' './Release/main.cpp.o' '-I' '.' '-I' '.' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/cc1plus.exe -quiet -v -I . -I . -imultilib . -imultiarch arm-linux-gnueabihf -iprefix c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/ -isysroot c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot -D_GNU_SOURCE -D NDEBUG C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01/main.cpp -quiet -dumpbase main.cpp -march=armv6 -mfloat-abi=hard -mfpu=vfp -mtls-dialect=gnu -auxbase-strip ./Release/main.cpp.o -O2 -Wall -std=c++11 -version -o C:\Users\Peter\AppData\Local\Temp\ccjXLoID.s
GNU C++ (GCC) version 4.9.2 (arm-linux-gnueabihf)
compiled by GNU C version 4.8.1, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9"
ignoring nonexistent directory "C:/MinGW/msys/1.0/include/arm-linux-gnueabihf/c++/4.9/."
ignoring nonexistent directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include"
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
ignoring duplicate directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf"
ignoring duplicate directory "."
#include "..." search starts here:
#include <...> search starts here:
.
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include
End of search list.
GNU C++ (GCC) version 4.9.2 (arm-linux-gnueabihf)
compiled by GNU C version 4.8.1, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 77a52a28e20292d776f27f30cc5b625f
In file included from C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01/main.cpp:2:0:
c:\sysgcc\raspberry\arm-linux-gnueabihf\include\c++\4.9\iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
mingw32-make[1]: *** [Release/main.cpp.o] Error 1
TestProject01.mk:97: recipe for target 'Release/main.cpp.o' failed
mingw32-make[1]: Leaving directory 'C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01'
mingw32-make: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====2 errors, 1 warnings====

Eclipse is compiling with with libopencm3 for STM32F0 but not for STM32F1

I managed it to get a working blink template with libopencm3 for the STM32F051 (# stmf0discovory). Then I wanted to get a working one for my Maple Mini (with STM32F103 = cortex-m3) so I copied the first one and changed the cpu flag from cortex-m0-plus to cortex-m3, the library from opencm3_stm32f0 to opencm3_stm32f1 and so on...
But as you can guess its not compiling. From the compilation log it seems like the compiler is not invoking the linker and thats why its not finding the gpio_mode_setup function and definistions like GPIO_MODE_OUTPUT. Here are the Eclipse console outputs:
str32f0 - working:
19:07:01 **** Incremental Build of configuration Debug for project Template ****
make all
'Building file: ../Source/main.c'
'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -mlittle-endian -Og -fmessage-length=0 -ffunction-sections -fdata-sections -fno-common -msoft-float -pedantic -Wall -Wextra -Wmissing-declarations -Wshadow -g3 -ggdb -DSTM32F0 -I"C:\ARM-GNU-Toolchain\libopencm3\include" -I"C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template/Include" -std=gnu11 -Wmissing-prototypes -Wstrict-prototypes -Wimplicit-function-declaration -Wredundant-decls -Wa,-adhlns="Source/main.o.lst" -v -MMD -MP -MF"Source/main.d" -MT"Source/main.o" -c -o "Source/main.o" "../Source/main.c"
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-9-build/src/gcc/configure --build=i686-linux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --prefix=/home/build/work/GCC-4-9-build/install-mingw --libexecdir=/home/build/work/GCC-4-9-build/install-mingw/lib --infodir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-9-build/install-mingw/arm-none-eabi --with-libiconv-prefix=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-gmp=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-mpfr=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-mpc=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-isl=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-cloog=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-libelf=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,cortex-m7,armv7-r
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] (GNU Tools for ARM Embedded Processors)
COLLECT_GCC_OPTIONS='-mcpu=cortex-m0plus' '-mthumb' '-mlittle-endian' '-Og' '-fmessage-length=0' '-ffunction-sections' '-fdata-sections' '-fno-common' '-mfloat-abi=soft' '-Wpedantic' '-Wall' '-Wextra' '-Wmissing-declarations' '-Wshadow' '-g3' '-ggdb' '-D' 'STM32F0' '-I' 'C:\ARM-GNU-Toolchain\libopencm3\include' '-I' 'C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template/Include' '-std=gnu11' '-Wmissing-prototypes' '-Wstrict-prototypes' '-Wimplicit-function-declaration' '-Wredundant-decls' '-v' '-MMD' '-MP' '-MF' 'Source/main.d' '-MT' 'Source/main.o' '-c' '-o' 'Source/main.o'
c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/cc1.exe -quiet -v -I C:\ARM-GNU-Toolchain\libopencm3\include -I C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template/Include -imultilib armv6-m -iprefix c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/ -isysroot c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../arm-none-eabi -MMD Source/main.d -MF Source/main.d -MP -MT Source/main.o -dD -D__USES_INITFINI__ -D STM32F0 ../Source/main.c -quiet -dumpbase main.c -mcpu=cortex-m0plus -mthumb -mlittle-endian -mfloat-abi=soft -auxbase-strip Source/main.o -g3 -ggdb -Og -Wpedantic -Wall -Wextra -Wmissing-declarations -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wimplicit-function-declaration -Wredundant-decls -std=gnu11 -version -fmessage-length=0 -ffunction-sections -fdata-sections -fno-common -o C:\Users\Lenny\AppData\Local\Temp\ccN3qnLh.s
GNU C (GNU Tools for ARM Embedded Processors) version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] (arm-none-eabi)
compiled by GNU C version 4.7.4, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/lib/gcc/../../lib/gcc/arm-none-eabi/4.9.3/include"
ignoring nonexistent directory "c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../arm-none-eabi/home/build/work/GCC-4-9-build/install-mingw/lib/gcc/arm-none-eabi/4.9.3/../../../../include"
ignoring duplicate directory "c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/lib/gcc/../../lib/gcc/arm-none-eabi/4.9.3/include-fixed"
ignoring duplicate directory "c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/lib/gcc/../../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/include"
ignoring nonexistent directory "c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../arm-none-eabi/usr/include"
#include "..." search starts here:
#include <...> search starts here:
C:\ARM-GNU-Toolchain\libopencm3\include
C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template/Include
c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/include
c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/include-fixed
c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/include
End of search list.
GNU C (GNU Tools for ARM Embedded Processors) version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] (arm-none-eabi)
compiled by GNU C version 4.7.4, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9d74dec9c13b63cc54577fa808c91d66
COLLECT_GCC_OPTIONS='-mcpu=cortex-m0plus' '-mthumb' '-mlittle-endian' '-Og' '-fmessage-length=0' '-ffunction-sections' '-fdata-sections' '-fno-common' '-mfloat-abi=soft' '-Wpedantic' '-Wall' '-Wextra' '-Wmissing-declarations' '-Wshadow' '-g3' '-ggdb' '-D' 'STM32F0' '-I' 'C:\ARM-GNU-Toolchain\libopencm3\include' '-I' 'C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template/Include' '-std=gnu11' '-Wmissing-prototypes' '-Wstrict-prototypes' '-Wimplicit-function-declaration' '-Wredundant-decls' '-v' '-MMD' '-MP' '-MF' 'Source/main.d' '-MT' 'Source/main.o' '-c' '-o' 'Source/main.o'
c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/as.exe -v -I C:\ARM-GNU-Toolchain\libopencm3\include -I C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template/Include -EL -mcpu=cortex-m0plus -mfloat-abi=soft -meabi=5 -adhlns=Source/main.o.lst -o Source/main.o C:\Users\Lenny\AppData\Local\Temp\ccN3qnLh.s
GNU assembler version 2.24.0 (arm-none-eabi) using BFD version (GNU Tools for ARM Embedded Processors) 2.24.0.20150604
COMPILER_PATH=c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/armv6-m/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../arm-none-eabi/lib/armv6-m/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-mcpu=cortex-m0plus' '-mthumb' '-mlittle-endian' '-Og' '-fmessage-length=0' '-ffunction-sections' '-fdata-sections' '-fno-common' '-mfloat-abi=soft' '-Wpedantic' '-Wall' '-Wextra' '-Wmissing-declarations' '-Wshadow' '-g3' '-ggdb' '-D' 'STM32F0' '-I' 'C:\ARM-GNU-Toolchain\libopencm3\include' '-I' 'C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template/Include' '-std=gnu11' '-Wmissing-prototypes' '-Wstrict-prototypes' '-Wimplicit-function-declaration' '-Wredundant-decls' '-v' '-MMD' '-MP' '-MF' 'Source/main.d' '-MT' 'Source/main.o' '-c' '-o' 'Source/main.o'
'Finished building: ../Source/main.c'
' '
'Building target: Template.elf'
'Invoking: Cross ARM C Linker'
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -mlittle-endian -Og -fmessage-length=0 -ffunction-sections -fdata-sections -fno-common -msoft-float -pedantic -Wall -Wextra -Wmissing-declarations -Wshadow -g3 -ggdb -T "C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template\Misc\stm32f0-discovery.ld" -nostartfiles -Xlinker --gc-sections -L"C:\ARM-GNU-Toolchain\libopencm3\lib" -Wl,-Map,"Template.map" -Xlinker --cref --specs=nano.specs -v --static -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -o "Template.elf" ./Source/main.o -lopencm3_stm32f0 -lc_nano -lnosys
Using built-in specs.
Reading specs from c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/nano.specs
rename spec link to nano_link
rename spec link_gcc_c_sequence to nano_link_gcc_c_sequence
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-9-build/src/gcc/configure --build=i686-linux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --prefix=/home/build/work/GCC-4-9-build/install-mingw --libexecdir=/home/build/work/GCC-4-9-build/install-mingw/lib --infodir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-9-build/install-mingw/arm-none-eabi --with-libiconv-prefix=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-gmp=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-mpfr=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-mpc=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-isl=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-cloog=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-libelf=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,cortex-m7,armv7-r
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] (GNU Tools for ARM Embedded Processors)
COMPILER_PATH=c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/
LIBRARY_PATH=c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/armv6-m/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../arm-none-eabi/lib/armv6-m/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/;c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../arm-none-eabi/lib/
COLLECT_GCC_OPTIONS='-mcpu=cortex-m0plus' '-mthumb' '-mlittle-endian' '-Og' '-fmessage-length=0' '-ffunction-sections' '-fdata-sections' '-fno-common' '-mfloat-abi=soft' '-Wpedantic' '-Wall' '-Wextra' '-Wmissing-declarations' '-Wshadow' '-g3' '-ggdb' '-T' 'C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template\Misc\stm32f0-discovery.ld' '-nostartfiles' '-LC:\ARM-GNU-Toolchain\libopencm3\lib' '-specs=nano.specs' '-v' '-static' '-o' 'Template.elf'
c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/collect2.exe -plugin c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/liblto_plugin-0.dll -plugin-opt=c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\Lenny\AppData\Local\Temp\ccm3aIUJ.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lg_nano -plugin-opt=-pass-through=-lc_nano -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc_nano --sysroot=c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../arm-none-eabi -EL -Bstatic -X -o Template.elf -LC:\ARM-GNU-Toolchain\libopencm3\lib -Lc:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/armv6-m -Lc:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv6-m -Lc:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../arm-none-eabi/lib/armv6-m -Lc:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3 -Lc:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc -Lc:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib -Lc:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../arm-none-eabi/lib --gc-sections -Map Template.map --cref --start-group -lc_nano -lgcc -lnosys --end-group ./Source/main.o -lopencm3_stm32f0 -lc_nano -lnosys --start-group -lgcc -lg_nano -lc_nano --end-group --start-group -lgcc -lc_nano --end-group -T C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template\Misc\stm32f0-discovery.ld
'Finished building target: Template.elf'
' '
make --no-print-directory post-build
'Call post_build.py'
python C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template\Misc\post_build.py "C:/Users/Lenny/Documents/Eclipse/stm32f0-libopencm3/Template" "Debug" "Template"
arm-none-eabi-objdump -S "C:\Users\Lenny\Documents\Eclipse\stm32f0-libopencm3\Template\Debug\Template.elf" > "C:\Users\Lenny\Documents\Eclipse\stm32f0-libopencm3\Template\Debug\Template.lst"
' '
'Invoking: Cross ARM GNU Create Flash Image'
arm-none-eabi-objcopy -O ihex "Template.elf" "Template.hex"
'Finished building: Template.hex'
' '
'Invoking: Cross ARM GNU Print Size'
arm-none-eabi-size --format=berkeley "Template.elf"
text data bss dec hex filename
500 0 0 500 1f4 Template.elf
'Finished building: Template.siz'
' '
19:07:04 Build Finished (took 2s.662ms)
stm32f1 - maple, not wortking:
19:43:56 **** Incremental Build of configuration Debug for project Template ****
make all
'Building file: ../Source/main.c'
'Invoking: Cross ARM C Compiler'
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mlittle-endian -mfix-cortex-m3-ldrd -Og -fmessage-length=0 -ffunction-sections -fdata-sections -msoft-float -pedantic -Wall -Wextra -Wmissing-declarations -Wshadow -g3 -ggdb -DSTM32F1 -I"C:\ARM-GNU-Toolchain\libopencm3\include" -I"C:/Users/Lenny/Documents/Eclipse/maple-mini/Template/Include" -std=gnu11 -Wmissing-prototypes -Wstrict-prototypes -Wimplicit-function-declaration -Wredundant-decls -Wa,-adhlns="Source/main.o.lst" -v -MMD -MP -MF"Source/main.d" -MT"Source/main.o" -c -o "Source/main.o" "../Source/main.c"
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-9-build/src/gcc/configure --build=i686-linux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --prefix=/home/build/work/GCC-4-9-build/install-mingw --libexecdir=/home/build/work/GCC-4-9-build/install-mingw/lib --infodir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes --with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-9-build/install-mingw/arm-none-eabi --with-libiconv-prefix=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-gmp=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-mpfr=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-mpc=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-isl=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-cloog=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-libelf=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,cortex-m7,armv7-r
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] (GNU Tools for ARM Embedded Processors)
COLLECT_GCC_OPTIONS='-mcpu=cortex-m3' '-mthumb' '-mlittle-endian' '-mfix-cortex-m3-ldrd' '-Og' '-fmessage-length=0' '-ffunction-sections' '-fdata-sections' '-mfloat-abi=soft' '-Wpedantic' '-Wall' '-Wextra' '-Wmissing-declarations' '-Wshadow' '-g3' '-ggdb' '-D' 'STM32F1' '-I' 'C:\ARM-GNU-Toolchain\libopencm3\include' '-I' 'C:/Users/Lenny/Documents/Eclipse/maple-mini/Template/Include' '-std=gnu11' '-Wmissing-prototypes' '-Wstrict-prototypes' '-Wimplicit-function-declaration' '-Wredundant-decls' '-v' '-MMD' '-MP' '-MF' 'Source/main.d' '-MT' 'Source/main.o' '-c' '-o' 'Source/main.o'
c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/bin/../lib/gcc/arm-none-eabi/4.9.3/cc1.exe -quiet -v -I C:\ARM-GNU-Toolchain\libopencm3\include -I C:/Users/Lenny/Documents/Eclipse/maple-mini/Template/Include -imultilib armv7-m -iprefix c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/ -isysroot c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../arm-none-eabi -MMD Source/main.d -MF Source/main.d -MP -MT Source/main.o -dD -D__USES_INITFINI__ -D STM32F1 ../Source/main.c -quiet -dumpbase main.c -mcpu=cortex-m3 -mthumb -mlittle-endian -mfix-cortex-m3-ldrd -mfloat-abi=soft -auxbase-strip Source/main.o -g3 -ggdb -Og -Wpedantic -Wall -Wextra -Wmissing-declarations -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wimplicit-function-declaration -Wredundant-decls -std=gnu11 -version -fmessage-length=0 -ffunction-sections -fdata-sections -o C:\Users\Lenny\AppData\Local\Temp\ccd3YTdy.s
GNU C (GNU Tools for ARM Embedded Processors) version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] (arm-none-eabi)
compiled by GNU C version 4.7.4, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/lib/gcc/../../lib/gcc/arm-none-eabi/4.9.3/include"
ignoring nonexistent directory "c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../arm-none-eabi/home/build/work/GCC-4-9-build/install-mingw/lib/gcc/arm-none-eabi/4.9.3/../../../../include"
ignoring duplicate directory "c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/lib/gcc/../../lib/gcc/arm-none-eabi/4.9.3/include-fixed"
ignoring duplicate directory "c:/arm-gnu-toolchain/gcc-arm-none-eabi-4_9-2015q2-20150609-win32/lib/gcc/../../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/include"
ignoring nonexistent directory "c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../arm-none-eabi/usr/include"
#include "..." search starts here:
#include <...> search starts here:
C:\ARM-GNU-Toolchain\libopencm3\include
C:/Users/Lenny/Documents/Eclipse/maple-mini/Template/Include
c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/include
c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/include-fixed
c:\arm-gnu-toolchain\gcc-arm-none-eabi-4_9-2015q2-20150609-win32\bin\../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/include
End of search list.
GNU C (GNU Tools for ARM Embedded Processors) version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] (arm-none-eabi)
compiled by GNU C version 4.7.4, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9d74dec9c13b63cc54577fa808c91d66
../Source/main.c: In function 'gpio_setup':
../Source/main.c:38:2: warning: implicit declaration of function 'gpio_mode_setup' [-Wimplicit-function-declaration]
gpio_mode_setup(PORT_LED, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, PIN_LED);
^
../Source/main.c:38:28: error: 'GPIO_MODE_OUTPUT' undeclared (first use in this function)
gpio_mode_setup(PORT_LED, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, PIN_LED);
^
../Source/main.c:38:28: note: each undeclared identifier is reported only once for each function it appears in
../Source/main.c:38:46: error: 'GPIO_PUPD_NONE' undeclared (first use in this function)
gpio_mode_setup(PORT_LED, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, PIN_LED);
^
make: *** [Source/main.o] Fehler 1
19:43:57 Build Finished (took 567ms)
I am pretty sure its a stupid mistake, but I cant find it by my own and hope you can give me a hint.
Thank you very much.
The libopencm3 library interfaces for the mentioned architectures are different.
For the f1 the function is gpio_set_mode and not gpio_mode_setup. Also the defines are slightly different.

Why is g++ not producing a binary?

This is my build log when using Eclipse and GCC.
I have tried every suggestion for this issue I have found on the web (and there are lots!) but nothing works for me.
Can anyone see any issue from this build log please:
17:49:24 **** Rebuild of configuration Debug for project test2 ****
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -c -fmessage-length=0 -v -o "src\\test2.o" "..\\src\\test2.cpp"
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\g++.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto --enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gmp-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src\test2.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1plus.exe -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.8.1/ -dD ..\src\test2.cpp -quiet -dumpbase test2.cpp -mtune=generic -march=pentiumpro -auxbase-strip src\test2.o -g3 -O0 -Wall -version -fmessage-length=0 -o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\cc2tQ3YT.s
GNU C++ (GCC) version 4.8.1 (mingw32)
compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++/mingw32"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++/backward"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../../../../include"
ignoring duplicate directory "/mingw/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include-fixed"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../../../../mingw32/include"
ignoring duplicate directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++/mingw32
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++/backward
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../include
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include-fixed
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../mingw32/include
End of search list.
GNU C++ (GCC) version 4.8.1 (mingw32)
compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1ebc2a6f92fbd3aadc367a20a63fdf9f
COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src\test2.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v -o src\test2.o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\cc2tQ3YT.s
GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils) 2.24
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../
COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src\test2.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
17:49:24 Build Finished (took 313ms)

configure gdb 7.7.1 and brew install gcc-4.8 in eclipse makefile project

I just installed gdb 7.7.1 and gcc 4.8.3 by brew on my mac 10.9.4, it does well when I use gcc to compile a test.cpp and use gdb to debug it; but I cannot configure my IDE eclipse cdt to do it? The following is the output and my configure on eclipse?
gcc ouptput when compile in terminal:
wens#mac-pro:test$ g++ -g -std=c++11 -v test.cpp
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple- darwin13.3.0/4.8.3/lto-wrapper
Target: x86_64-apple-darwin13.3.0
Configured with: ../configure --build=x86_64-apple-darwin13.3.0 -- prefix=/usr/local/Cellar/gcc48/4.8.3 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.3' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (Homebrew gcc48 4.8.3)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-shared-libgcc' '-mtune=core2'
/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/cc1plus -quiet -v -D__DYNAMIC__ test.cpp -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase test.cpp -mmacosx-version-min=10.9.3 -mtune=core2 -auxbase test -g -std=c++11 -version -o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccnjAUQK.s
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/include"
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple- darwin13.3.0/4.8.3/../../../../x86_64-apple-darwin13.3.0/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/x86_64-apple-darwin13.3.0
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/backward
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include
/usr/local/include
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
End of search list.
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ef96a7cbf8b02312d9306455464399f1
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-shared-libgcc' '-mtune=core2'
as -arch x86_64 -force_cpusubtype_ALL -o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccvxLrmP.o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccnjAUQK.s
COMPILER_PATH=/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple- darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/
LIBRARY_PATH=/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-shared-libgcc' '-mtune=core2' /usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple darwin13.3.0/4.8.3/collect2 -dynamic -arch x86_64 -macosx_version_min 10.9.3 -weak_reference_mismatches non-weak -o a.out -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3 -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../.. /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccvxLrmP.o -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v -idsym -dsym
collect2 version 4.8.3
/usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.9.3 -weak_reference_mismatches non-weak -o a.out -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3 -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../.. /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccvxLrmP.o -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
#(#)PROGRAM:ld PROJECT:ld64-236.4
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
Library search paths:
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3
/usr/local/Cellar/gcc48/4.8.3/lib
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
dsymutil a.out
This output "a.out" and " a.out.dSYM" is just like native clang, and I can use gdb debug it correctly.
The following is the output from eclipse:
18:02:32 **** Build of configuration Default for project test ****
make all
/usr/local/bin/g++ -g -std=c++11 -v -c -o test.o test.cpp
Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
Target: x86_64-apple-darwin13.3.0
Configured with: ../configure --build=x86_64-apple-darwin13.3.0 -- prefix=/usr/local/Cellar/gcc48/4.8.3 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.3' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (Homebrew gcc48 4.8.3)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-c' '-o' 'test.o' '-shared-libgcc' '-mtune=core2'
/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/cc1plus -quiet -v -D__DYNAMIC__ test.cpp -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase test.cpp -mmacosx-version-min=10.9.3 -mtune=core2 -auxbase-strip test.o -g -std=c++11 -version -o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccJWTQT8.s
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/include"
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple- darwin13.3.0/4.8.3/../../../../x86_64-apple-darwin13.3.0/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/x86_64-apple-darwin13.3.0
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/backward
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include
/usr/local/include
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
End of search list.
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ef96a7cbf8b02312d9306455464399f1
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-c' '-o' 'test.o' '-shared-libgcc' '-mtune=core2'
as -arch x86_64 -force_cpusubtype_ALL -o test.o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccJWTQT8.s
COMPILER_PATH=/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/
/usr/local/bin/g++ -o test test.o
LIBRARY_PATH=/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-c' '-o' 'test.o' '-shared-libgcc' '-mtune=core2'
18:02:32 Build Finished (took 415ms)
The config in the tiny test makefile c++ project
CXX = /usr/local/bin/g++
CXXFLAGS = -mmacosx-version-min=10.9.3 -g -std=c++11 -v -shared-libgcc -mtune=core2
OBJS = test.o
LIBS =
TARGET = test
$(TARGET): $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
all: $(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
when i use gdb print a local value in main(), it give following:
(gdb) r
(gdb) file test
Reading symbols from test...done.
(gdb) list
8 #include <iostream>
9 #include <vector>
10
11 using namespace std;
12
13 //extern vector<int> spiral_output_matrix(vector<vector<int> > const &v);
14
15 int main()
16 {
17 vector<int> origin = {1, 3, 5};
(gdb) break 20
Breakpoint 1 at 0x100000810: file test.cpp, line 20.
(gdb) run
Starting program: /Users/wens/Desktop/code_study/eclipse/test/test
Breakpoint 1, main () at test.cpp:21
21 for (auto i : origin)
(gdb) print i
Could not find the frame base for "main()".
(gdb)
I have used the same gcc-4.8 and gdb 7.7.1 for eclipse, from the above output I can know it's something about ld and dsymutil? It cause the different, right? anyone can tell me is there some way to configure eclipse to do this?