Package: ocaml / 4.05.0-11

0013-Use-CCLINKFLAGS-for-linking-all-executables-and-shar.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
From: Torok Edwin <edwin@etorok.net>
Date: Wed, 15 Jul 2015 16:33:23 +0300
Subject: Use CCLINKFLAGS for linking all executables and shared libraries

This allows packagers to set additional linker flags for executables and shared
libraries created by OCaml, and for the OCaml tools themselves.
OCaml code can be linked with various C stubs and C libraries that would
benefit from using hardening link flags, such as -Wl,-z,relro.

Origin: other
Bug-Debian: https://bugs.debian.org/702349
Forwarded: no
Last-Update: <2015-07-15>
---
 configure      | 2 ++
 tools/Makefile | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index c0024a9..b8e0bcf 100755
--- a/configure
+++ b/configure
@@ -815,6 +815,8 @@ if test $with_sharedlibs = "yes"; then
       shared_libraries_supported=true;;
   esac
 fi
+mksharedlib="$mksharedlib $CCLINKFLAGS"
+mkexe="$mkexe $CCLINKFLAGS"
 
 if test -z "$mkmaindll"; then
   mkmaindll=$mksharedlib
diff --git a/tools/Makefile b/tools/Makefile
index 9a8cf65..2d19c65 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -316,7 +316,7 @@ endif
 
 objinfo_helper$(EXE): objinfo_helper.c ../config/s.h
 	$(BYTECC) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \
-          $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) objinfo_helper.c $(LIBBFD_LINK)
+          $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) objinfo_helper.c $(LIBBFD_LINK) $(CCLINKFLAGS)
 
 OBJINFO=../compilerlibs/ocamlcommon.cma \
         ../compilerlibs/ocamlbytecomp.cma \