Skip to content
Permalink
Browse files

Fix compiler selection on Leopard and Tiger

Rework of 7cf76ec.

Don't use macports-clang when targeting ppc, as it does not work for
that arch. Add macports-gcc for ppc instead. Drop gcc-3.3 on i386,
since it only works for ppc.

(cherry picked from commit 15a4eeb)
  • Loading branch information
jmroot committed Apr 10, 2018
1 parent 58e2773 commit ea87296c642f38920f04ce906c424dc954c686d9
Showing with 19 additions and 2 deletions.
  1. +19 −2 src/port1.0/portconfigure.tcl
@@ -487,14 +487,31 @@ proc portconfigure::get_compiler_fallback {} {

# Legacy cases
if {[vercmp $xcodeversion 4.0] < 0} {
set canonical_archs [get_canonical_archs]
if {[vercmp $xcodeversion 3.2] >= 0} {
if {[string match *10.4u* ${configure.sdkroot}]} {
return {gcc-4.0}
}
} elseif {[vercmp $xcodeversion 3.0] >= 0} {
return {gcc-4.2 apple-gcc-4.2 gcc-4.0 macports-clang-3.4 macports-clang-3.3}
if {"ppc" in $canonical_archs || "ppc64" in $canonical_archs} {
return {gcc-4.2 apple-gcc-4.2 gcc-4.0 macports-gcc-6 macports-gcc-7}
} else {
return {gcc-4.2 apple-gcc-4.2 gcc-4.0 macports-clang-3.4 macports-clang-3.3}
}
} else {
return {apple-gcc-4.2 gcc-4.0 gcc-3.3 macports-clang-3.3}
# Xcode 2.x (Tiger)
if {"ppc" in $canonical_archs || "ppc64" in $canonical_archs} {
if {"i386" in $canonical_archs} {
# universal
return {apple-gcc-4.2 gcc-4.0 macports-gcc-6 macports-gcc-7}
} else {
# ppc only
return {apple-gcc-4.2 gcc-4.0 gcc-3.3 macports-gcc-6 macports-gcc-7}
}
} else {
# i386 only
return {apple-gcc-4.2 gcc-4.0 macports-clang-3.3}
}
}
}

3 comments on commit ea87296

@kencu

This comment has been minimized.

Copy link
Contributor

@kencu kencu replied Apr 10, 2018

The only other issue we came up with here was to find a way to add
configure.cxxflags-append -D_GLIBCXX_USE_CXX11_ABI=0
to builds that call in gcc6 or gcc7 on PPC in particular. Right now this is done manually in the cxx11 1.1 PortGroup, but there was worry that this compiler defaulting and portfile blacklisting could call in gcc6 to build a c++11 port without warning, and that portgroup may not be added. @ryandesign was in on a lot of that discussion.

@jmroot

This comment has been minimized.

Copy link
Member Author

@jmroot jmroot replied Apr 10, 2018

Yes, that's certainly something that could happen, but there are not a lot of other options if you have to blacklist every Xcode compiler. Hopefully most C++11 ports will use the portgroup.

@ryandesign

This comment has been minimized.

Copy link
Contributor

@ryandesign ryandesign replied Apr 10, 2018

The issue affects all C++ ports using a MacPorts gcc compiler, not just C++11 ports.

Please sign in to comment.
You can’t perform that action at this time.