[v5,0/2] _FORTIFY_SOURCE fixes [BZ #28746]

Message ID 20220112055129.3773186-1-siddhesh@sourceware.org
Headers
Series _FORTIFY_SOURCE fixes [BZ #28746] |

Message

Siddhesh Poyarekar Jan. 12, 2022, 5:51 a.m. UTC
  The main patch is 2/2, which fixes some fortified headers to match
feature macros with their corresponding main headers, without which
functions would fail to get fortified.  Patch 1/2 is a restructuring of
the tests so that it is easier to add different configurations to
_FORTIFY_SOURCE tests at various levels.

Tested on x86_64 to confirm that there were no new regressions due to
this and that the new tests also run clean.

Changes from v1:
- Rebased against latest trunk so that the patches actually apply.
- Renamed files so that the diffs are easier to compare and also make a
  bit more sense.

Changes from v2:
- Renamed tst-chk-0.c to tst-fortify.c and autogenerate all tests and
  include it.
- Set all the flags we can as -D in CFLAGS and autogenerate test cases
  if needed.
- Fix other review comments.

Changes from v3:
- Fixed typo (chk-gen-locals -> chk-gen-locales)

Changes from v4:
- Generate test sources in $(objpfx).

Siddhesh Poyarekar (2):
  debug: Autogenerate _FORTIFY_SOURCE tests
  debug: Synchronize feature guards in fortified functions [BZ #28746]

 Makerules                           |   6 ++
 debug/Makefile                      | 115 ++++++++++++++++++----------
 debug/tst-chk2.c                    |   2 -
 debug/tst-chk3.c                    |   2 -
 debug/tst-chk4.cc                   |   1 -
 debug/tst-chk5.cc                   |   2 -
 debug/tst-chk6.cc                   |   2 -
 debug/tst-chk7.c                    |   2 -
 debug/tst-chk8.cc                   |   2 -
 debug/{tst-chk1.c => tst-fortify.c} |  49 ++++++++++--
 debug/tst-lfschk1.c                 |   2 -
 debug/tst-lfschk2.c                 |   2 -
 debug/tst-lfschk3.c                 |   2 -
 debug/tst-lfschk4.cc                |   2 -
 debug/tst-lfschk5.cc                |   2 -
 debug/tst-lfschk6.cc                |   2 -
 posix/bits/unistd.h                 |   2 +-
 string/bits/string_fortified.h      |   8 +-
 support/xsignal.h                   |   2 +
 wcsmbs/bits/wchar2.h                |   2 +-
 20 files changed, 129 insertions(+), 80 deletions(-)
 delete mode 100644 debug/tst-chk2.c
 delete mode 100644 debug/tst-chk3.c
 delete mode 100644 debug/tst-chk4.cc
 delete mode 100644 debug/tst-chk5.cc
 delete mode 100644 debug/tst-chk6.cc
 delete mode 100644 debug/tst-chk7.c
 delete mode 100644 debug/tst-chk8.cc
 rename debug/{tst-chk1.c => tst-fortify.c} (97%)
 delete mode 100644 debug/tst-lfschk1.c
 delete mode 100644 debug/tst-lfschk2.c
 delete mode 100644 debug/tst-lfschk3.c
 delete mode 100644 debug/tst-lfschk4.cc
 delete mode 100644 debug/tst-lfschk5.cc
 delete mode 100644 debug/tst-lfschk6.cc