This is the mail archive of the gcc@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: Almost got glibc working with no-vtable-thunks, but ....



On Wed, 15 Sep 1999, Martin v. Loewis wrote:

> In this particular case, the problem seems to be that you pass
> libstdc++ *after* providing libgcc.

Thanks! Now it compiles, but.....

I managed to cut the makefile down to this:---------------------

test.o: test.cc
	g++ test.cc -c -g

test: test.o
	g++ -g -o test test.o -Wl,-rpath-link=/usr/local/glibc/lib
/usr/local/glibc/lib/libc.so.6 /usr/local/glibc/lib/libc_nonshared.a  

run:
	/usr/local/glibc/lib/ld-linux.so.2 --library-path
/usr/local/glibc/lib /home/foh/test 

And the test program looks like this:--------------------------

#include<stdio.h>
#include<iostream.h>

int main()
{
        printf ("Alfa\n");        
        cerr << "Beta" << endl;
        printf ("Gamma\n");                
}

The changes I did in the specs file
/usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.1/specs look like
this:---------------------------------------------------------

> diff specs specs.original

17c17
< %{!shared:crtend.o%s} %{shared:crtendS.o%s}
/usr/local/glibc/lib/crtn.o%s
---
> %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
29c29
< %{!shared:      %{pg:/usr/local/glibc/lib/gcrt1.o%s}
%{!pg:%{p:/usr/local/glibc/lib/gcrt1.o%s}
%{!p:%{profile:/usr/local/glibc/lib/gcrt1.o%s}
%{!profile:/usr/local/glibc/lib/crt1.o%s}}}}
/usr/local/glibc/lib/crti.o%s %{!shared:crtbegin.o%s}
%{shared:crtbeginS.o%s}
---
> %{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}
%{!p:%{profile:gcrt1.o%s}
%{!profile:crt1.o%s}}}}    crti.o%s %{!shared:crtbegin.o%s}
%{shared:crtbeginS.o%s}

However to output from the program looks like this:----------
Alfa

Gamma

The text sent to cerr is lost, but not the linefeed!!!!!

One other thing is that specs changes are not necessary, it
compiles and runs with the same bug anyway. Does that mean that
the crt* files are binary compatible and it picks the old ones?

Thanks for all the help so far. 

Fredrik









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