1
0
forked from jengelh/openldap2
openldap2/0005-pie-compile.dif

182 lines
5.9 KiB
Plaintext
Raw Normal View History

From c73e8eb5d25f22ffb1203a38becbe88da4fc9116 Mon Sep 17 00:00:00 2001
From: Ralf Haferkamp <rhafer@suse.de>
Date: Wed, 16 Jun 2010 14:08:30 +0200
Subject: pie compile
12 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/build/top.mk b/build/top.mk
index eb4c825..4cb3da8 100644
--- a/build/top.mk
+++ b/build/top.mk
@@ -178,9 +178,9 @@ SLAPD_L = $(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
WRAP_LIBS = @WRAP_LIBS@
# AutoConfig generated
AC_CC = @CC@
-AC_CFLAGS = @CFLAGS@
+AC_CFLAGS = @CFLAGS@ $(PIE_CFLAGS)
AC_DEFS = @CPPFLAGS@ # @DEFS@
-AC_LDFLAGS = @LDFLAGS@
+AC_LDFLAGS = @LDFLAGS@ $(PIE_LDFLAGS)
AC_LIBS = @LIBS@
KRB4_LIBS = @KRB4_LIBS@
diff --git a/libraries/liblunicode/Makefile.in b/libraries/liblunicode/Makefile.in
index 5348baa..7332d4e 100644
--- a/libraries/liblunicode/Makefile.in
+++ b/libraries/liblunicode/Makefile.in
@@ -35,6 +35,9 @@ $(XXDIR)/uctable.h: $(XXDIR)/ucgendat.c $(srcdir)/UnicodeData.txt $(srcdir)/Comp
$(MAKE) ucgendat
./ucgendat $(srcdir)/UnicodeData.txt -x $(srcdir)/CompositionExclusions.txt
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
ucgendat: $(XLIBS) ucgendat.o
$(LTLINK) -o $@ ucgendat.o $(LIBS)
diff --git a/libraries/liblutil/Makefile.in b/libraries/liblutil/Makefile.in
index b527966..a04e18e 100644
--- a/libraries/liblutil/Makefile.in
+++ b/libraries/liblutil/Makefile.in
@@ -19,6 +19,9 @@ PROGRAM = testavl
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
NT_SRCS = ntservice.c
NT_OBJS = ntservice.o slapdmsg.res
diff --git a/libraries/librewrite/Makefile.in b/libraries/librewrite/Makefile.in
index 72678c1..a4e0bcc 100644
--- a/libraries/librewrite/Makefile.in
+++ b/libraries/librewrite/Makefile.in
@@ -26,6 +26,9 @@ OBJS = config.o context.o info.o ldapmap.o map.o params.o rule.o \
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
LIBRARY = librewrite.a
PROGRAMS = rewrite
XLIBS = $(LIBRARY) $(LDAP_LIBLUTIL_A) \
diff --git a/servers/slapd/Makefile.in b/servers/slapd/Makefile.in
index c170d79..23a18eb 100644
--- a/servers/slapd/Makefile.in
+++ b/servers/slapd/Makefile.in
@@ -69,6 +69,9 @@ SLAPD_DYNAMIC_BACKENDS=@SLAPD_DYNAMIC_BACKENDS@
SLAPI_LIBS=@LIBSLAPI@ @SLAPI_LIBS@
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
XDEFS = $(MODULES_CPPFLAGS)
XLDFLAGS = $(MODULES_LDFLAGS)
diff --git a/servers/slapd/back-bdb/Makefile.in b/servers/slapd/back-bdb/Makefile.in
index f44dab2..d919931 100644
--- a/servers/slapd/back-bdb/Makefile.in
+++ b/servers/slapd/back-bdb/Makefile.in
@@ -37,6 +37,9 @@ mod_DEFS = -DSLAPD_IMPORT
MOD_DEFS = $(@BUILD_BDB@_DEFS)
MOD_LIBS = $(BDB_LIBS)
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
shared_LDAP_LIBS = $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
NT_LINK_LIBS = -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
UNIX_LINK_LIBS = $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
diff --git a/servers/slapd/back-hdb/Makefile.in b/servers/slapd/back-hdb/Makefile.in
index 5d8381c..a80d8c0 100644
--- a/servers/slapd/back-hdb/Makefile.in
+++ b/servers/slapd/back-hdb/Makefile.in
@@ -41,6 +41,9 @@ mod_DEFS = -DSLAPD_IMPORT
MOD_DEFS = $(@BUILD_HDB@_DEFS)
MOD_LIBS = $(BDB_LIBS)
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
shared_LDAP_LIBS = $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
NT_LINK_LIBS = -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
UNIX_LINK_LIBS = $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
diff --git a/servers/slapd/back-ldap/Makefile.in b/servers/slapd/back-ldap/Makefile.in
index 64a4af8..51495d5 100644
--- a/servers/slapd/back-ldap/Makefile.in
+++ b/servers/slapd/back-ldap/Makefile.in
@@ -29,6 +29,9 @@ BUILD_MOD = @BUILD_LDAP@
mod_DEFS = -DSLAPD_IMPORT
MOD_DEFS = $(@BUILD_LDAP@_DEFS)
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
shared_LDAP_LIBS = $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
NT_LINK_LIBS = -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
UNIX_LINK_LIBS = $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
diff --git a/servers/slapd/back-ldif/Makefile.in b/servers/slapd/back-ldif/Makefile.in
index 29450ae..c47641f 100644
--- a/servers/slapd/back-ldif/Makefile.in
+++ b/servers/slapd/back-ldif/Makefile.in
@@ -25,6 +25,9 @@ BUILD_MOD = yes
mod_DEFS = -DSLAPD_IMPORT
MOD_DEFS = $(yes_DEFS)
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
shared_LDAP_LIBS = $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
NT_LINK_LIBS = -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
UNIX_LINK_LIBS = $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
diff --git a/servers/slapd/back-monitor/Makefile.in b/servers/slapd/back-monitor/Makefile.in
index 6005b2d..a8f45a7 100644
--- a/servers/slapd/back-monitor/Makefile.in
+++ b/servers/slapd/back-monitor/Makefile.in
@@ -33,6 +33,9 @@ BUILD_MOD = @BUILD_MONITOR@
mod_DEFS = -DSLAPD_IMPORT
MOD_DEFS = $(@BUILD_MONITOR@_DEFS)
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
shared_LDAP_LIBS = $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
NT_LINK_LIBS = -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
UNIX_LINK_LIBS = $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
diff --git a/servers/slapd/back-relay/Makefile.in b/servers/slapd/back-relay/Makefile.in
index a408f34..518c7e5 100644
--- a/servers/slapd/back-relay/Makefile.in
+++ b/servers/slapd/back-relay/Makefile.in
@@ -25,6 +25,9 @@ BUILD_MOD = @BUILD_RELAY@
mod_DEFS = -DSLAPD_IMPORT
MOD_DEFS = $(@BUILD_RELAY@_DEFS)
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
shared_LDAP_LIBS = $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
NT_LINK_LIBS = -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS) $(REWRITE)
UNIX_LINK_LIBS = $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS) $(REWRITE)
diff --git a/servers/slapd/overlays/Makefile.in b/servers/slapd/overlays/Makefile.in
index 0b7ce5c..7a48574 100644
--- a/servers/slapd/overlays/Makefile.in
+++ b/servers/slapd/overlays/Makefile.in
@@ -46,6 +46,9 @@ LTONLY_MOD = $(LTONLY_mod)
LDAP_INCDIR= ../../../include
LDAP_LIBDIR= ../../../libraries
+PIE_CFLAGS="-fPIE"
+PIE_LDFLAGS="-pie"
+
MOD_DEFS = -DSLAPD_IMPORT
shared_LDAP_LIBS = $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
--
1.7.1