https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118725

            Bug ID: 118725
           Summary: libcpp build failure with NLS enabled
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: judge.packham at gmail dot com
  Target Milestone: ---

We have a crosstool-ng config
(x86_64-w64-mingw32,arm-cortexa9_neon-linux-gnueabihf) that enables NLS
support. When we get to building libcpp we hit the following build failure

[ALL  ]    In file included from
/home/ctng/crosstool-ng/.build/HOST-x86_64-w64-mingw32/arm-cortexa9_neon-linux-gnueabihf/src/gcc/libcpp/identifiers.cc:26:
[ERROR]   
/home/ctng/crosstool-ng/.build/HOST-x86_64-w64-mingw32/arm-cortexa9_neon-linux-gnueabihf/buildtools/complibs-host/include/libintl.h:1089:34:
error: expected unqualified-id before 'const'
[ALL  ]     1089 | char *setlocale (int __category, const char *__locale)
[ALL  ]          |                                  ^~~~~
[ALL  ]   
/home/ctng/crosstool-ng/.build/HOST-x86_64-w64-mingw32/arm-cortexa9_neon-linux-gnueabihf/src/gcc/libcpp/system.h:275:39:
note: in definition of macro 'setlocale'
[ALL  ]      275 | # define setlocale(category, locale) (locale)
[ALL  ]          |                                       ^~~~~~

I think libcpp's configure is missing a check for setlocale so it ends up
defining a fallback setlocale macro that confuses things when it sees the
definition in libintl.h.

Reply via email to