- only build non-fpic objects with -mno-tls-direct-seg-refs

This commit is contained in:
Jeremy Katz 2006-08-01 18:38:57 +00:00
parent be0d45133a
commit 75675c7d50
2 changed files with 15 additions and 3 deletions

View File

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

View File

@ -2,7 +2,7 @@
Summary: SELinux library and simple utilities
Name: libselinux
Version: 1.30.19
Release: 4
Release: 5
License: Public domain (uncopyrighted)
Group: System Environment/Libraries
Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz
@ -117,6 +117,9 @@ exit 0
%{_libdir}/python*/site-packages/selinux.py*
%changelog
* Tue Aug 1 2006 Jeremy Katz <katzj@redhat.com> - 1.30.19-5
- only build non-fpic objects with -mno-tls-direct-seg-refs
* Tue Aug 1 2006 Jeremy Katz <katzj@redhat.com> - 1.30.19-4
- build with -mno-tls-direct-seg-refs on x86 to avoid triggering
segfaults with xen (#200783)