compiler selection on PPC

Ken Cunningham ken.cunningham.webuse at gmail.com
Sun Dec 17 17:44:38 UTC 2017



> On Dec 17, 2017, at 12:02 AM, Jeremy Huddleston Sequoia <jeremyhu at apple.com> wrote:
> 
> 
> 
>> On Dec 6, 2017, at 20:09, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
>> 
>> 
>>> 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}
> 
> macports-gcc-6 is also not capable of building fat binaries, so +universal won't work with it.  If you're interested, you can maybe take the gcc driver-driver out of apple-gcc-4.2 (or llvm-gcc-4.2) and update it to work for macports-gcc.

Thanks for the comments.

It would be neat if we could build a multi-arch cross-compiling gcc6 or gcc7 again, but a niche product to be sure.

The driver-driver.c work has been done by others to allow it to work with gcc4.6 to gcc4.9, so shouldn't be too hard to move that up to gcc6/7.  

K


More information about the macports-dev mailing list