iains / gcc-darwin-arm64

GCC master branch for Darwin with experimental support for Arm64. Currently GCC-15.0.0 [September 2024]
GNU General Public License v2.0
268 stars 33 forks source link

Failure with " conflicting declaration of C function 'const char* strsignal(int)'" #111

Closed EtherealRise closed 1 year ago

EtherealRise commented 1 year ago

The configuration is simply:

../gcc/configure --prefix=$(pwd)/../gcc-install --enable-languages=c,c++

However it quickly failed with:

❯ make -j1
g++ -c   -g   -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -I. -Ibuild -I../gcc -I../gcc/build -I../gcc/../include  -I../gcc/../libcpp/include  \
        -o build/genmodes.o ../gcc/genmodes.cc
In file included from ./bconfig.h:3,
                 from ../gcc/genmodes.cc:20:
./auto-host.h:2650:16: error: declaration does not declare anything [-fpermissive]
 2650 | #define rlim_t long
      |                ^~~~
In file included from ../gcc/genmodes.cc:21:
../gcc/system.h:556:20: **error: conflicting declaration of C function 'const char* strsignal(int)'**
  556 | extern const char *strsignal (int);
      |                    ^~~~~~~~~
In file included from /opt/homebrew/Cellar/gcc@12/12.3.0/include/c++/12/cstring:42,
                 from ../gcc/system.h:241:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/string.h:134:10: note: previous declaration 'char* strsignal(int)'
  134 | char    *strsignal(int __sig);
      |          ^~~~~~~~~
make: *** [build/genmodes.o] Error 1

I'm not sure if it's platform related, gcc version is:

❯ gcc --version
gcc (Homebrew GCC 12.3.0) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

installed with homebrew.

EtherealRise commented 1 year ago

I tried simply comment those lines, but the building process still failed with:

=> make -j1
g++ -c   -g   -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -I. -Ibuild -I../gcc -I../gcc/build -I../gcc/../include  -I../gcc/../libcpp/include  \
        -o build/genmodes.o ../gcc/genmodes.cc
make: *** No rule to make target `../build-aarch64-apple-darwin22.3.0/libiberty/libiberty.a', needed by `build/genmodes'.  Stop.
iains commented 1 year ago

Which GCC sources are you trying to build? On which version of macOS? and for which architecture? thanks.

EtherealRise commented 1 year ago

Thanks for you quickly response, I'm using your repo latest version. My macos is 13.2.1 (M1 pro chip).

EtherealRise commented 1 year ago

I have figured out that I'm using gcc/configure not SRC/configure, silly mistake, sorry for the noisy.