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>
Wed, 20 Sep 2023 07:59:40 +0000 (09:59 +0200)
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: <2021-12-21>

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

configure.ac

index ebb8bbdb804e8cecfcf69e8c15b98d953d9da677..d27d47bce265e38d1c33f30fd9f1637a8e56ce65 100644 (file)
@@ -987,6 +987,9 @@ AS_IF([test x"$enable_shared" != "xno"],
       natdynlinkopts="-Wl,-E"
       supports_shared_libraries=true])])
 
+mksharedlib="$mksharedlib $CCLINKFLAGS"
+mkexe="$mkexe $CCLINKFLAGS"
+
 AS_IF([test -z "$mkmaindll"], [mkmaindll=$mksharedlib])
 
 # Configure native dynlink