iains / gcc-14-branch

GCC 14 for Darwin with experimental Arm64 support. Current release 14.2-darwin-r2 [October 2024]
GNU General Public License v2.0
11 stars 3 forks source link

Build failure on 10.4: `gthr-default.h:65:31: error: 'PTHREAD_RWLOCK_INITIALIZER' undeclared here (not in a function); did you mean 'PTHREAD_COND_INITIALIZER'?` #15

Open barracuda156 opened 5 days ago

barracuda156 commented 5 days ago

It has been reported that gcc 14.2.0 fails to build on Tiger: https://github.com/macports/macports-ports/pull/26655#issuecomment-2496000936

:info:build In file included from /opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/gcc-14.2.0/libgfortran/../libgcc/gthr.h:157,
:info:build                  from /opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/gcc-14.2.0/libgfortran/io/io.h:33,
:info:build                  from /opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/gcc-14.2.0/libgfortran/io/unit.c:26:
:info:build ../libgcc/gthr-default.h:65:31: error: 'PTHREAD_RWLOCK_INITIALIZER' undeclared here (not in a function); did you mean 'PTHREAD_COND_INITIALIZER'?
:info:build    65 | #define __GTHREAD_RWLOCK_INIT PTHREAD_RWLOCK_INITIALIZER
:info:build       |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/gcc-14.2.0/libgfortran/io/unit.c:107:34: note: in expansion of macro '__GTHREAD_RWLOCK_INIT'
:info:build   107 | __gthread_rwlock_t unit_rwlock = __GTHREAD_RWLOCK_INIT;
:info:build       |                                  ^~~~~~~~~~~~~~~~~~~~~
:info:build make[3]: *** [io/unit.lo] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/build/powerpc-apple-darwin8/libgfortran'
:info:build make[2]: *** [all] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/build/powerpc-apple-darwin8/libgfortran'
:info:build make[1]: *** [all-target-libgfortran] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/build'
:info:build make: *** [bootstrap-lean] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_Users_andersjenbo_macports-ports_lang_gcc14/libgcc14/work/build" && /usr/bin/make -w bootstrap-lean 
:info:build Exit code: 2
:error:build Failed to build libgcc14: command execution failed
:debug:build Error code: CHILDSTATUS 23317 2

Since apparently there are still a lot of users favoring 10.4 over 10.5–10.6, is it possible to fix this?

AJenbo commented 4 days ago

It's not like 10.5 or 10.6 are even options for me. 10.4 is the end of the line for some systems.