This is the mail archive of the gcc-patches@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]

Re: [PATCH, v3] Potential solution to librt issue.


Hi Martin, thanks for your message,

> Would declaring a weakref for clock_gettime in libstdc++ work?

I think the whole machinery devised by Paolo doesn't need it. If system_clock::now, thus clock_gettime, is not used in the user code, that is the <chrono> header is included but the facility is not used, I think the --as-needed mechanism doesn't trigger, librt is not linked. I did a couple of small experiments which confirmed that.

Otherwise, I don't see any other benefit of the attribute in this case, in the sense that the specific mechanism that we are missing right now is the on-demand automatic linking of librt (and then libpthread), I don't think we have a problem with spurious unsatisfied (or duplicate!) symbols, in our case.

By the way, many thanks Paolo for your draft! Chris, if you can start playing with it (together with moving back system_clock::now inline, removing the export), that would be great! And I don't think we should really care right now if only dynamic linking works with this specific C++0x feature...

Paolo.


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