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: second attempt to report bug: incorrect behaviour of -frepo (fwd)


> I'm unable to use automatick template instantiation in library.

Thanks for your bug report. I can reproduce your problem; it seems
that it is caused by the virtual inheritance. Please note that
combining object files into libraries (libss) is also a problem when
using -frepo.

> /As mention in gcc documentation, for doing this I must compile objects
> with -frepo switch and try to link it together before creating library/

No. Just remove all switches, g++ will doe the right thing. It will
instantiate the templates needed in each object file, and remove
duplicates when linking.

>   1. Is the way, to create libraries with template instantiation, is
> correct at all, or info entry in gcc documentation is obsolete and
>  must be removed ?

-frepo is still available, although it has a number of bugs, and is
superceded by superiour mechanisms on some platforms. Maybe the
documentation should be updated.

>   2. Is this a real bug in g++ or I missing something ? 

Your Makefile had a number of problems. For example, the rule to build
libss.a was

libss.a: x1.o x2.o
	$(CXX) $(CXXFLAGS) x1.o x2.o
	ar -cru libss.a x1.o x2.o

I don't know why you invoke the compiler in this case.

Anyway, your basic approach was correct. If you remove the virtual
inheritance in G2, you'll see that it -frepo works just fine.

>   3. If this is a bug in gcc:
>       1. can anybody give me guidelines: how to try fix it myself ? 

You'll have to have a look how the repository is analysed. Check out
the file gcc/cp/repo.c, and the variable flag_use-repository.

>       2. Is this test will be added to testcase ?   

I believe the testsuite currently does not support multi-file
tests. If you can arrange to thest for this problem, please submit a
test case.

>       3. Are exists some formal bug tracking process in gcc
> development , /public accessible GNATS database, as in FreeBSD
> project/ and if yes, how to submit bug to it ?

Such a database is currently not operational.

>   4. If this my bug:
>       Are exists example of creating c++ library with automatic template
> instantiations somewhere in the net ? 

Well, just use the mechanism that does not involve any command line
switches. It should work just fine on ELF-based systems using the GNU
linker.

Regards,
Martin


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