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>
Fri, 25 Jan 2019 13:59:28 +0000 (14:59 +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

index c0024a9c976daf084c4ef4ca3e417970cf4091a0..b8e0bcf72dffaac05429d6682b60d9d961b6c2c8 100755 (executable)
--- 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
index 9a8cf652b4fce7c68822cbaded9872fee3ae6f17..2d19c6552822630369898b0f73528848c1cbaa99 100644 (file)
@@ -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 \