public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57163] New: Link failure with thread_local std::default_random_engine
@ 2013-05-03 16:20 jleahy+gcc at gmail dot com
  2013-05-04  0:07 ` [Bug c++/57163] Link failure with thread_local paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jleahy+gcc at gmail dot com @ 2013-05-03 16:20 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57163

             Bug #: 57163
           Summary: Link failure with thread_local
                    std::default_random_engine
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jleahy+gcc@gmail.com


Created attachment 30026
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30026
Preprocessed input files

Output of gcc -v:
Thread model: posix
gcc version 4.8.0 (GCC)
Target: x86_64-unknown-linux-gnu

Input file test.cpp:
#include <random>
extern thread_local std::default_random_engine rng;
int main() { return rng(); }

Input file test2.cpp:
#include <random>
thread_local std::default_random_engine rng;

Command line and output:
g++ -std=c++11 -c test.cpp && g++ -std=c++11 -c test2.cpp && g++ -std=c++11
test.o test2.o
test.o:test.cpp:function _ZTW3rng: error: undefined reference to '_ZTH3rng'
collect2: error: ld returned 1 exit status

Complete preprocessed output attached. I can't reproduce this with a single
translation unit.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/57163] Link failure with thread_local
  2013-05-03 16:20 [Bug c++/57163] New: Link failure with thread_local std::default_random_engine jleahy+gcc at gmail dot com
@ 2013-05-04  0:07 ` paolo.carlini at oracle dot com
  2013-06-14 22:40 ` meyerm at fs dot tum.de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-05-04  0:07 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57163

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Link failure with           |Link failure with
                   |thread_local                |thread_local
                   |std::default_random_engine  |

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-05-04 00:07:33 UTC ---
In any case the actual std::default_random_engine doesn't play any special
role: the same error happens including, as test.h, something like

namespace std
{
  struct default_random_engine
  {
    default_random_engine() { }

    int operator()() { return 1; }
  };
}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/57163] Link failure with thread_local
  2013-05-03 16:20 [Bug c++/57163] New: Link failure with thread_local std::default_random_engine jleahy+gcc at gmail dot com
  2013-05-04  0:07 ` [Bug c++/57163] Link failure with thread_local paolo.carlini at oracle dot com
@ 2013-06-14 22:40 ` meyerm at fs dot tum.de
  2013-06-14 22:41 ` meyerm at fs dot tum.de
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: meyerm at fs dot tum.de @ 2013-06-14 22:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57163

Marcel Meyer <meyerm at fs dot tum.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |meyerm at fs dot tum.de

--- Comment #2 from Marcel Meyer <meyerm at fs dot tum.de> ---
Confirmed for gcc 4.8.1.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/57163] Link failure with thread_local
  2013-05-03 16:20 [Bug c++/57163] New: Link failure with thread_local std::default_random_engine jleahy+gcc at gmail dot com
  2013-05-04  0:07 ` [Bug c++/57163] Link failure with thread_local paolo.carlini at oracle dot com
  2013-06-14 22:40 ` meyerm at fs dot tum.de
@ 2013-06-14 22:41 ` meyerm at fs dot tum.de
  2013-12-02  2:56 ` conradsand.arma at gmail dot com
  2014-01-30 15:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: meyerm at fs dot tum.de @ 2013-06-14 22:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57163

--- Comment #3 from Marcel Meyer <meyerm at fs dot tum.de> ---
Please have a look at bug #55800 .


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/57163] Link failure with thread_local
  2013-05-03 16:20 [Bug c++/57163] New: Link failure with thread_local std::default_random_engine jleahy+gcc at gmail dot com
                   ` (2 preceding siblings ...)
  2013-06-14 22:41 ` meyerm at fs dot tum.de
@ 2013-12-02  2:56 ` conradsand.arma at gmail dot com
  2014-01-30 15:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: conradsand.arma at gmail dot com @ 2013-12-02  2:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57163

Conrad <conradsand.arma at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |conradsand.arma at gmail dot com

--- Comment #4 from Conrad <conradsand.arma at gmail dot com> ---
Confirmed for gcc 4.8.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/57163] Link failure with thread_local
  2013-05-03 16:20 [Bug c++/57163] New: Link failure with thread_local std::default_random_engine jleahy+gcc at gmail dot com
                   ` (3 preceding siblings ...)
  2013-12-02  2:56 ` conradsand.arma at gmail dot com
@ 2014-01-30 15:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-30 15:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57163

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.9.0
         Resolution|---                         |FIXED
      Known to fail|                            |4.8.2

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Works with 4.9 for me.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-30 15:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03 16:20 [Bug c++/57163] New: Link failure with thread_local std::default_random_engine jleahy+gcc at gmail dot com
2013-05-04  0:07 ` [Bug c++/57163] Link failure with thread_local paolo.carlini at oracle dot com
2013-06-14 22:40 ` meyerm at fs dot tum.de
2013-06-14 22:41 ` meyerm at fs dot tum.de
2013-12-02  2:56 ` conradsand.arma at gmail dot com
2014-01-30 15:25 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).