]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
build: simplify thread local storage handling
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 20 Jan 2022 08:57:21 +0000 (09:57 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 27 Jan 2022 09:32:04 +0000 (10:32 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
config/tls.m4 [deleted file]
configure.ac
src/lxc/compiler.h

diff --git a/config/tls.m4 b/config/tls.m4
deleted file mode 100644 (file)
index cd032c9..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# See if we have working TLS.  We only check to see if it compiles, and that
-# the resulting program actually runs, not whether the resulting TLS variables
-# work properly; that check is done at runtime, since we can run binaries
-# compiled with __thread on systems without TLS.
-AC_DEFUN([LXC_CHECK_TLS],
-[
-    AC_MSG_CHECKING(for TLS)
-    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main() { return 0; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ])
-    AC_MSG_RESULT($have_tls)
-    if test "$have_tls" = "yes"; then
-        AC_DEFINE([HAVE_TLS],[1],[Define if the compiler supports __thread])
-        AC_DEFINE([thread_local],[__thread],[Define to the compiler TLS keyword])
-    fi
-])
index ac2950d08a0aa9b9a8701805cdc8f9ded34ac2b0..b8f0e1ff2b515e8878725fd98153a63b8936e62c 100644 (file)
@@ -777,9 +777,6 @@ AC_CHECK_TYPES([struct rtnl_link_stats64], [], [], [[#include <linux/if_link.h>]
 AX_PTHREAD
 AC_SEARCH_LIBS(clock_gettime, [rt])
 
-# See if we support thread-local storage.
-LXC_CHECK_TLS
-
 # Hardening flags
 CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
        -fPIE \
index 4d62323822faa1997753f94df8de6b8fa3a28f64..907941d9812072f6d459bcf62890ea18014bc5e9 100644 (file)
@@ -5,8 +5,14 @@
 
 #include "config.h"
 
-#include <stdbool.h>
+#include <assert.h>
+#include <errno.h>
+#include <inttypes.h>
 #include <linux/types.h>
+#include <stdbool.h>
+#include <sys/param.h>
+#include <sys/sysmacros.h>
+#include <sys/types.h>
 
 #ifndef thread_local
 #if __STDC_VERSION__ >= 201112L &&    \