diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-01-12 23:34:48 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-01-12 23:34:48 +0530 |
commit | fcfc9086815bf0d277ad47a90ee3fda4c37acca8 (patch) | |
tree | 0b00baceb19165a006457ad9a65c7e6478dc3f47 /debug/Makefile | |
parent | db27f1251b008280a29d540b4f8ab2a38a0d80af (diff) | |
download | glibc-fcfc9086815bf0d277ad47a90ee3fda4c37acca8.zip glibc-fcfc9086815bf0d277ad47a90ee3fda4c37acca8.tar.gz glibc-fcfc9086815bf0d277ad47a90ee3fda4c37acca8.tar.bz2 |
debug: Synchronize feature guards in fortified functions [BZ #28746]
Some functions (e.g. stpcpy, pread64, etc.) had moved to POSIX in the
main headers as they got incorporated into the standard, but their
fortified variants remained under __USE_GNU. As a result, these
functions did not get fortified when _GNU_SOURCE was not defined.
Add test wrappers that check all functions tested in tst-chk0 at all
levels with _GNU_SOURCE undefined and then use the failures to (1)
exclude checks for _GNU_SOURCE functions in these tests and (2) Fix
feature macro guards in the fortified function headers so that they're
the same as the ones in the main headers.
This fixes BZ #28746.
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'debug/Makefile')
-rw-r--r-- | debug/Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/debug/Makefile b/debug/Makefile index 8804776..96029f3 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -132,6 +132,12 @@ define cflags-lfs CFLAGS-tst-fortify-$(1)-lfs-$(2).$(1) += -D_FILE_OFFSET_BITS=64 endef +define cflags-nongnu +CFLAGS-tst-fortify-$(1)-nongnu-$(2).$(1) += -D_LARGEFILE64_SOURCE=1 +endef + +src-chk-nongnu = \#undef _GNU_SOURCE + # We know these tests have problems with format strings, this is what # we are testing. Disable that warning. They are also testing # deprecated functions (notably gets) so disable that warning as well. @@ -145,13 +151,13 @@ CFLAGS-tst-fortify-$(1)-$(2)-$(3).$(1) += -D_FORTIFY_SOURCE=$(3) -Wno-format \ $(eval $(call cflags-$(2),$(1),$(3))) $(objpfx)tst-fortify-$(1)-$(2)-$(3).$(1): tst-fortify.c Makefile ( echo "/* Autogenerated from Makefile. */"; \ - echo ""; \ + echo "$(src-chk-$(2))"; \ echo "#include \"tst-fortify.c\"" ) > $$@.tmp mv $$@.tmp $$@ endef chk-extensions = c cc -chk-types = default lfs +chk-types = default lfs nongnu chk-levels = 1 2 3 $(foreach e,$(chk-extensions), \ |