#1105147 tboot: FTBFS if _FORTIFY_SOURCE is defined in buildflags

Package:
src:tboot
Source:
src:tboot
Submitter:
Sudip Mukherjee
Date:
2025-05-12 09:39:03 UTC
Severity:
normal
Tags:
#1105147#5
Date:
2025-05-12 09:38:16 UTC
From:
To:
Dear Maintainer,

tboot is failing to build in Ubuntu with the error:

<command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]

This is because tboot source adds -D_FORTIFY_SOURCE=2 while building, and
Ubuntu is adding -D_FORTIFY_SOURCE=3 to the buildflags and so a redefinition.

The problem is not seen in Debian as Debian also builds with -D_FORTIFY_SOURCE=2

The attched patch is going to fix the problem, it will check if -D_FORTIFY_SOURCE
is in the CFLAGLS or CPPFLGS or not and will -D_FORTIFY_SOURCE=2 if its not present.

It will be really appreciated if the patch can be added.
Thanks in advance.