summaryrefslogtreecommitdiffstats
path: root/subversion-1.7.0-pie.patch
blob: 85e9f076fa3747fbe5d727b29cc7b5b76aca98ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff -uap subversion-1.7.0/build/generator/gen_base.py.pie subversion-1.7.0/build/generator/gen_base.py
--- subversion-1.7.0/build/generator/gen_base.py.pie	2011-10-12 09:25:30.510524103 +0100
+++ subversion-1.7.0/build/generator/gen_base.py	2011-10-12 09:25:30.515650110 +0100
@@ -406,7 +406,7 @@ class TargetLinked(Target):
     self.install = options.get('install')
     self.compile_cmd = options.get('compile-cmd')
     self.sources = options.get('sources', '*.c *.cpp')
-    self.link_cmd = options.get('link-cmd', '$(LINK)')
+    self.link_cmd = options.get('link-cmd', '$(LINK_LIB)')
 
     self.external_lib = options.get('external-lib')
     self.external_project = options.get('external-project')
@@ -462,6 +462,11 @@ class TargetExe(TargetLinked):
     self.manpages = options.get('manpages', '')
     self.testing = options.get('testing')
 
+    if self.install == 'test' or self.install == 'bdb-test':
+      self.link_cmd = '$(LINK_TEST)'
+    else:
+      self.link_cmd = '$(LINK_EXE)'
+
   def add_dependencies(self):
     TargetLinked.add_dependencies(self)
 
@@ -507,8 +512,8 @@ class TargetLib(TargetLinked):
     self.msvc_export = options.get('msvc-export', '').split()
 
     ### hmm. this is Makefile-specific
-    if self.link_cmd == '$(LINK)':
-      self.link_cmd = '$(LINK_LIB)'
+    if self.install == 'test':
+       self.link_cmd = '$(LINK_TEST_LIB)'
 
 class TargetApacheMod(TargetLib):
 
diff -uap subversion-1.7.0/Makefile.in.pie subversion-1.7.0/Makefile.in
--- subversion-1.7.0/Makefile.in.pie	2011-10-12 09:25:30.511600030 +0100
+++ subversion-1.7.0/Makefile.in	2011-10-12 09:26:16.757524426 +0100
@@ -205,6 +205,9 @@ COMPILE_JAVAHL_JAVAH = $(JAVAH)
 
 LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS)
 LINK_LIB = $(LINK) $(LT_SO_VERSION) -rpath $(libdir)
+LINK_TEST = $(LINK) -no-install
+LINK_TEST_LIB = $(LINK) -avoid-version
+LINK_EXE = $(LINK) -pie
 LINK_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=link $(CXX) $(LT_LDFLAGS) $(CXXFLAGS) $(LDFLAGS) -rpath $(libdir)
 LINK_CXX_LIB = $(LINK_CXX) $(LT_SO_VERSION)
 
@@ -657,7 +660,7 @@ schema-clean:
 	$(PYTHON) $(top_srcdir)/build/transform_sql.py $< $(top_srcdir)/$@
 
 .c.o:
-	$(COMPILE) -o $@ -c $<
+	$(COMPILE) -fpie -o $@ -c $<
 
 .cpp.o:
 	$(COMPILE_CXX) -o $@ -c $<