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>
Tue, 16 Jun 2026 19:25:11 +0000 (21:25 +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 Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch

configure.ac

index 3754ad8a393c1f1e5183aacf6e2e6aa05af0aade..929b13eb85c2254eebbdb302e38a28219d109f69 100644 (file)
@@ -1450,6 +1450,10 @@ AS_CASE([$target],
     [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