be0d45
--- libselinux-1.30.19/src/Makefile.notls	2006-08-01 14:16:38.000000000 -0400
75675c
+++ libselinux-1.30.19/src/Makefile	2006-08-01 14:37:15.000000000 -0400
be0d45
@@ -24,6 +24,11 @@
be0d45
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
be0d45
 RANLIB=ranlib
be0d45
 
be0d45
+ARCH := $(patsubst i%86,i386,$(shell uname -m))
be0d45
+ifneq (,$(filter i386,$(ARCH)))
75675c
+TLSFLAGS += -mno-tls-direct-seg-refs
be0d45
+endif
be0d45
+
be0d45
 SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
be0d45
 
be0d45
 all: $(LIBA) $(LIBSO) 
75675c
@@ -45,7 +50,7 @@
75675c
 	ln -sf $@ $(TARGET) 
75675c
 
75675c
 %.o:  %.c policy.h
75675c
-	$(CC) $(CFLAGS) -c -o $@ $<
75675c
+	$(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
75675c
 
75675c
 %.lo:  %.c policy.h
75675c
 	$(CC) $(CFLAGS) -fpic -DSHARED -c -o $@ $<