Closed marxin closed 2 years ago
Well, it's not exactly an "OPTFLAG", right? Perhaps you need to patch Makefile.inc
.
I think the simplest patch would be changing -Wp,-D_FORTIFY_SOURCE=2
to -D_FORTIFY_SOURCE=2
. Then one would be able to unset it with U_FORTIFY_SOURCE
.
Sounds ok. Would you send a patch to dm-devel (cc me & bmarzins at redhat.com)?
Sure, I've just done that.
@bmarzins , FTR: the -Wp
syntax has been added by your commit 1fce669 ("multipath: Build with standard rpm cflags") a long time ago. Any idea why you were using this rather than simply -D_FORTIFY_SOURCE=2
?
Don't recall, and I have no objection to changing it.
Since it is rpm cflags, it may be because the default flags set in redhat-rpm-config
in Fedora has the flags with the -Wp
syntax. FWIW, it should be possible to unset and reset the macro with -Wp
too, e.g. with -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3
I can confirm that gcc -Wp,-D_FORTIFY_SOURCE=2 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 a.c -Werror
works, but still, I would like to have a unified approach for enabling of -D_FORTIFY_SOURCE=3
. So please accept my patch.
pushed to openSUSE/multipath-tools (queue). Will be included in next bunch of fixes.
@mwilck Please close this issue once the queue lands to master.
It turns out that the proposed patch didn't work as intended. Updated the fix for #29 to d13d154.
I'm experimenting with
-D_FORTIFY_SOURCE=3
that will be available since GCC12.1
and I see the following error:Note I pass the
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
as part ofmake OPTFLAGS=...
@siddhesh