andestech / nds-gnu-toolchain

GNU toolchain for AndesCore
Other
21 stars 16 forks source link

Gdb build error on Mac #10

Open jacklee-5 opened 3 months ago

jacklee-5 commented 3 months ago

Hello,

I tried to build gdb on Mac M1, but I failed with this error in gcc-14. It seems that gnulib/import/sys_select.in.h needs to be modified ,but I am not sure.

Could you give any advices for this?

In file included from /Volumes/code/nds-gnu-toolchain/gdb/gdb/../gdbsupport/common-defs.h:86,
                 from /Volumes/code/nds-gnu-toolchain/gdb/gdb/defs.h:28,
                 from /Volumes/code/nds-gnu-toolchain/gdb/gdb/unittests/string_view-selftests.c:26:
../gnulib/import/sys/select.h:797:1: error: conflicting declaration of 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)' with 'C' linkage
  797 | _GL_CXXALIASWARN (select);
      | ^~~~~~~~~~~~~~~~
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/time.h:202,
                 from ../gnulib/import/sys/time.h:39,
                 from ../gnulib/import/sys/select.h:89,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/unistd.h:639,
                 from ../gnulib/import/unistd.h:40,
                 from ../gnulib/import/stdlib.h:100,
                 from /Volumes/code/nds-gnu-toolchain/gdb/gdb/../gdbsupport/common-defs.h:91:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/_select.h:43:10: note: previous declaration with 'C++' linkage
   43 | int      select(int, fd_set * __restrict, fd_set * __restrict,
      |          ^~~~~~