[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hardening code during polyorb packaging



On Wed, May 16, 2012 at 02:30:49PM +0200, Xavier Grave wrote:

> A first look at the dpkg-buildflags output :
> CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
> - -Werror=format-security
> isn't really probing for Ada coding.

> Does anyone already played/experimented with this kind of options with
> Ada code ? I suspect part of it doesn't really make sense for Ada...

(control)
Build-Depends: dh-ada-library

(rules)
include /usr/share/dpkg/buildflags.mk
# (or default.mk that sets many other useful variables)
include /usr/share/ada/debian-packaging.mk

Please take a quick look at both sources, then

gnatmake $(BUILDER_OPTIONS) -gnatc -$(ADAFLAGS) -gnatl $(LDFLAGS)
(-gnatg to add gnatmake options)

You may also use a project file containing

  package Compiler is
     for Default_Switches ("Ada") use External_As_List ("ADAFLAGS", " ");
     for Default_Switches ("C") use External_As_List ("CFLAGS", " ");
  end Compiler;
  package Linker is
     for Default_Switches ("Ada") use External_As_List ("LDFLAGS", " ");
  end Linker;

but note that setting these options in the project will make gprbuild
ignore -gnatc -gnatl on the command line.


Reply to: