This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Errors when compiling C++ using cross GCC
- From: Mark G <markg735 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 20 Nov 2016 04:14:38 -0500
- Subject: Errors when compiling C++ using cross GCC
- Authentication-results: sourceware.org; auth=none
Hello all,
I am attempting to build a C/C++ cross compiler that runs on
x86_64-pc-linux-gnu and targets arm-unknown-linux-gnueabihf. I am not
building libc so I am building GCC using --with-sysroot to point to the
root file system of the target. I am building GCC v6.2.0 and binutils 2.27.
The produced cross compiler is capable of compiling C but it fails when
building C++ code in a very odd manner. If I build C++ code using purely
static libraries it also works.
Building C++ without -static, however results in the errors below. What's
odd is that the multiple definition errors in the dynamic libstdc++.so are
from symbols in the same library.
Any ideas as to what what may be causing this?
Thanks,
Mark.
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so:(*IND*+0x0):
multiple definition of `ldexpl@GLIBCXX_3.4.3'
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so::(.text+0x1930):
first defined here
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so:(*IND*+0x0):
multiple definition of `frexpl@GLIBCXX_3.4.3'
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so::(.text+0x1928):
first defined here
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so:
In function `modfl@GLIBCXX_3.4.3':
:(.text+0x193c): multiple definition of `modfl@GLIBCXX_3.4.3'
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so:(*IND*+0x0):
multiple definition of `modfl'
/opt/cross/lib/gcc/arm-linux-gnueabihf/6.2.0/../../../../arm-linux-gnueabihf/bin/ld: