https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119250
--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #5) > (In reply to Iain Sandoe from comment #4) > > Does anyone know why libiberty doe not install the build-time config file > > and have libiberty.h include it? > > That feels undesirable because it will clash with config.h of all the > projects using it. Well I would have expected the installed version to be renamed __libiberty_config.h or so - but that's not a problem to solve here. > Instead I'd say gcc should use the same configure test as libiberty if it > relies on libiberty to provide the fallback. That seems reasonable - but we then run into issues in the small number of places that GCC uses 'basename' - because the code assumes the signature is 'basename (const char *)'. Per grep output - it seems that most places in GCC use the libiberty 'lbasename (const char *)' variant. It would be sensible to audit the (small number of) cases using 'basename' and see if they can be moved to use 'lbasename'. That would mean that making the configuration for GCC match that of libiberty would be OK (note that in PR119218, we determine that the configuration choice needs to have some host-specific input, otherwise it will not work for Linux which declares the basename (const *) version in <string.h>).