[Bug 203066] _Thread_local detection is broken with GCC < 4.9

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Sep 13 10:55:02 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203066

            Bug ID: 203066
           Summary: _Thread_local detection is broken with GCC < 4.9
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: standards
          Assignee: freebsd-standards at FreeBSD.org
          Reporter: rakuco at FreeBSD.org
                CC: ed at FreeBSD.org, theraven at FreeBSD.org

sys/cdefs.h contains:

    #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L ||
defined(lint)
    ...
    #if !__has_extension(c_thread_local)
    ...
    #if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \
        __has_extension(cxx_thread_local)
    #define _Thread_local           thread_local
    #else
    #define _Thread_local           __thread
    #endif
    #endif

However, _Thread_local support has only been added to GCC in the 4.9 series, so
"#include <runetype.h>" fails with both `gcc47 -std=gnu11' and `gcc48
-std=gnu11':

    /usr/include/runetype.h:92:22: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'const'
    /usr/include/runetype.h: In function '__getCurrentRuneLocale':
    /usr/include/runetype.h:96:6: error: '_ThreadRuneLocale' undeclared (first
use in this function)
    /usr/include/runetype.h:96:6: note: each undeclared identifier is reported
only once for each function it appears in

A consequence of this is that some ports may fail to build; for example,
devel/cmake with lang/gcc (bug#200969, comment #11).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-standards mailing list