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>
Mon, 27 Jan 2025 12:17:46 +0000 (13:17 +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: <2021-12-21>

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

configure.ac

index 64e6d7e160063c908119db68b1fd053e114a91e8..4d94dc6c128350b12c080611640c1644f7fd3ca4 100644 (file)
@@ -1353,6 +1353,10 @@ AS_CASE([$host],
     [oc_ldflags="$oc_ldflags -Wl,-z,nobtcfi"
      natdynlinkopts="$natdynlinkopts -Wl,-z,nobtcfi"])
 
+# Use CCLINKFLAGS for linking all executables and shared libraries
+
+mksharedlib="$mksharedlib $CCLINKFLAGS"
+mkexe="$mkexe $CCLINKFLAGS"
 
 # Configure native dynlink