Description of problem: Building with _FORTIFY_SOURCE=3 does not work with nvml because it does not seem to clear the previous _FORTIFY_SOURCE definition correctly. Ideally, it should clear and redefine only if _FORTIFY_SOURCE has been defined to a lower level because otherwise it ends up lowering the level of protection. How reproducible: Always Steps to Reproduce: 1. Change _FORTIFY_SOURCE value in %_preprocessor_defines in /usr/lib/rpm/redhat/macros to 3. 2. Build the nvml package Actual results: Full log here: https://download.copr.fedorainfracloud.org/results/siddhesh/mpb.1/fedora-rawhide-x86_64/04659390-nvml/builder-live.log.gz gcc -MD -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DUSE_RPMEM -std=gnu99 -Wall -Werror -Wmissing-prototypes -Wpointer-arith -Wsign-conversion -Wsign-compare -Wconversion -fno-common -DSRCVERSION='"1.12.0"' -DSDS_ENABLED -Wunused-macros -Wmissing-field-initializers -Wfloat-equal -Wswitch-default -Wcast-function-type -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I../../../src/../src/common -I../../../src/../src/core -I../../../src/../src/core -I../../../src/../src/common -I../../../src/../src/libpmemlog -I../../../src/../src/libpmemblk -I../../../src/../src/libpmemobj -I../../../src/../src/tools/pmempool -D__USE_UNIX98 -I../../../src/../src/common -I../../../src/../src/rpmem_common -I../../../src/../src/libpmem2 -I../../../src/../src/librpmem -I../../../src/../src/libpmemlog -I../../../src/../src/libpmemblk -I../../../src/../src/libpmemobj -I. -I../../../src/../src/include -c -o pmempool.o pmempool.c <command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror] <command-line>: note: this is the location of the previous definition cc1: all warnings being treated as errors
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle. Changing version to 37.