Commit 2a0d6c32 authored by Maria Matejka's avatar Maria Matejka
Browse files

Fix thread local storage support in GCC older than 4.9.

Let's hope this will be history soon.
parent 5387208e
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -15,8 +15,17 @@ AC_DEFUN([BIRD_CHECK_THREAD_LOCAL],
      )
    ],
    [bird_cv_thread_local=yes],
    [bird_cv_thread_local=no]
    AC_COMPILE_IFELSE([
      AC_LANG_PROGRAM(
	[
	  static __thread int x = 42;
	],
	[]
      )
    ],
    [bird_cv_thread_local=__thread],
    [bird_cv_thread_local=no]
    ))
  )
])

+3 −1
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@ fi
BIRD_CHECK_THREAD_LOCAL
if test "$bird_cv_thread_local" = no ; then
  AC_MSG_ERROR([Thread-local storage not available])
elif test "$bird_cv_thread_local" != yes ; then
  CFLAGS="$CFLAGS -D_Thread_local=$bird_cv_thread_local"
fi

BIRD_CHECK_PTHREADS
+2 −2
Original line number Diff line number Diff line
@@ -91,8 +91,8 @@ struct filter_state {
  struct buffer buf;
};

_Thread_local static struct filter_state filter_state;
_Thread_local static struct filter_stack filter_stack;
static _Thread_local struct filter_state filter_state;
static _Thread_local struct filter_stack filter_stack;

void (*bt_assert_hook)(int result, const struct f_line_item *assert);

+1 −1
Original line number Diff line number Diff line
@@ -2248,7 +2248,7 @@ bgp_rte_modify_stale(struct rte_storage *r, struct linpool *pool)
  if (ad && int_set_contains(ad, BGP_COMM_LLGR_STALE))
    return r->attrs;

  _Thread_local static struct {
  static _Thread_local struct {
    rta a;
    u32 labels[MPLS_MAX_LABEL_STACK];
  } aloc;