diff --git a/_resources/port1.0/compilers/gcc_compilers.tcl b/_resources/port1.0/compilers/gcc_compilers.tcl index c5424fb9b7453..be0896521e76e 100644 --- a/_resources/port1.0/compilers/gcc_compilers.tcl +++ b/_resources/port1.0/compilers/gcc_compilers.tcl @@ -3,12 +3,19 @@ # https://trac.macports.org/ticket/57135 # https://trac.macports.org/ticket/61636 -# GCC 10 and above on OSX10.6+ +# GCC 14 on all systems +lappend compilers macports-gcc-14 + +# GCC 11 to GCC 13 on OSX10.6+ if {${os.major} >= 10 || [option os.platform] ne "darwin"} { - lappend compilers macports-gcc-14 macports-gcc-13 macports-gcc-12 macports-gcc-11 macports-gcc-10 + lappend compilers macports-gcc-13 macports-gcc-12 macports-gcc-11 } -# GCC 9 and older only on OSX10.10 and older +# GCC 10 on all systems +lappend compilers macports-gcc-10 + +# GCC 8 and 9 and older on OSX 10.6 to 10.10 +# GCC 7 or older on OSX 10.6 or older # https://trac.macports.org/ticket/65472 if {${os.major} < 15} { if {${os.major} >= 10} { diff --git a/_resources/port1.0/compilers/gcc_dependencies.tcl b/_resources/port1.0/compilers/gcc_dependencies.tcl index 4a0df814e8b28..950b1bccc50a9 100644 --- a/_resources/port1.0/compilers/gcc_dependencies.tcl +++ b/_resources/port1.0/compilers/gcc_dependencies.tcl @@ -2,11 +2,7 @@ # GCC version providing the primary runtime # Note settings here *must* match those in the lang/libgcc port and compilers PG -if {[option os.platform] eq "darwin" && [option os.major] < 10} { - set gcc_main_version 7 -} else { - set gcc_main_version 14 -} +set gcc_main_version 14 # compiler links against libraries in libgcc\d* and/or libgcc-devel if {[vercmp ${gcc_version} 4.6] < 0} { diff --git a/_resources/port1.0/group/R-1.0.tcl b/_resources/port1.0/group/R-1.0.tcl index a1e4343ac40c1..c74ee65ad949b 100644 --- a/_resources/port1.0/group/R-1.0.tcl +++ b/_resources/port1.0/group/R-1.0.tcl @@ -112,7 +112,7 @@ if { ${os.major} > 23 } { # Similarly, for gcc select the gcc13 variant of the compilers PG. # This setting should also be kept in sync with that in the R Port. # Updates should be coordinated with the R maintainers. -if { ${os.major} > 23 } { +if { ${os.major} < 10 || ${os.major} > 23 } { # https://trac.macports.org/ticket/70799 compiler.blacklist-append {macports-gcc-1[5-9]} } else { @@ -120,16 +120,11 @@ if { ${os.major} > 23 } { } # NOTE: upon the update to gcc14, please update the blacklist accordingly, # like it is done for clangs. We would prefer using the same version of gcc and gfortran. -if {${os.platform} eq "darwin" && ${os.major} < 10} { - # Until old platforms are switched to the new libgcc. - default_variants-append +gcc7 +if { ${os.major} < 10 || ${os.major} > 23 } { + # https://trac.macports.org/ticket/70799 + default_variants-append +gcc14 } else { - if { ${os.major} > 23 } { - # https://trac.macports.org/ticket/70799 - default_variants-append +gcc14 - } else { - default_variants-append +gcc13 - } + default_variants-append +gcc13 } # R bakes in the compiler, so if it is built with ccache, diff --git a/_resources/port1.0/group/compilers-1.0.tcl b/_resources/port1.0/group/compilers-1.0.tcl index ef203714a8b9b..6a8a7f87ef901 100644 --- a/_resources/port1.0/group/compilers-1.0.tcl +++ b/_resources/port1.0/group/compilers-1.0.tcl @@ -81,12 +81,7 @@ options compilers.add_gcc_rpath_support default compilers.add_gcc_rpath_support yes # Set a default gcc version -if {${os.major} < 10 && ${os.platform} eq "darwin" } { - # see https://trac.macports.org/ticket/57135 - set compilers.gcc_default gcc7 -} else { - set compilers.gcc_default gcc14 -} +set compilers.gcc_default gcc14 set compilers.list {cc cxx cpp objc fc f77 f90} @@ -107,16 +102,14 @@ if { ${os.arch} eq "arm" || ${os.platform} ne "darwin" } { if { [vercmp ${xcodeversion} < 16.0] && [vercmp ${xcodecltversion} < 16.0] } { lappend gcc_versions 10 11 12 13 } - lappend gcc_versions 14 devel } + lappend gcc_versions 14 devel } + # GCC version providing the primary runtime # Note settings here *must* match those in the lang/libgcc port. -if { ${os.major} < 10 && ${os.platform} eq "darwin" } { - set gcc_main_version 7 -} else { - set gcc_main_version 14 -} +set gcc_main_version 14 + ui_debug "GCC versions for Darwin ${os.major} ${os.arch} - ${gcc_versions}" foreach ver ${gcc_versions} { # Remove dot from version if present diff --git a/lang/gcc-devel/Portfile b/lang/gcc-devel/Portfile index ba688f8543618..58791f0d2788e 100644 --- a/lang/gcc-devel/Portfile +++ b/lang/gcc-devel/Portfile @@ -358,11 +358,7 @@ proc dylib_list {location} { if {${subport} eq ${libgccname}} { # Set conflict against port providing primary runtime - if { ${os.major} < 10 } { - conflicts libgcc libgcc7 - } else { - conflicts libgcc libgcc12 - } + conflicts libgcc libgcc14 # http://trac.macports.org/ticket/35770 # http://trac.macports.org/ticket/38814 diff --git a/lang/gcc10/Portfile b/lang/gcc10/Portfile index de70ab3c3f236..35fd1fc4904fe 100644 --- a/lang/gcc10/Portfile +++ b/lang/gcc10/Portfile @@ -12,7 +12,7 @@ name gcc10 version 10.4.0 revision 5 -platforms {darwin >= 10 < 22} +platforms {darwin < 22} categories lang maintainers nomaintainer # an exception in the license allows dependents to not be GPL diff --git a/lang/gcc14/Portfile b/lang/gcc14/Portfile index bff40716a54e3..892180d0f7503 100644 --- a/lang/gcc14/Portfile +++ b/lang/gcc14/Portfile @@ -12,7 +12,6 @@ name gcc${gcc_major_v} homepage https://gcc.gnu.org/ -platforms {darwin >= 10} categories lang maintainers nomaintainer # an exception in the license allows dependents to not be GPL @@ -69,6 +68,17 @@ depends_lib-append port:cctools \ depends_run-append port:gcc_select \ path:share/doc/libgcc/README:libgcc +platform darwin { + if {(${configure.build_arch} in [list ppc ppc64]) || ${os.major} < 10} { + configure.compiler.add_deps \ + no + depends_build-append \ + port:gcc10-bootstrap + configure.cc ${prefix}/libexec/gcc10-bootstrap/bin/gcc + configure.cxx ${prefix}/libexec/gcc10-bootstrap/bin/g++ + } +} + depends_skip_archcheck-append gcc_select ld64 cctools license_noconflict gmp mpfr ppl libmpc zlib @@ -177,6 +187,7 @@ if { ${os.platform} eq "darwin" } { # Patch generated from https://github.com/iains/gcc-14-branch # git diff --no-prefix releases/gcc-14.2.0 gcc-14.2-darwin-r1 patchfiles-append patch-darwin-gcc-${version}.diff + # GCC fixinc work-around for sys/ucred.h on OSX10.14.4 no longer seems to work ??? if { ${os.major} == 18 } { patchfiles-append patch-OSX10.14-ucred-atomic-define.diff @@ -193,6 +204,14 @@ if { ${os.platform} eq "darwin" } { 0002-libgcc-Darwin-Drop-the-legacy-library-build-for-macO.patch \ 0003-libgcc-Darwin-Don-t-build-legacy-libgcc_s.1-on-macOS.patch } + + # This patch has been merged upstream in https://github.com/gcc-mirror/gcc/commit/1cfe4a4d0d4447b364815d5e5c889deb2e533669 + # Remove it when upgrading gcc to a version that has it. + patchfiles-append darwin-ppc-fpu.patch + + if { ${os.major} == 8 } { + patchfiles-append darwin8-define-PTHREAD_RWLOCK_INITIALIZER.patch + } } # Since GCC 7.4.0, during configure, it detects features supported by target-as. @@ -389,6 +408,14 @@ if {${subport} eq ${libgccname}} { # Activate hack for new libgcc # https://trac.macports.org/wiki/PortfileRecipes#deactivatehack pre-activate { + if {![catch {set installed [lindex [registry_active libgcc7] 0]}]} { + # Extract the epoch of the installed libgcc7 + set _epoch [lindex $installed 5] + # If < 4 need to deactivate + if {[vercmp $_epoch < 4]} { + registry_deactivate_composite libgcc7 "" [list ports_nodepcheck 1] + } + } if {![catch {set installed [lindex [registry_active libgcc8] 0]}]} { # Extract the epoch of the installed libgcc8 set _epoch [lindex $installed 5] diff --git a/lang/gcc14/files/darwin-ppc-fpu.patch b/lang/gcc14/files/darwin-ppc-fpu.patch new file mode 100644 index 0000000000000..e31ac16585a48 --- /dev/null +++ b/lang/gcc14/files/darwin-ppc-fpu.patch @@ -0,0 +1,460 @@ +From 1cfe4a4d0d4447b364815d5e5c889deb2e533669 Mon Sep 17 00:00:00 2001 +From: Sergey Fedorov +Date: Sun, 18 Aug 2024 18:52:51 +0200 +Subject: [PATCH] libgfortran: implement fpu-macppc for Darwin, support IEEE + arithmetic + +This allows to build and use IEEE modules on Darwin PowerPC. + +libgfortran/ChangeLog: + + * config/fpu-macppc.h (new file): initial support for powerpc-darwin. + * configure.host: enable ieee_support for powerpc-darwin case, + set fpu_host='fpu-macppc'. + +Signed-off-by: Sergey Fedorov +--- + libgfortran/config/fpu-macppc.h | 413 ++++++++++++++++++++++++++++++++ + libgfortran/configure.host | 9 + + 2 files changed, 422 insertions(+) + create mode 100644 libgfortran/config/fpu-macppc.h + +diff --git libgfortran/config/fpu-macppc.h libgfortran/config/fpu-macppc.h +new file mode 100644 +index 0000000000000..cbffa01e0bba9 +--- /dev/null ++++ libgfortran/config/fpu-macppc.h +@@ -0,0 +1,413 @@ ++/* FPU-related code for PowerPC. ++ Copyright (C) 2023-2024 Free Software Foundation, Inc. ++ Contributed by Sergey Fedorov ++ ++This file is part of the GNU Fortran runtime library (libgfortran). ++ ++Libgfortran is free software; you can redistribute it and/or ++modify it under the terms of the GNU General Public ++License as published by the Free Software Foundation; either ++version 3 of the License, or (at your option) any later version. ++ ++Libgfortran is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++the GNU General Public License for more details. ++ ++Under Section 7 of GPL version 3, you are granted additional ++permissions described in the GCC Runtime Library Exception, version 3.1, ++as published by the Free Software Foundation. ++ ++You should have received a copy of the GNU General Public License and ++a copy of the GCC Runtime Library Exception along with this program; ++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++. */ ++ ++/* While some of the definitions and functions used here are available ++ with Apple libm, we on purpose avoid pulling it in: to avoid potential ++ conflicts and not self-impose unnecessary constraints. */ ++ ++/* FP exception flags */ ++#define FE_INEXACT 0x02000000 ++#define FE_DIVBYZERO 0x04000000 ++#define FE_UNDERFLOW 0x08000000 ++#define FE_OVERFLOW 0x10000000 ++#define FE_INVALID 0x20000000 ++ ++#define FE_ALL_EXCEPT 0x3E000000 ++#define FE_NO_EXCEPT 0xC1FFFFFF ++ ++/* Extra invalid flags */ ++#define FE_INVALID_SNAN 0x01000000 ++#define FE_INVALID_ISI 0x00800000 ++#define FE_INVALID_IDI 0x00400000 ++#define FE_INVALID_ZDZ 0x00200000 ++#define FE_INVALID_IMZ 0x00100000 ++#define FE_INVALID_XVC 0x00080000 ++#define FE_INVALID_SOFT 0x00000400 ++#define FE_INVALID_SQRT 0x00000200 ++#define FE_INVALID_CVI 0x00000100 ++ ++/* Rounding modes */ ++#define FE_TONEAREST 0x00000000 ++#define FE_TOWARDZERO 0x00000001 ++#define FE_UPWARD 0x00000002 ++#define FE_DOWNWARD 0x00000003 ++ ++/* There is no consistency re what is to be included in all_invalid. ++ Apple libm has 0x01f80300, Openlibm/FreeBSD/NetBSD has 0x21f80700 ++ and OpenBSD has 0x01f80700. In particular, FE_INVALID_SOFT and ++ FE_INVALID are contested. */ ++#define FE_ALL_INVALID 0x01F80300 ++#define FE_NO_INVALID 0xFE07FCFF ++ ++#define FE_ALL_FLAGS 0xFFF80300 ++#define FE_NO_FLAGS 0x0007FCFF ++ ++#define FE_ALL_RND 0x00000003 ++#define FE_NO_RND 0xFFFFFFFC ++ ++/* Floating-point exception summary (FX) bit. */ ++#define FE_SET_FX 0x80000000 ++#define FE_CLR_FX 0x7FFFFFFF ++ ++/* Some implementations use FE_INVALID_SOFT here. */ ++#define SET_INVALID 0x01000000 ++ ++#define FE_EXCEPT_SHIFT 22 ++#define EXCEPT_MASK FE_ALL_EXCEPT >> FE_EXCEPT_SHIFT ++ ++typedef unsigned int fenv_t; ++typedef unsigned int fexcept_t; ++ ++/* default environment object */ ++extern const fenv_t _FE_DFL_ENV; ++/* pointer to default environment */ ++#define FE_DFL_ENV &_FE_DFL_ENV ++ ++typedef union { ++ struct { ++ unsigned int hi; ++ fenv_t lo; ++ } i; ++ double d; ++} hexdouble; ++ ++#define HEXDOUBLE(hi, lo) {{ hi, lo }} ++ ++ ++/* Check we can actually store the FPU state in the allocated size. */ ++_Static_assert (sizeof(fenv_t) <= (size_t) GFC_FPE_STATE_BUFFER_SIZE, ++ "GFC_FPE_STATE_BUFFER_SIZE is too small"); ++ ++ ++static inline int fegetexcept(void) ++{ ++ hexdouble fe; ++ ++ fe.d = __builtin_mffs(); ++ return ((fe.i.lo & EXCEPT_MASK) << FE_EXCEPT_SHIFT); ++} ++ ++static inline int feclearexcept(int excepts) ++{ ++ hexdouble fe; ++ ++ if (excepts & FE_INVALID) ++ excepts |= FE_ALL_INVALID; ++ fe.d = __builtin_mffs(); ++ fe.i.lo &= ~excepts; ++ if ((fe.i.lo & FE_ALL_EXCEPT) == 0) ++ fe.i.lo &= FE_CLR_FX; ++ __builtin_mtfsf(0xFF, fe.d); ++ return 0; ++} ++ ++/* It is not possible to set VX bit directly. */ ++static inline int feraiseexcept(int excepts) ++{ ++ hexdouble fe; ++ ++ if (excepts & FE_INVALID) ++ excepts |= SET_INVALID; ++ fe.d = __builtin_mffs(); ++ fe.i.lo |= excepts; ++ __builtin_mtfsf(0xFF, fe.d); ++ return 0; ++} ++ ++static inline int fetestexcept(int excepts) ++{ ++ hexdouble fe; ++ ++ excepts &= FE_ALL_EXCEPT; ++ fe.d = __builtin_mffs(); ++ return (fe.i.lo & (excepts & FE_ALL_EXCEPT)); ++} ++ ++static inline int feenableexcept(int mask) ++{ ++ hexdouble fe; ++ fenv_t oldmask; ++ ++ fe.d = __builtin_mffs(); ++ oldmask = fe.i.lo; ++ fe.i.lo |= (mask & FE_ALL_EXCEPT) >> FE_EXCEPT_SHIFT; ++ __builtin_mtfsf(0xFF, fe.d); ++ return ((oldmask & EXCEPT_MASK) << FE_EXCEPT_SHIFT); ++} ++ ++static inline int fedisableexcept(int mask) ++{ ++ hexdouble fe; ++ fenv_t oldmask; ++ ++ fe.d = __builtin_mffs(); ++ oldmask = fe.i.lo; ++ fe.i.lo &= ~((mask & FE_ALL_EXCEPT) >> FE_EXCEPT_SHIFT); ++ __builtin_mtfsf(0xFF, fe.d); ++ return ((oldmask & EXCEPT_MASK) << FE_EXCEPT_SHIFT); ++} ++ ++static inline int fegetround(void) ++{ ++ hexdouble fe; ++ ++ fe.d = __builtin_mffs(); ++ return (fe.i.lo & FE_ALL_RND); ++} ++ ++static inline int fesetround(int round) ++{ ++ hexdouble fe; ++ ++ if (round & FE_NO_RND) ++ return (-1); ++ fe.d = __builtin_mffs(); ++ fe.i.lo = (fe.i.lo & FE_NO_RND) | round; ++ __builtin_mtfsf(0xFF, fe.d); ++ return 0; ++} ++ ++static inline int fegetenv(fenv_t *envp) ++{ ++ hexdouble fe; ++ ++ fe.d = __builtin_mffs(); ++ *envp = fe.i.lo; ++ return 0; ++} ++ ++static inline int fesetenv(const fenv_t *envp) ++{ ++ hexdouble fe; ++ ++ fe.i.lo = *envp; ++ __builtin_mtfsf(0xFF, fe.d); ++ return 0; ++} ++ ++ ++int get_fpu_trap_exceptions (void) ++{ ++ int exceptions = fegetexcept(); ++ int res = 0; ++ ++ if (exceptions & FE_INVALID) res |= GFC_FPE_INVALID; ++ if (exceptions & FE_DIVBYZERO) res |= GFC_FPE_ZERO; ++ if (exceptions & FE_OVERFLOW) res |= GFC_FPE_OVERFLOW; ++ if (exceptions & FE_UNDERFLOW) res |= GFC_FPE_UNDERFLOW; ++ if (exceptions & FE_INEXACT) res |= GFC_FPE_INEXACT; ++ ++ return res; ++} ++ ++void set_fpu (void) ++{ ++ if (options.fpe & GFC_FPE_DENORMAL) ++ estr_write ("Fortran runtime warning: Floating point 'denormal operand' " ++ "exception not supported.\n"); ++ ++ set_fpu_trap_exceptions (options.fpe, 0); ++} ++ ++void set_fpu_trap_exceptions (int trap, int notrap) ++{ ++ unsigned int mode_set = 0, mode_clr = 0; ++ ++ if (trap & GFC_FPE_INVALID) ++ mode_set |= FE_INVALID; ++ if (notrap & GFC_FPE_INVALID) ++ mode_clr |= FE_INVALID; ++ ++ if (trap & GFC_FPE_ZERO) ++ mode_set |= FE_DIVBYZERO; ++ if (notrap & GFC_FPE_ZERO) ++ mode_clr |= FE_DIVBYZERO; ++ ++ if (trap & GFC_FPE_OVERFLOW) ++ mode_set |= FE_OVERFLOW; ++ if (notrap & GFC_FPE_OVERFLOW) ++ mode_clr |= FE_OVERFLOW; ++ ++ if (trap & GFC_FPE_UNDERFLOW) ++ mode_set |= FE_UNDERFLOW; ++ if (notrap & GFC_FPE_UNDERFLOW) ++ mode_clr |= FE_UNDERFLOW; ++ ++ if (trap & GFC_FPE_INEXACT) ++ mode_set |= FE_INEXACT; ++ if (notrap & GFC_FPE_INEXACT) ++ mode_clr |= FE_INEXACT; ++ ++ /* Clear stalled exception flags. */ ++ feclearexcept (FE_ALL_EXCEPT); ++ ++ feenableexcept (mode_set); ++ fedisableexcept (mode_clr); ++} ++ ++int get_fpu_except_flags (void) ++{ ++ int result, set_excepts; ++ result = 0; ++ set_excepts = fetestexcept (FE_ALL_EXCEPT); ++ ++ if (set_excepts & FE_INVALID) ++ result |= GFC_FPE_INVALID; ++ if (set_excepts & FE_DIVBYZERO) ++ result |= GFC_FPE_ZERO; ++ if (set_excepts & FE_OVERFLOW) ++ result |= GFC_FPE_OVERFLOW; ++ if (set_excepts & FE_UNDERFLOW) ++ result |= GFC_FPE_UNDERFLOW; ++ if (set_excepts & FE_INEXACT) ++ result |= GFC_FPE_INEXACT; ++ ++ return result; ++} ++ ++void set_fpu_except_flags (int set, int clear) ++{ ++ unsigned int exc_set = 0, exc_clr = 0; ++ ++ if (set & GFC_FPE_INVALID) ++ exc_set |= FE_INVALID; ++ else if (clear & GFC_FPE_INVALID) ++ exc_clr |= FE_INVALID; ++ ++ if (set & GFC_FPE_ZERO) ++ exc_set |= FE_DIVBYZERO; ++ else if (clear & GFC_FPE_ZERO) ++ exc_clr |= FE_DIVBYZERO; ++ ++ if (set & GFC_FPE_OVERFLOW) ++ exc_set |= FE_OVERFLOW; ++ else if (clear & GFC_FPE_OVERFLOW) ++ exc_clr |= FE_OVERFLOW; ++ ++ if (set & GFC_FPE_UNDERFLOW) ++ exc_set |= FE_UNDERFLOW; ++ else if (clear & GFC_FPE_UNDERFLOW) ++ exc_clr |= FE_UNDERFLOW; ++ ++ if (set & GFC_FPE_INEXACT) ++ exc_set |= FE_INEXACT; ++ else if (clear & GFC_FPE_INEXACT) ++ exc_clr |= FE_INEXACT; ++ ++ feclearexcept (exc_clr); ++ feraiseexcept (exc_set); ++} ++ ++void get_fpu_state (void *state) ++{ ++ fegetenv (state); ++} ++ ++void set_fpu_state (void *state) ++{ ++ fesetenv (state); ++} ++ ++int get_fpu_rounding_mode (void) ++{ ++ int rnd_mode; ++ rnd_mode = fegetround(); ++ ++ switch (rnd_mode) ++ { ++ case FE_TONEAREST: ++ return GFC_FPE_TONEAREST; ++ case FE_UPWARD: ++ return GFC_FPE_UPWARD; ++ case FE_DOWNWARD: ++ return GFC_FPE_DOWNWARD; ++ case FE_TOWARDZERO: ++ return GFC_FPE_TOWARDZERO; ++ default: ++ return 0; /* Should be unreachable. */ ++ } ++} ++ ++void set_fpu_rounding_mode (int round) ++{ ++ int rnd_mode; ++ ++ switch (round) ++ { ++ case GFC_FPE_TONEAREST: ++ rnd_mode = FE_TONEAREST; ++ break; ++ case GFC_FPE_UPWARD: ++ rnd_mode = FE_UPWARD; ++ break; ++ case GFC_FPE_DOWNWARD: ++ rnd_mode = FE_DOWNWARD; ++ break; ++ case GFC_FPE_TOWARDZERO: ++ rnd_mode = FE_TOWARDZERO; ++ break; ++ default: ++ return; /* Should be unreachable. */ ++ } ++ ++ fesetround (rnd_mode); ++} ++ ++int support_fpu_flag (int flag) ++{ ++ if (flag & GFC_FPE_DENORMAL) ++ return 0; ++ ++ return 1; ++} ++ ++int support_fpu_trap (int flag) ++{ ++ if (flag & GFC_FPE_DENORMAL) ++ return 0; ++ ++ return 1; ++} ++ ++int support_fpu_rounding_mode(int mode __attribute__((unused))) ++{ ++ return 1; ++} ++ ++/* The following are not supported. */ ++ ++int support_fpu_underflow_control(int kind __attribute__((unused))) ++{ ++ return 0; ++} ++ ++int get_fpu_underflow_mode(void) ++{ ++ return 0; ++} ++ ++void set_fpu_underflow_mode(int gradual __attribute__((unused))) ++{ ++} +diff --git libgfortran/configure.host libgfortran/configure.host +index b15969f0e65a7..291188d19c29c 100644 +--- libgfortran/configure.host ++++ libgfortran/configure.host +@@ -61,6 +61,15 @@ case "${host_cpu}" in + ieee_support='yes' + ;; + esac ++ ;; ++ ++ powerpc*) ++ case "${host_os}" in ++ darwin*) ++ fpu_host='fpu-macppc' ++ ieee_support='yes' ++ ;; ++ esac + + esac + diff --git a/lang/gcc14/files/darwin8-define-PTHREAD_RWLOCK_INITIALIZER.patch b/lang/gcc14/files/darwin8-define-PTHREAD_RWLOCK_INITIALIZER.patch new file mode 100644 index 0000000000000..84d1d190de3d5 --- /dev/null +++ b/lang/gcc14/files/darwin8-define-PTHREAD_RWLOCK_INITIALIZER.patch @@ -0,0 +1,30 @@ +From b6bf2628afbcc1ca286dd9aa4a3d84fb5f608344 Mon Sep 17 00:00:00 2001 +From: Gleb Mazovetskiy +Date: Thu, 28 Nov 2024 16:00:06 +0000 +Subject: [PATCH] define PTHREAD_RWLOCK_INITIALIZER + +Per https://github.com/macports/macports-ports/pull/26655#issuecomment-2506351012 + +Remove this patch once +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117834 is resolved +--- + libgcc/gthr-posix.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git libgcc/gthr-posix.h libgcc/gthr-posix.h +index 82e8f9ffcf6..c6c04dd41c6 100644 +--- libgcc/gthr-posix.h ++++ libgcc/gthr-posix.h +@@ -62,6 +62,9 @@ typedef struct timespec __gthread_time_t; + #define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER + #define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function + #ifndef __cplusplus ++#ifndef PTHREAD_RWLOCK_INITIALIZER ++#define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWLOCK_SIG_init, {0}} ++#endif + #define __GTHREAD_RWLOCK_INIT PTHREAD_RWLOCK_INITIALIZER + #endif + #define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT +-- +2.43.0 + diff --git a/lang/gcc7/Portfile b/lang/gcc7/Portfile index a22699fc45b23..94f6257023caa 100644 --- a/lang/gcc7/Portfile +++ b/lang/gcc7/Portfile @@ -36,12 +36,6 @@ checksums rmd160 91d46ec088badec75f41a2ad2a0ba228a6715107 \ sha256 b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661 \ size 62783088 -# Check if this is the last supported gcc version for this system. -# If it is, libgcc7 installs a full runtime, otherwise it only installs -# what is missing from newer libgccX builds. -# NOTE : The logic here must match that in the libgcc port. -set isLastSupported [ expr ${os.major} < 10 ] - if { ${configure.build_arch} eq "i386" && ${os.major} >= 10 } { # fix no-pie clang bug bootstrapping gcc on i386 @@ -77,12 +71,8 @@ depends_lib port:cctools \ port:libiconv \ port:libmpc \ port:mpfr -depends_run port:gcc_select -if { ${isLastSupported} } { - depends_run-append path:share/doc/libgcc/README:libgcc -} else { - depends_run-append port:libgcc7 -} +depends_run port:gcc_select \ + port:libgcc7 depends_skip_archcheck-append gcc_select ld64 cctools license_noconflict gmp mpfr ppl libmpc @@ -191,15 +181,9 @@ use_parallel_build yes destroot.target install install-info-host # List of all dylibs to possibly be installed -set alldylibs {libgcc_ext.10.4.dylib libgcc_ext.10.5.dylib libgcc_s.1.dylib libgfortran.4.dylib libquadmath.0.dylib libstdc++.6.dylib libobjc-gnu.4.dylib libgomp.1.dylib libitm.1.dylib libssp.0.dylib libasan.4.dylib libubsan.0.dylib libcilkrts.5.dylib libatomic.1.dylib} +set alldylibs {libgcc_s.1.dylib libgfortran.4.dylib libquadmath.0.dylib libstdc++.6.dylib libobjc-gnu.4.dylib libgomp.1.dylib libitm.1.dylib libssp.0.dylib libasan.4.dylib libubsan.0.dylib libcilkrts.5.dylib libatomic.1.dylib} if {${subport} eq "libgcc7"} { - - # If providing the primary runtime, add conflict against libgcc-devel - if { ${isLastSupported} } { - conflicts libgcc-devel - } - # Activate hack for new libgcc # https://trac.macports.org/wiki/PortfileRecipes#deactivatehack pre-activate { @@ -225,16 +209,9 @@ if {${subport} eq "libgcc7"} { # version should continue to provide a subport for that and older gcc # versions. - if { ${isLastSupported} } { - depends_run - depends_lib-delete port:zlib - depends_build-append {*}${depends_lib} - depends_lib port:zlib - } else { - depends_run port:libgcc8 - depends_build-append {*}${depends_lib} - depends_lib - } + depends_run port:libgcc8 + depends_build-append {*}${depends_lib} + depends_lib configure.args-replace \ --libdir=${prefix}/lib/${name} \ @@ -261,16 +238,8 @@ if {${subport} eq "libgcc7"} { post-destroot { file mkdir ${destroot}${prefix}/lib/libgcc.merged - # Note that we really don't want to include libgcc_ext.10.[45].dylib here, but install_name_tool - # doesn't know how to change the id of stubs, and it's easier than recreating them for each - # gcc port. - if { ${isLastSupported} } { - # Install all - set dylibs ${alldylibs} - } else { - # Only install those not in newer libgcc builds - set dylibs {libgfortran.4.dylib libquadmath.0.dylib libasan.4.dylib libubsan.0.dylib libcilkrts.5.dylib} - } + # Only install those not in newer libgcc builds + set dylibs {libgfortran.4.dylib libquadmath.0.dylib libasan.4.dylib libubsan.0.dylib libcilkrts.5.dylib} foreach dylib ${dylibs} { # Different OS versions (e.g. Leopard) or architectures (e.g. PPC) don't produce all the dylibs @@ -308,15 +277,10 @@ if {${subport} eq "libgcc7"} { move ${destroot}${prefix}/lib/libgcc.merged ${destroot}${prefix}/lib/libgcc - if { ${isLastSupported} } { - # For binary compatibility with binaries that linked against the old libstdcxx port - ln -s libgcc/libstdc++.6.dylib ${destroot}${prefix}/lib/libstdc++.6.dylib - } else { - # Remove includes. Provided by newer libgcc. - file delete -force ${destroot}${prefix}/include - # This is provided by the libgcc port - file delete -force ${destroot}${prefix}/lib/libgcc/libquadmath.0.dylib - } + # Remove includes. Provided by newer libgcc. + file delete -force ${destroot}${prefix}/include + # This is provided by the libgcc port + file delete -force ${destroot}${prefix}/lib/libgcc/libquadmath.0.dylib } diff --git a/lang/gcc9/Portfile b/lang/gcc9/Portfile index 1507a92290b5e..867ef1d7c2770 100644 --- a/lang/gcc9/Portfile +++ b/lang/gcc9/Portfile @@ -12,7 +12,7 @@ name gcc9 version 9.5.0 revision 1 subport libgcc9 { revision 2 } -platforms {darwin >= 10 < 15} +platforms {darwin < 15} categories lang maintainers nomaintainer # an exception in the license allows dependents to not be GPL diff --git a/lang/libgcc/Portfile b/lang/libgcc/Portfile index 3722e7c286b5b..5f1e3debf8558 100644 --- a/lang/libgcc/Portfile +++ b/lang/libgcc/Portfile @@ -5,7 +5,7 @@ PortGroup select 1.0 epoch 3 name libgcc -version 8.0 +version 9.0 revision 0 conflicts libgcc-devel @@ -31,11 +31,8 @@ variant universal { } # Pick the gcc version that provides the primary runtime. # NOTE : The logic here must match that in the gccX ports *and* # that in _resources/port1.0/group/compilers-1.0.tcl -if { ${os.major} < 10 } { - set gcc_version 7 -} else { - set gcc_version 14 -} +set gcc_version 14 + depends_lib port:libgcc${gcc_version} build { } diff --git a/math/R/Portfile b/math/R/Portfile index 1ce13ccc8b07a..59e8ad0ee8f56 100644 --- a/math/R/Portfile +++ b/math/R/Portfile @@ -53,7 +53,7 @@ if { ${os.major} > 23 } { # Similarly, for gcc select the gcc13 variant of the compilers PG. # This setting should also be kept in sync with that in the R Portgroup. # Updates should be coordinated with the R maintainers. -if { ${os.major} > 23 } { +if { ${os.major} < 10 || ${os.major} > 23 } { # https://trac.macports.org/ticket/70799 compiler.blacklist-append {macports-gcc-1[5-9]} } else { @@ -61,17 +61,13 @@ if { ${os.major} > 23 } { } # NOTE: upon the update to gcc14, please update the blacklist accordingly, # like it is done for clangs. We would prefer using the same version of gcc and gfortran. -if {${os.platform} eq "darwin" && ${os.major} < 10} { - # Until old platforms are switched to the new libgcc. - default_variants-append +gcc7 +if { ${os.major} < 10 || ${os.major} > 23 } { + # https://trac.macports.org/ticket/70799 + default_variants-append +gcc14 } else { - if { ${os.major} > 23 } { - # https://trac.macports.org/ticket/70799 - default_variants-append +gcc14 - } else { - default_variants-append +gcc13 - } + default_variants-append +gcc13 } + # When switching to gcc14, make sure to add this flag when gcc is used # as the primary compiler: -Wno-error=incompatible-pointer-types # devQuartz.c:3049:35: error: passing argument 2 of 'CGContextSetFont'