Currently, we misconfigure GCC on POSIX platforms that require the
inclusion of <libgen.h> to declare 'basename()'.

The series here does the following:
 - ensures that the libiberty configure caters for platforms that need
   <libgen.h> (it does not alter the outcome on those that also have
   basename() in libc). [PR119218]
 - ensures that the gcc/ configure matches the behaviour of
   libiberty [PS119250]
 - switches the remaining two uses of host 'basename()' to use the
   libiberty 'lbasename()'.

Despite the last change, the first two are still needed to allow the
inclusion of <libgen.h> in GCC sources (otherwise the host definition
clashes with the libiberty one).

At some stage (not proposed in this patch series) perhaps we should
just poison the host basename/dirname and require use of the libiberty
replacements.

All tested on x86_64-linux, darwin, aarch64-linux, darwin.
OK for trunk? (when?)
thanks
Iain

----

Iain Sandoe (4):
  libiberty: Append <libgen.h> to AC_CHECK_DECLS [PR119218].
  gcc, configure: When checking for basename, use the same process as
    libiberty [PR119250].
  gcc, gcov: Use 'lbasename' consistently.
  rust: Use 'lbasename()' consistently.

 gcc/config.in                             | 10 ++++++++--
 gcc/configure                             | 18 +++++++++++-------
 gcc/configure.ac                          | 12 ++++++++++--
 gcc/gcov.cc                               |  2 +-
 gcc/rust/metadata/rust-export-metadata.cc |  2 +-
 libiberty/config.in                       |  3 +++
 libiberty/configure                       | 12 +++++++++---
 libiberty/configure.ac                    |  9 +++++++--
 8 files changed, 50 insertions(+), 18 deletions(-)

-- 
2.39.2 (Apple Git-143)

Reply via email to