This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: throw(), pure and const flags on functions


> Unfortunately, you can't do that so easily, because those symbols are
> exported and we break the ABI if we just mark those functions as static,
> they just disappear from the *.so. If you really want to accomplish

I was thinking of this (ABI testsuite breaks).  The symbol will
disappear from *.so, but since prototype of the function in question was
actually never exported from the .cc file itself (i.e. it is not in
header), no existing code outside libstdc++ itself should call it, so
removing it from exported symbols list should cause no harm?

> something to the same effect, for now, until we break the ABI, you have
> to keep exporting the symbols, thus just invent a tiny wrapper around
> each functions, not marked as static, forwarding to the real renamed
> function, marked as static and used as such elsewhere in the .cc. I hope
> it's clear ;)

Well, I can do that too.  I guess it still improves codegen and linking
time, but it would be nice to get rid of the wrapper too.

> > Does the following patch look OK?  If so, i would like to commit it and
> > follo9wup with more .cc files.
> >   
> Makes perfect sense to me. Just wait a bit, say 24h, in case of comments
> from the other maintainers, then just go ahead.
> > We also need to decide how to handle the attributes.  Are we going to
> > use direct __attribute__ ((pure)) or have some kind of ATTRIBUTE_PURE
> > define somewhere? And if so, where it should be defined?
> >   
> I see. Remember to "uglify" always "uglify" in the library, thus it
> would be _ATTRIBUTE_PURE, or something like that, with an underscore at
> the beginning. Indeed, we have a place for those things,
> include/bits/c++config, should be ok.

OK, I will try to look into the c++ config.  If you can provide me with
patch that adds #defines for pure and const attributes, it would help
however too :))
> 
> ... and, remember to be very careful with the testsuite, your first
> draft does *not* pass it, because of the ABI thing ;)

Yep, i run the testsuite and noticed ABI issue.  Still it seems to me
that in this case we can just make the symbol disappear and update ABI
testsuite.

Honza
> 
> Paolo.


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