Bug 2111196 - FTBFS with -Wp,-D_FORTIFY_SOURCE=3
Summary: FTBFS with -Wp,-D_FORTIFY_SOURCE=3
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: nvml
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Krzysztof Czurylo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-26 16:50 UTC by Siddhesh Poyarekar
Modified: 2022-08-09 13:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Siddhesh Poyarekar 2022-07-26 16:50:34 UTC
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

Comment 1 Ben Cotton 2022-08-09 13:23:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.


Note You need to log in before you can comment on or make changes to this bug.