summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-08-30 04:37:35 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-08-30 04:37:35 +0000
commit99ddd2cd7bcfabaafb1b0ed06b915d1bd30412a9 (patch)
treeb93f802d45221012417caab5a78c0099894e2206
parent4f110eab804beca747435b9b7b0c117814e0ac8d (diff)
downloaduClibc-alpine-99ddd2cd7bcfabaafb1b0ed06b915d1bd30412a9.tar.bz2
uClibc-alpine-99ddd2cd7bcfabaafb1b0ed06b915d1bd30412a9.tar.xz
Add in checking the capability of gcc to use TLS if the NPTL thread model is being enabled. I know someone is going to try to compile NPTL with tools that don't support TLS. Hopefully this will trim down idiot questions.
-rw-r--r--Rules.mak21
1 files changed, 21 insertions, 0 deletions
diff --git a/Rules.mak b/Rules.mak
index a9a837a6e..589343556 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -331,6 +331,27 @@ endif
PTCOBJST := $(TOPDIR)libc/obj-pthread-libc
PTCOBJSH := $(TOPDIR)libc/obj-pthread-libc_shared
+#
+# Test for TLS if NPTL support was selected.
+#
+ifeq ($(PTHREADS_NATIVE),y)
+GCC_HAS_TLS=$(shell \
+ echo "extern __thread int foo;" | $(CC) -o /dev/null -S -xc - 2>&1)
+ifneq ($(GCC_HAS_TLS),)
+gcc_tls_test_fail:
+ @echo "####";
+ @echo "#### Your compiler does not support TLS and you are trying to build uClibc";
+ @echo "#### with NPTL support. Upgrade your binutils and gcc to versions which";
+ @echo "#### support TLS for your architecture. Do not contact uClibc maintainers";
+ @echo "#### about this problem.";
+ @echo "####";
+ @echo "#### Exiting...";
+ @echo "####";
+ @exit 1;
+endif
+endif
+
+
ifeq ($(UCLIBC_BUILD_RELRO),y)
LDFLAGS+=-z relro
endif