aboutsummaryrefslogtreecommitdiffstats
path: root/testing/freeradius/0001-Fix-detection-of-TLS-for-uClibc.patch
blob: e76571a21c1c3f14063a2e49bc1e6756f1e9d871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 51cb058c6a9472585622582d16e01c5540627c25 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 13 Oct 2009 12:53:38 +0000
Subject: [PATCH] Fix detection of TLS for uClibc

On uClibc the configure script will wrongly detect that TLS is
available. This happends becuase the variable val in the test program
is optimized away and missing during link time.

This patch make sure that the variable val is not optimized away so
configure correctly will detect that TLS is missing on uClibc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 acinclude.m4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 6025474..100e5b0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -382,7 +382,7 @@ m4_pushdef([AC_OUTPUT],
 AC_DEFUN([FR_TLS],
 [
     AC_MSG_CHECKING(for TLS)
-    AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main() { return 0; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ])
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main(int argc, char *argv[]) { return val = argc; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ])
     AC_MSG_RESULT($have_tls)
     if test "$have_tls" = "yes"; then
         AC_DEFINE([HAVE_THREAD_TLS],[1],[Define if the compiler supports __thread])
-- 
1.6.4.4