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...
# (or default.mk that sets many other useful variables)
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", " ");
package Linker is
for Default_Switches ("Ada") use External_As_List ("LDFLAGS", " ");
but note that setting these options in the project will make gprbuild
ignore -gnatc -gnatl on the command line.