problem compiling libzzip (PPC, Sorbet Leopard)

Ken Cunningham ken.cunningham.webuse at gmail.com
Wed Jul 27 22:29:56 UTC 2022


> Hello,
> 
> somewhere in the dependencies for some package I have to compile
> libzzip. That's less easy than it sounds:
> 
> The libzzip package seems to enforce gcc-4.2 (there's /usr/bin/gcc-4.0
> and /opt/local/bin/ppc-apple-darwin9-gcc-7.5.0 == /opt/local/bin/gcc
> too) and tries to use it with -Warray-bounds. gcc-4.2 doesn't have that,
> but gcc7 does. Adding -DCMAKE_C_COMPILER=/opt/local/bin/gcc to the
> portfile didn't do the job. so some questions arise:
> 
> Is there a well known way to enforce a given compiler?

MacPorts method of doing this is to first build a list of all known compilers that a system can support, and put them in preferred order. This is done through the interaction of several bits of tcl code that can be described later if you are interested.

Then the Portfile will “blacklist” compilers or groups of compilers that are known not to work to build a given port.

MacPorts base then chooses the first compiler on the list of possible system compilers that is not blacklisted.

So — if libzzip will not build with gcc-4.2, then that compiler would be added to the port’s blacklisted compilers, with a statement like this in the Portfile:


compiler.blacklist-append gcc-4.2


or if all the 4-series gcc’s won’t work, this:

compiler.blacklist-append gcc-4.*

etc.

There are some other tricks that can be used, but for the purposes of how this is done, this is a reasonable way to start out. Chris mentioned a way to force a specific compiler, eg:

sudo port -v install libzzip configure.compiler=macports-gcc-7

a list of all the known compiler names is here

https://trac.macports.org/wiki/UsingTheRightCompiler

although not all of those are available on 10.5.x PPC of course (eg none of the clang compilers is available there).


> 
> Would/should I have to replace or remove one of the system's (Xcode's)
> compiler(s) to clean things up a bit?
> 
> Should I upgrade Xcode, and to which version (PPC32, Sorbet Leopard)?

In general, to keep things sane, MacPorts assumes that you have installed the last possible version of Xcode that the system can support.

There are a few exceptions to this rule just to keep you on your toes, of course, but none of the exceptions apply to Leopard.


> 
> Thanks in advance for helpful responses.
> 
> HG

As “Sorbet Leopard” is a non-standard release of MacOSX 10.5 Leopard for PowerPC with various modifications from the base system, MacPorts will not be able to support it. It is just too insane to try to keep these variant PPC systems sorted out, none of our common maintainers would use them, nobody would have ever thoroughly tested the tools out (gcc, cctools, ld64, etc) agains these systems, and so on.

So use them if you want, but please be fair and only open tickets against the official released versions of MacOSX system software. If we sense there is a variant system in play, we won’t be able to help you.

Of course, you are free to fork MacPorts and/or use your own overlay of Portfile fixes that work on your variant OS version! It is a free country (still, more or less) and you can do anything you danged well want to do!

Thx, K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20220727/d4badaa3/attachment.htm>


More information about the macports-users mailing list