Bug 58012 - Gcc bootstrap failed with cloog-isl: undefined reference to std::istream::ignore(long)
Summary: Gcc bootstrap failed with cloog-isl: undefined reference to std::istream::ign...
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.8.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-28 16:16 UTC by goughost
Modified: 2017-09-06 13:14 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description goughost 2013-07-28 16:16:51 UTC
../gcc-4.8.1/libstdc++-v3/src/c++98/istream.cc:116: error: undefined reference to 'std::istream::ignore(long)'
../gcc-4.8.1/libstdc++-v3/src/c++98/istream.cc:521: error: undefined reference to 'std::basic_istream<wchar_t, std::char_traits<wchar_t> >::ignore(long)'

Build failed with system cloog/isl (version 0.18.0 and 0.11.1), when making cc1 in ./gcc/ in stage2. Without cloog/isl, build is ok.

It's configured this way:
../gcc-4.8.1/configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-lto --disable-multilib --enable-shared --disable-static --enable-__cxa_atexit --enable-threads=posix --enable-languages=c,c++,fortran --enable-plugin --with-system-zlib

When making cc1, `-static-libstdc++' is passed to bootstrap compiler, and `libstdc++.a' (a copy of `libstdc++convenience.a') is used.
On the other hand, `libstdc++convenience.a' is an incomplete library. At least `std::istream::ignore(long)' (in compatibility.cc) is not included.
Without cloog/isl, linking succeeds, since no linked object refers to istream.

With cloog/isl, graphite*.c files includes isl headers. In <isl/int.h>, there is a function: `std::ostream &operator<<(std::ostream &os, isl_int i)'. Remove this function definition, recompile graphite*.c, and link: succeed.

I'm not sure whether this is a bug in Gcc or there's something wrong with my compile environment.
Comment 1 goughost 2013-07-29 13:00:15 UTC
It's not the function definition, but `#include <iostream>' that caused the error. Either isl should get patched to `#include <ostream>'; or gcc provide a bigger libstdc++convenience.a that has the missing bits. The previous is easier, as long as only std::ostream is used in that header.
Comment 2 Mario Emmenlauer 2017-06-30 18:17:55 UTC
I'm still plagued by this issue with gcc 5.4.0 and gcc 6.3.0 on CentOS 6.8 and CentOS 7.3.1611. I tried with and without my own isl 0.18.0, no difference. Was this never really resolved? Newest isl 0.18.0 has int.h only in the include/deprecated/ directory, is the patch still needed?
Comment 3 Markus 2017-09-06 13:14:44 UTC
I had the same issue with 5.4.0 even without isl. What solved it for me was to remove the '--disable-static' from the configure options.