Package: ncl / 6.3.0-13

linking-rules.patch Patch series | download
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
Author: Alastair McKinstry <mckinstry@debian.org>
Description: Change linking rules to Debian standards.
 * Add SONAME to shared libraries
 * Add -pie, relro rules for hardening executables
Last-Updated: 2014-02-25
Forwarded: no

Index: ncl-6.3.0/config/LinuxLib
===================================================================
--- ncl-6.3.0.orig/config/LinuxLib
+++ ncl-6.3.0/config/LinuxLib
@@ -42,7 +42,7 @@ library.so:: library.so.major]\
 ]\
 library.so.major:: arch]\
 	MakeDir($(TOP)/shared)]\
-	$(LD) -shared -o $@ --whole-archive arch $(SHAREDLDLIBSEARCH) reqlibs ]\
+	gcc -shared -o $@ $(EXTRA_LDFLAGS)  -Wl,-soname,library.so.major  -Wl,--whole-archive arch  -Wl,--no-whole-archive $(SHAREDLDLIBSEARCH)  -Wl,--as-needed  reqlibs -lgfortran ]\
 	@cd $(TOP)/shared;\ ]\
 	$(RM) library.so.major; \ ]\
 	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\
@@ -78,7 +78,7 @@ library.so:: library.so.major]\
 ]\
 library.so.major:: arch]\
 	MakeDir($(TOP)/shared)]\
-	$(LD) -shared -o $@ --whole-archive arch $(SHAREDLDLIBSEARCH) reqlibs ]\
+	gcc -shared -o $@ $(EXTRA_LDFLAGS)  -Wl,-soname,library.so.major  -Wl,--whole-archive arch  -Wl,--no-whole-archive $(SHAREDLDLIBSEARCH) -Wl,--as-needed reqlibs  -lgfortran ]\
 	@cd $(TOP)/shared;\ ]\
 	$(RM) library.so.major; \ ]\
 	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\
@@ -118,7 +118,7 @@ library.so:: library.so.major]\
 ]\
 library.so.major:: objects]\
 	MakeDir($(TOP)/shared)]\
-	$(LD) -shared -o $@ objects $(SHAREDLDLIBSEARCH) reqlibs ]\
+	gcc -shared -o $@ $(EXTRA_LDFLAGS) -Wl,-soname,library.so.major objects $(SHAREDLDLIBSEARCH) -Wl,--as-needed reqlibs -lgfortran ]\
 	@cd $(TOP)/shared;\ ]\
 	$(RM) library.so.major; \ ]\
 	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\
@@ -154,7 +154,7 @@ library.so:: library.so.major]\
 ]\
 library.so.major:: objects]\
 	MakeDir($(TOP)/shared)]\
-	$(LD) -shared -o $@ objects $(SHAREDLIBSEARCH) $(_LIBROOTSEARCH) $(LIB_SEARCH) reqlibs ]\
+	gcc -shared -o $@ objects $(EXTRA_LDFLAGS)  -Wl,-soname,library.so.major  $(SHAREDLIBSEARCH) $(_LIBROOTSEARCH) $(LIB_SEARCH) -Wl,--as-needed reqlibs -lgfortran ]\
 	@cd $(TOP)/shared;\ ]\
 	$(RM) library.so.major; \ ]\
 	$(LN) ../$(CURRENT_DIR)/library.so.major . ]\