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]

Re: Problem with libstdc++ (i586-pc-linux-gnulibc1)




On Fri, 24 Jul 1998, Andris Pavenis wrote:

> I have following problem with libstdc++ from both gcc-2.8.1 and
> egcs-1.0.3a (System: Pentium 200MMX, Linux kernel-2.0.35, libc-5.4.46):
> 
> When trying to build STATICALLY linked executables I'm sometimes getting
> conflict between libc.a and libstdc++.a. I met this problem with 
> big application and didn't succeed to find some simple example to
> ilustrate the problem. So only thing I have to do is to give output
> of linking this executable and inform about workaround I tried
> successfully for gcc-2.8.1 + libstdc++-2.8.1.1 and also for
> one of latest snapshots of egcs (980715). Currently I have egcs-1.0.3
> installed and didn't rebuild libraries yet.
> 
> ------------------------------------------------------------------
> 
> - First thing I did was to replace libio/config/linuxlibc1.mt with
>   libio/config/linux.mt which only includes in library libio/iogetline.c
>   (to get rid of _IO_* functions that are present both in libc.a 
>   and libstdc++.a). This change does not break other systems so I
>   don't think it's dangerous.
> 
>   As the result I got different conflict situation with iogetline.c:
>     - this file contains 2 functions _IO_getline and _IO_getline_info
>       and only the second one is missing from libc.a.
>   So I got similar message as above but now about '_IO_getline'
>   which can be found in 2 libraries
> 
> - After that I commented out _IO_getline from iogetline.c. Now all
>   worked and I didn't get any more problems in some latest months (I did it
>   for gcc-2.8.1 at end of March). Of course the second workaround is
>   ugly and cannot be used more widely. 
> 
> The best way I see is to split libio/iogetline.c in 2 files and include 
> only the one that contains _IO_getline_info for target 
> i[34567]86-pc-linux-libc1. 
> 
> I downloaded some previous versions of libc and libstdc++ (2.7.2.1):
>   - libstdc++.a (version 2.7.2.1 for Linux) does not contain _IO_...
>     functions. _IO_getline_info were not introduced at all at this 
>     time as I understood.
> 
> There may be some more incompatibilities between different versions of
> libc:
>        5.0.44 and 5.0.46 contains _IO_ferror and _IO_fputc which
>        are missing from 5.0.37 and earlier versions. According to 
>        ChangeLog of libc these functions were introduced in Aug 1997
>        to improve compatibility with glibc beginning with libc-5.0.38

Sorry for typo here. I thought versions 5.4.XX (not 5.0.XX)

> 
> So for this target it is necessary to look for following functions in
> libc:  _IO_ferror, _IO_fputc and _IO_getline and _IO_getline_info.
> We should only include missing ones in libstdc++.   
> 

Today I built latest snapshot of egcs (980721). (at first I patched
libio as mentioned above: replaced libio/config/linuxlibc1.mt with
libio/config/linux.mt and commented out _IO_getline())

All checks in libio suceeded.

Andris


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