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: <2015-07-15>
Gbp-Pq: Name 0013-Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch
Stephane Glondu [Sun, 16 Aug 2015 18:59:14 +0000 (20:59 +0200)]
Add a .file directive to generated .s files
When no .file directive is given, the toolchain records the filename
of the .o file, which is sometimes random, making generated objects
non-deterministic.
We use Location.input_name for adding .file directives to assembly
files. Note: when the file is preprocessed, this reference holds the
name of the temporary file. Hence, files compiled with -pp are still
not deterministic.
This patch fixes non-strippability of bytecode executables linked with
custom runtime. The new behaviour is enabled when OCAML_CUSTOM_EMBED
is set to "y", or when DEB_HOST_ARCH is non-empty.
Avoid multiple declarations in generated .c files in -output-obj
In -output-obj mode, <caml/mlvalues.h> (which contains some
primitives) is included in the generated .c file, leading to errors
when compiling with g++ (multiple declarations).
There are probably better implementations (in particular, in this one,
care must be taken when changing the list of primitives available in
mlvalues.h), but this is a small and (not too) intrusive patch.
Bug: http://caml.inria.fr/mantis/view.php?id=5254 Signed-off-by: Stephane Glondu <steph@glondu.net>
Gbp-Pq: Name 0005-Avoid-multiple-declarations-in-generated-.c-files-in.patch
[changes brought forward from 4.01.0-5+rpi1 by Peter Michael Green <plugwash@raspbian.org> at Sat, 24 Jan 2015 10:29:46 +0000]
* Add logic in debian/rules to detect raspbian and give the upstream
configure script the correct instructions.