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.
Hi,
> > 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>.
Sure, I know that. But my next messages clearly explain what I had in mind, the idea basically was that I wanted to hide the declaration of clock_gettime (available in <time.h> or <ctime>) to chrono.cc and replace it with one decorated with the weakref attribute. In fact, I discovered lately, that is not necessary, chrono.cc can certainly see the declarations in <time.h> and add a declaration of __clock_gettime on top, with weakref attribute and alias. Then use only the latter everywhere.
The doubt now is the following: whether this structure in chrono.cc, which is OK for safely delivering runtime error messages to the user, explaining which library is missing, as suggested by Martin, already a great improvement, would be still able to trigger the --as-needed mechanism in the specs of the compiler, which we want anyway in order to have the automatic on-demand linking.
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.
- Re: [PATCH, v3] Potential solution to librt issue.