This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++ and c library compatible issue when bootstrap GCC

I ran into below error message at stage2 of bootstrap GCC:

-B/work/obj/gcc-bootstrap/./prev-gcc/ -B//aarch64-none-linux-gnu/bin/
-nostdinc++ -B/work/obj/gcc-bootstrap/prev-aarch64-none-linux-gnu/libstdc++-v3/src/.libs
-c   -g -O2 -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common  -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild
-I/src/gcc/gcc -I/src/gcc/gcc/build -I/src/gcc/gcc/../include
-I/src/gcc/gcc/../libcpp/include  \
        -o build/genautomata.o /src/gcc/gcc/genautomata.c
In file included from /src/gcc/gcc/genautomata.c:116:0:
error: âconstexpr bool std::isinf(double)â conflicts with a previous
 using std::isinf;

In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdio.h:27,
                 from /src/gcc/gcc/system.h:46,
                 from /src/gcc/gcc/genautomata.c:108:
/usr/include/aarch64-linux-gnu/bits/mathcalls.h:201:1: note: previous
declaration âint isinf(double)â
 __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));

I kind of understand what the problem is base on below facts:
1) I bootstrap gcc against new glibc;
2) I configure gcc with "--with-build-sysroot". According to GCC
document, this only affects how target libraries are built.
3) binary executables are built in GCC for internal use purpose. These
binaries are used to generate internal files during building gcc, and
I guess they are not considered as target library. So system C
libraries/headers are used.
4) at stage2 of gcc bootstrap, these binaries are compiled by stage1
xg++, which by default uses new libstdc+ just built in stage1.
5) Problem, the new libstdc++ is configured/built against new glibc
because of "--with-build-sysroot". It's incompatible with system C

It's a little tricky.  First question is:  is it reasonable to use
"--with-build-sysroot" alone when building/bootstrapping gcc?  If yes,
how should we build binaries in GCC?  Seems to me it's not reasonable
to use new libstdc++ along with system C library since it's built
against new glibc.

Any suggestion?  Thanks in advance.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]