On Thu, 28 Apr 2022 at 05:56, François Dumont via Libstdc++
<libstd...@gcc.gnu.org> wrote:
>
> Hi
>
>      Still time for this fix for gcc 12 ?

What needs fixing?

std::random_device is already declared in the versioned namespace in
<bits/random.h>:

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
...
  /**
   * A standard interface to a platform-specific non-deterministic
   * random number generator (if any are available).
   */
  class random_device
  {

So that means the definitions of its member functions will be exported
as std::__8::random_device::* already, the macros are not needed in
the src/*/*.cc files.

So it seems to me that the only "problem" is a redundant line in
config/abi/pre/gnu-versioned-namespace.ver. That line has no effect,
and can be removed.

I've pushed the attached patch instead.

>
>      If so I'll make sure to run tests quickly, especially the abi.exp
> one to confirm that the cleanup in gnu-versioned-namespace.ver do not
> need to be replaced by the same in __8 namespace.
>
> libstdc++: [_GLIBCXX_INLINE_VERSION] Fix std::random_device definition
>
> Definition shall be put in _GLIBCXX_BEGIN_VERSION_NAMESPACE/
> _GLIBCXX_END_VERSION_NAMESPACE like the declaration.
>
> libstdc++-v3/ChangeLog
>
>      * src/c++11/cow-string-inst.cc: Put random_device member definitions
>      in versioned namespace.
>      * src/c++11/random.cc: Likewise.
>      * config/abi/pre/gnu-versioned-namespace.ver: Remove std::random_device
>      symbols.
>
> François
commit f39fcafbc0d2c49593dd8351b87cf43da9227953
Author: François Dumont <fdum...@gcc.gnu.org>
Date:   Thu Apr 28 10:01:14 2022

    libstdc++: Remove redundant line in versioned namespace linker script
    
    This doesn't match anything.
    
    libstdc++-v3/ChangeLog:
    
            * config/abi/pre/gnu-versioned-namespace.ver: Remove
            std::random_device::* pattern.

diff --git a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver 
b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
index e9520a6421e..b37199ece72 100644
--- a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
+++ b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
@@ -28,7 +28,6 @@ GLIBCXX_8.0 {
     {
       std::*;
       std::__8::*;
-      std::random_device::*
     };
 
     # operator new(size_t)

Reply via email to