From: Torok Edwin Date: Wed, 15 Jul 2015 13:33:23 +0000 (+0300) Subject: Use CCLINKFLAGS for linking all executables and shared libraries X-Git-Tag: archive/raspbian/4.11.1-5+rpi1~1^2^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d184d87fe2fce811631684eac768731b01410862;p=ocaml.git 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: <2019-07-22> Gbp-Pq: Name 0003-Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch --- diff --git a/configure.ac b/configure.ac index aa5f26f2..069fe960 100644 --- a/configure.ac +++ b/configure.ac @@ -831,6 +831,9 @@ AS_IF([test x"$enable_shared" != "xno"], natdynlinkopts="-Wl,-E" shared_libraries_supported=true])]) +mksharedlib="$mksharedlib $CCLINKFLAGS" +mkexe="$mkexe $CCLINKFLAGS" + AS_IF([test -z "$mkmaindll"], [mkmaindll=$mksharedlib]) # Configure native dynlink diff --git a/tools/Makefile b/tools/Makefile index dbad0b74..b4adcffa 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -276,7 +276,7 @@ DEF_SYMBOL_PREFIX = '-Dsymbol_prefix="_"' endif objinfo_helper$(EXE): objinfo_helper.$(O) - $(CC) $(BFD_LDFLAGS) $(OC_CFLAGS) $(OUTPUTEXE)$@ $< $(BFD_LDLIBS) + $(CC) $(BFD_LDFLAGS) $(OC_CFLAGS) $(OUTPUTEXE)$@ $< $(BFD_LDLIBS) $(CCLINKFLAGS) objinfo_helper.$(O): $(ROOTDIR)/runtime/caml/s.h