[PATCH, v3] Potential solution to librt issue.

Paolo Carlini paolo.carlini@oracle.com
Thu Jul 24 18:19:00 GMT 2008


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.



More information about the Libstdc++ mailing list