Blob Blame Raw
--- quota-tools/Makefile.in.orig	2008-01-24 06:52:54.658544000 -0500
+++ quota-tools/Makefile.in	2008-01-24 06:56:58.930806000 -0500
@@ -52,6 +52,10 @@ LIBOBJS += @LIBMALLOC@
  
 all: $(PROGS)
 
+                                                                                
+svc_socket.o rquota_server.o rquota_svc.o $(filter-out rquota_xdr.o,$(LIBOBJS)): %.o: %.c
+	$(CC) $(CFLAGS) -fpie -c $<
+
 clean:
 	-rm -f core *.o .*.d
 
@@ -130,7 +134,8 @@ setquota: setquota.o quotaops.o $(LIBOBJ
 convertquota: convertquota.o $(LIBOBJS)
 
 rpc.rquotad: rquota_server.o rquota_svc.o svc_socket.o $(LIBOBJS)
-	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+	$(CC) $(LDFLAGS) -pie -o $@ $^ $(LIBS)
+	@if readelf -d $@|fgrep -q TEXTREL; then echo "*** Text relocation"; false; else true; fi
 
 ifneq ($(NETLINKLIBS),)
 quota_nld: quota_nld.o $(LIBOBJS)
@@ -146,7 +151,7 @@ rquota_xdr.c: rquota.x
 	$(RPCGEN) -c -o $@ $<
 
 rquota_xdr.o: rquota_xdr.c rquota.h
-	$(CC) $(CFLAGS) -Wno-unused -c $<
+	$(CC) $(CFLAGS) -Wno-unused -fpie -c $<
 
 rquota_clnt.c: rquota.x
 	$(RPCGEN) -l -o $@ $<