GCC tries building libcpp using linux compiler

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mariuszp
Member
Member
Posts: 593
Joined: Sat Oct 16, 2010 3:38 pm

GCC tries building libcpp using linux compiler

Post by mariuszp »

I am trying to build a native glidix gcc using my cross-compiler that runs on linux. The configuration line I use is:

Code: Select all

../glidix-gcc/configure --host=x86_64-glidix --target=x86_64-glidix --prefix=/usr --exec-prefix=/usr --enable-languages=c --disable-nls --disable-libstdcxx
The build fails at a very strange error:

Code: Select all

make[1]: Wejście do katalogu `/home/mariusz/Madd/build/glidix/build-native-gcc/libcpp'
g++  -I../../glidix-gcc/libcpp -I. -I../../glidix-gcc/libcpp/../include -I../../glidix-gcc/libcpp/include  -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I../../glidix-gcc/libcpp -I. -I../../glidix-gcc/libcpp/../include -I../../glidix-gcc/libcpp/include   -c -o charset.o -MT charset.o -MMD -MP -MF .deps/charset.Tpo ../../glidix-gcc/libcpp/charset.c
In file included from ../../glidix-gcc/libcpp/../include/hashtab.h:40:0,
                 from ../../glidix-gcc/libcpp/../include/filenames.h:29,
                 from ../../glidix-gcc/libcpp/system.h:367,
                 from ../../glidix-gcc/libcpp/charset.c:21:
../../glidix-gcc/libcpp/../include/ansidecl.h:171:64: error: new declaration ‘char* basename(const char*)’
 #  define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
                                                                ^
../../glidix-gcc/libcpp/../include/libiberty.h:110:64: note: in expansion of macro ‘ATTRIBUTE_NONNULL’
 extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
                                                                ^
In file included from ../../glidix-gcc/libcpp/system.h:201:0,
                 from ../../glidix-gcc/libcpp/charset.c:21:
/usr/include/string.h:601:26: error: ambiguates old declaration ‘const char* basename(const char*)’
 extern "C++" const char *basename (const char *__filename)
                          ^
make[1]: *** [charset.o] Błąd 1
make[1]: Opuszczenie katalogu `/home/mariusz/Madd/build/glidix/build-native-gcc/libcpp'
make: *** [all-libcpp] Błąd 2
As we can see from the command, while building libcpp, it tries using the linux compiler (g++). My OS has no C++ cross-compiler built as I do not yet intend to support C++. So I do not even see any reason why it would try to build libcpp in the first place.

Has anyone stumbled upon this issue?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: GCC tries building libcpp using linux compiler

Post by gerryg400 »

These days gcc is a c++ program.
If a trainstation is where trains stop, what is a workstation ?
mariuszp
Member
Member
Posts: 593
Joined: Sat Oct 16, 2010 3:38 pm

Re: GCC tries building libcpp using linux compiler

Post by mariuszp »

So i have to first port the c++ library?
madanra
Member
Member
Posts: 150
Joined: Mon Sep 07, 2009 12:01 pm

Re: GCC tries building libcpp using linux compiler

Post by madanra »

At least as much as GCC uses, yes.

The last version of GCC to use only C was 4.7.4, released on 2014-06-12. The first version of GCC to use C++ was 4.8.0, released on 2013-03-22.
Post Reply