Use CCLINKFLAGS for linking all executables and shared libraries
authorTorok Edwin <edwin@etorok.net>
Wed, 15 Jul 2015 13:33:23 +0000 (16:33 +0300)
committerStéphane Glondu <glondu@debian.org>
Thu, 13 Jul 2017 02:40:57 +0000 (03:40 +0100)
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>

Gbp-Pq: Name 0013-Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch

configure
tools/Makefile.shared

index c37a2e5234176d293fdbcebfaf68f06f05757492..b58a86dcf1c7f7008346a73d97acbcaec718b683 100755 (executable)
--- a/configure
+++ b/configure
@@ -768,6 +768,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
index 0b90cd32b5b1a3d6650c307951b52e29a144f296..2d5546e261ce3f112adfd0b4bcbf201be09090ca 100644 (file)
@@ -287,7 +287,7 @@ endif
 
 objinfo_helper$(EXE): objinfo_helper.c ../config/s.h
        $(BYTECC) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \
-          objinfo_helper.c $(LIBBFD_LINK)
+          objinfo_helper.c $(LIBBFD_LINK) $(CCLINKFLAGS)
 
 OBJINFO=../compilerlibs/ocamlcommon.cma \
         ../compilerlibs/ocamlbytecomp.cma \