diff options
author | Anastasia Klimchuk <aklm@chromium.org> | 2022-11-01 14:32:51 +1100 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-11-07 01:41:15 +0000 |
commit | 0a896424abd490d1cfdd8a582ba17c25df75a0e0 (patch) | |
tree | 6e8458908dd6bac8a51b84106544f499154f1178 /dmi.c | |
parent | af76e447527da609965dff5726696b59d6873d6e (diff) | |
download | flashrom-0a896424abd490d1cfdd8a582ba17c25df75a0e0.tar.gz flashrom-0a896424abd490d1cfdd8a582ba17c25df75a0e0.tar.bz2 flashrom-0a896424abd490d1cfdd8a582ba17c25df75a0e0.zip |
tests: Undefine _FORTIFY_SOURCE for unit tests to avoid _chk variants
The option _FORTIFY_SOURCE, when enabled, can result in some functions
being expanded into _chk variants. For example, `fprintf` can get
expanded into `__fprintf_chk`. This makes sense for building a real
binary, but is not needed for unit tests.
In unit test environment all those functions are wrapped. In the
example above, both `fprintf` and `__fprintf_chk` needed to be mocked.
Disabling _FORTIFY_SOURCE avoids expanding functions into _chk
variants, without any loss of testing coverage because that would
be wrapped/mocked anyway.
This patch also removes two existing _chk wraps because they are not
needed anymore.
BUG=b:237606255
TEST=ninja test on
1) gcc 12.2.0 on Debian
2) clang 15.0 on Chromium OS
Ticket: https://ticket.coreboot.org/issues/411
Change-Id: I70cb1cd90d1f377ff4606acad3c1b514120ae4f7
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68432
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'dmi.c')
0 files changed, 0 insertions, 0 deletions