configure: Raise FORTIFY_SOURCE level to 3#642
configure: Raise FORTIFY_SOURCE level to 3#642michaelrsweet merged 1 commit intoOpenPrinting:masterfrom
Conversation
michaelrsweet
left a comment
There was a problem hiding this comment.
Need to test whether level 3 works before using it.
|
FWIW, macOS would allow a value of 3 but doesn't do anything different from 2. |
|
Info about what level 3 does is here I'm not sure whether the CI infrastructure supports level 3 - have you run: on a system that supports it? |
|
Ok, interesting - if I use Adding -fPIC into CFLAGS fixes it (on contrary to the message)... but in cups-sharedlibs.m4 we set PICFLAG to 0 if Either way, the compilation goes fine here - I have Fedora 38, where all packages should be built with -D_FORTIFY_SOURCE=3, so gcc supports it and if I build our current master here with the flag, tests pass. |
config-scripts/cups-compiler.m4
Outdated
There was a problem hiding this comment.
Would it be possible to look for presence of _FORTIFY_SOURCE in the flags and then skipping addition if it's already present? That way the flag won't end up overriding distribution flags.
65fda3c to
c7dd5aa
Compare
If _FORTIFY_SOURCE is not defined in flags, use its level 3. Backported from libcups.
|
Total size with _FORTIFY_SOURCE=3 = 14 634 920 Time consumption: _FORTIFY_SOURCE=2: So the tests are slightly slower and object files bigger on Fedora 39 with _FORTIFY_SOURCE=3, but IMO it is within acceptable limits. |
GCC supports level 3 for some time, try using it.