Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3493 closed patch (an actual patch, not a request for one) (fixed)

fails to build from source with GCC hardening options

Reported by: pabs Owned by:
Priority: normal Milestone: unspecified
Component: other Version: 3.1 beta10
Keywords: Cc:
Blocked By: Blocking:
Operating System: All/Non-Specific

Description (last modified by dak180)

The attached patch fixes building from source while enabling the GCC hardening options:

CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"
CXXFLAGS="-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"
LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now"

This is how Debian enables these options (other distros turn them on by default in GCC):

https://wiki.debian.org/Hardening

Attachments (1)

fix-FTBFS-with-hardening-flags.patch (1.9 KB) - added by pabs 11 years ago.
fix FTBFS with GCC hardening options

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by dak180

  • Description modified (diff)

comment:2 Changed 11 years ago by Cyp

I could not apply this patch, as lib/script/script_parser.cpp and src/scriptvals_parser.cpp are autogenerated (and appear in my out-of-main-tree build/ directory).

I have no idea how to apply the patch to the original lib/script/script_parser.ypp and src/scriptvals_parser.ypp files, as the relevant part of the code seems to be just a "%%" in the .ypp files.

Changed 11 years ago by pabs

fix FTBFS with GCC hardening options

comment:3 Changed 11 years ago by pabs

Added an updated patch that doesn't patch the generated code (why is it in tarball?). Based on this bug report yyerror (or equivalent) should not be marked with the format attribute:

http://bugs.debian.org/648765

comment:4 Changed 11 years ago by Paul Wise

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.