Re: Enabling monotonic and realtime clocks for libstdc++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 20 Dec 2024, 17:19 Caden via Gcc-help, <gcc-help@xxxxxxxxxxx> wrote:

> Hi!
>
> For work I've been trying to build a RISC-V compiler, configured to enable
> a couple settings for libstdc++. For a custom SoC, I want to tailor the
> compiler to specifically enable the use of both monotonic and realtime
> clocks, so they can be utilized by clock_gettime().
>


You seem to have things backwards. Those macros are used by the C++ library
to configure whether the C++ library's std::chrono clocks can use
clock_gettime. They don't affect clock_gettime in any way.

If you want clock_gettime to work, you need the C library to provide it,
and that's nothing to do with GCC. GCC does not provide a C library.

You might want to use newlib as your C library.

Once you have a working clock_gettime from your C library, then configuring
GCC will automatically set those macros so that the C++ library can use
clock_gettime.


> I noticed the following macros in "c++config.h" which are disabled by
> default for RISC-V GNU:
> _GLIBCXX_USE_CLOCK_REALTIME
> _GLIBCXX_USE_CLOCK_MONOTONIC
>
> Is there a way to customize the use of these settings in c++config.h? As
> far as I know, there aren't any flags specifically for enabling these
> clocks/macros. I've looked into the configure flag
> '--enable-libstdcxx-time' but it seems to be unused on modern systems.
>
> Thank you and have a wonderful holiday season.
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux