compiler selection on PPC
Ken Cunningham
ken.cunningham.webuse at gmail.com
Thu Dec 7 04:09:59 UTC 2017
On 2017-12-06, at 12:19 PM, Ken Cunningham wrote:
> There have been a number of tickets over the past two years that relate to compiler selection on PPC systems.
>
> Basically, on PPC, if the default compiler (gcc 4.2 on 10.5, or apple-gcc42 on Tiger) does not work to build a port, the only other compiler that should be then used is gcc6. Maybe someday this might be gcc7, if we fix up the extra errors found in gcc7.
>
> Presently, however, PPC systems go down the same compiler selection path as Intel systems. That usually leads to clang 3.3 or clang 3.4 being selected, and this always fails miserably on PPC.
>
> Finally, there are a number of ports that blacklist all gcc compilers like this *gcc* . This is often appropriate for Intel systems, but completely wrong for PPC. So I don't know if it is possible to clear or ignore that setting in a Portfile -- probably not, but when I set the default_compiler in macports.conf, it does appear override that setting, so maybe it is possible.
>
> Thanks,
>
> Ken
I think the part of code that would need fixing is in portconfigure.tcl, in this block:
# Legacy cases
if {[vercmp $xcodeversion 4.0] < 0} {
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}
} else {
return {apple-gcc-4.2 gcc-4.0 gcc-3.3 macports-clang-3.3}
}
}
===================
if I were to put in an appropriate PPC build arch test there, and change the returned compilers for ppc to return something like the following, we should be OK. Just have to figure out the right kind of build.arch test to use in portconfigure.tcl:
} elseif {[vercmp $xcodeversion 3.0] >= 0} {
return {gcc-4.2 apple-gcc-4.2 gcc-4.0 macports-gcc-6}
} else {
return {apple-gcc-4.2 gcc-4.0 macports-gcc-6}
More information about the macports-dev
mailing list