[0/4] Fix i386 build with --enable-fortify-source

Message ID 20230725151641.923083-1-adhemerval.zanella@linaro.org
Headers
Series Fix i386 build with --enable-fortify-source |

Message

Adhemerval Zanella Netto July 25, 2023, 3:16 p.m. UTC
  Building i686-linux-gnu with --enable-fortify=1,2,3 on gcc from 6
to 13 triggers some issues:

  - gcc 6 issues an warning building string/tester.c where strncat
    fortify builtin might overflow the destination buffer.

  - gcc 12 and 13 with --enable-fortify=3 uncovered an issue with
    static linking, where multiple internal chk symbols for memcpy,
    memmove, and mempcpy are being provided.

A clean build/check for gcc 6 requires my previous set [1].  With
both applied I see to build/check regression for all supported
--enable-fortify with all supported gcc on i686-linux-gnu.

[1] https://patchwork.sourceware.org/project/glibc/list/?series=22751.


Adhemerval Zanella (4):
  i386: Fix build with --enable-fortify=3
  i386: Remove memset_chk-nonshared.S
  linux: Fix i686 with gcc6
  string: Fix tester build with fortify enable with gcc 6

 string/tester.c                               |  9 ++++++++
 sysdeps/i386/i686/memset.S                    |  2 +-
 sysdeps/i386/i686/multiarch/Makefile          |  5 -----
 .../i686/multiarch/memcpy_chk-nonshared.S     | 21 -------------------
 .../i686/multiarch/memmove_chk-nonshared.S    | 21 -------------------
 .../i686/multiarch/mempcpy_chk-nonshared.S    | 21 -------------------
 sysdeps/i386/i686/multiarch/memset-ia32.S     |  9 ++++----
 .../i686/multiarch/memset_chk-nonshared.S     | 21 -------------------
 .../unix/sysv/linux/convert_scm_timestamps.c  |  9 ++++++++
 9 files changed, 24 insertions(+), 94 deletions(-)
 delete mode 100644 sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S
 delete mode 100644 sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memset_chk-nonshared.S