This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH, v3] Potential solution to librt issue.
On Thu, Jul 24, 2008 at 3:13 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Replying to myself... ;)
>
>> I'm still wondering if we could somehow
>> have a mechanism working *inside* the .so, like having
>> clock_gettime considered weak (Martin ;) inside the .so, and
>> then the linking of librt triggering at the end of the linking
>> process if the symbol is actually referenced somewhere in the
>> user code and remained undefined. Is that vague idea clear,
>> does it make sense (I'm asking the experts)?
>
<snip>
> Would it work *not* including <time.h> in chrono.cc,
chrono.cc includes sys/time.h for gettimeofday not clock_gettime. The
clock_gettime comes through <time.h> in <ctime>.
Chris
>instead declaring it "by hand" decorated with the "famous" weakref attribute. Then the .so would export a __clock_gettime symbol, which essentially would wrap everything is now in the body of definition of system_clock::now. In the header, the inline definition of system_clock::now just forwards to __clock_gettime.
>
> The above, + Paolo's mechanism in the specs, - the unconditional linking of librt (added a few days ago).
>
> Paolo.
>
>
- References:
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.
- Re: [PATCH, v3] Potential solution to librt issue.