1 Index: util-linux-ng-2.16/m4/tls.m4
2 ===================================================================
3 --- util-linux-ng-2.16.orig/m4/tls.m4 2009-07-04 01:20:03.000000000 +0200
4 +++ util-linux-ng-2.16/m4/tls.m4 2009-07-30 01:57:30.151697033 +0200
9 - AC_MSG_CHECKING(for thread local storage (TLS) class)
10 - AC_CACHE_VAL(ac_cv_tls, [
11 - ax_tls_keywords="__thread __declspec(thread) none"
12 - for ax_tls_keyword in $ax_tls_keywords; do
13 - case $ax_tls_keyword in
14 - none) ac_cv_tls=none ; break ;;
17 - [#include <stdlib.h>
20 - static ] $ax_tls_keyword [ int bar;
24 - [ac_cv_tls=$ax_tls_keyword ; break],
30 + AC_CACHE_CHECK([for thread local storage (TLS) class],
32 + [AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }],
33 + [chktls_save_LDFLAGS="$LDFLAGS"
34 + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
35 + chktls_save_CFLAGS="$CFLAGS"
36 + CFLAGS="-fPIC $CFLAGS"
37 + dnl If -shared works, test if TLS works in a shared library.
38 + AC_LINK_IFELSE([int f() { return 0; }],
39 + AC_LINK_IFELSE([__thread int a; int b; int f() { return a = b; }],
43 + CFLAGS="$chktls_save_CFLAGS"
44 + LDFLAGS="$chktls_save_LDFLAGS"], [ac_cv_tls=no])
47 - if test "$ac_cv_tls" != "none"; then
48 - dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
49 - AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
51 - AC_MSG_RESULT($ac_cv_tls)
52 + AS_IF([test "x$ac_cv_tls" = "xyes"],
53 + [AC_DEFINE([TLS], 1,
54 + [Define this if the compiler supports __thread for Thread-Local Storage])
58 Index: util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c
59 ===================================================================
60 --- util-linux-ng-2.16.orig/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:31:48.518159459 +0200
61 +++ util-linux-ng-2.16/shlibs/uuid/src/gen_uuid.c 2009-07-30 02:32:04.867871183 +0200
66 -#define THREAD_LOCAL static TLS
67 +#define THREAD_LOCAL static __thread
69 #define THREAD_LOCAL static