This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug libstdc++/69881] with gcc-6 of today building gcc-4.9 fails


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69881

--- Comment #13 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Jonathan Wakely from comment #12)
> (In reply to Bernd Edlinger from comment #9)
> > right now I am trying to boot-strap this:
> > 
> > Index: c/cstddef
> > ===================================================================
> > --- c/cstddef	(revision 233581)
> > +++ c/cstddef	(working copy)
> > @@ -31,10 +31,11 @@
> >  
> >  #pragma GCC system_header
> >  
> > -#define __need_size_t
> > -#define __need_ptrdiff_t
> > -#define __need_NULL
> > -#define __need_offsetof
> > +#undef __need_wchar_t
> > +#undef __need_size_t
> > +#undef __need_ptrdiff_t
> > +#undef __need_NULL
> > +#undef __need_wint_t
> >  #include_next <stddef.h>
> 
> 
> How do you plan to test this change? Do you have a target that uses this
> header?
> 

Yes, I do have such targets.
We use eCos at Softing as real time O/S a lot.

I think I will build an ecos cross compiler, did so last year with
gcc-5.1, (and had quite a lot of trouble with the bugs in
ecos headers)

./gcc-5.1.0/configure --prefix=/home/ed/gnu/arm-eabi --target=arm-eabi
--with-newlib --enable-languages=c,c++ --disable-hosted-libstdcxx
--disable-__cxa-atexit --disable-libquadmath --disable-decimal-float

> 
> >  #endif
> > Index: c_global/cstddef
> > ===================================================================
> > --- c_global/cstddef	(revision 233581)
> > +++ c_global/cstddef	(working copy)
> > @@ -41,6 +41,11 @@
> >  
> >  #pragma GCC system_header
> >  
> > +#undef __need_wchar_t
> > +#undef __need_size_t
> > +#undef __need_ptrdiff_t
> > +#undef __need_NULL
> > +#undef __need_wint_t
> >  #include <bits/c++config.h>
> >  #include <stddef.h>
> 
> This isn't incorrect, but it should not be necessary. This macros are
> internal implementation details of the standard library headers, and user
> code (like GMP) should not be defining those macros. If GMP wants size_t it
> should include <stddef.h> and if it wants std::size_t it should include
> <cstddef>, and it should not try to play silly games to only get part of the
> header.
> 
> 

Yeah, shit happens.
Anyway boot-strap & reg-testing OK on x86_64-pc-linux-gnu.
gcc-4.9 builds successfully (minus Ada, see pr69883 :()

> 
> > Index: c_std/cstddef
> > ===================================================================
> > --- c_std/cstddef	(revision 233581)
> > +++ c_std/cstddef	(working copy)
> > @@ -41,6 +41,11 @@
> >  
> >  #pragma GCC system_header
> >  
> > +#undef __need_wchar_t
> > +#undef __need_size_t
> > +#undef __need_ptrdiff_t
> > +#undef __need_NULL
> > +#undef __need_wint_t
> >  #include <bits/c++config.h>
> >  #include <stddef.h>
> 
> How do you plan to test this?

no idea yet.
under what condition is that header used?

Why does it only differ in the comment from the
previous header?

why are the both files different?
diff c_global/cstddef c_std/cstddef
26c26
<  *  This is a Standard C++ Library file.  You should @c \#include this file
---
>  *  This is a Standard C++ Library file.  You should @c #include this file

is this a mistake?

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