Non-universal build of compiler ignored in universal build attempts of MPlayer

Ryan Schmidt ryandesign at macports.org
Tue Oct 23 08:27:57 UTC 2018


On Oct 22, 2018, at 06:25, Christian Calderon wrote:

> Hello all! First time asking a question on the mailing list.
> 
> I have a Power Mac G5 Quad running OS X 10.5.8. My macports.conf contains "buildarch pcc" and "universal_archs ppc ppc64". My variants.conf contains the line "+universal".
> 
> I'm trying to build a universal MPlayer mostly to compare a ppc build and a ppc64 build to see if there are any performance differences. The main problem so far is that MPlayer depends on llvm-3.3, and that fails to build with ppc64 enabled. But to my understanding, llvm-3.3 is simply a backend for a compiler, and even a ppc build of llvm will be able to compile for a ppc64 target.
> 
> So I decided to install llvm-3.3 -universal, to make a ppc only build, with the assumption that that  should be good enough to then proceed with the MPlayer build. But when I try to build universal MPlayer again, it also tries to build llvm-3.3 as universal again.
> 
> So is there a way to build MPlayer (or any other ports) as a universal binary without having to build all the required compilers as universal binaries themselves? It shouldn't matter what arch the compiler is, as long as it supports compiling for the target architecture, right? As evidence, when I enter "llc-mp-3.3 --version" in the terminal, the result shows ppc64 in it's list of registered targets, even though llvm-3.3 was compiled for the ppc architecture. So it must not be the case that llvm-3.3 has to be compiled as universal in order to build a universal port.
> 
> Maybe if I build the other necessary compiler components, like gcc6, as ppc only builds first then MPlayer won't try to rebuild llvm-3.3 as universal?
> 
> Or does the MPlayer port file need to be changed in order to not force a universal build of the compilers it depends on?

Ken already explained that clang will be of no use on PowerPC at this time.

But were that not the case, to answer your question, MacPorts will ensure that all of a port's dependencies are installed with the same architectures for which you're trying to install the port, unless the dependency indicates that it does not install any libraries (by saying "installs_libs no" in its Portfile) or it has been explicitly told that that is not necessary. So if you believe that it is not necessary to compile the compiler for the same architectures, you could test that theory by editing the Portfile that will use that compiler and adding the line "depends_skip_archcheck-append clang-3.3" (or replace "clang-3.3" with the name of the port whose architectures you want MacPorts not to check). If that does indeed work, we should consider doing that automatically in MacPorts base. Certainly in the case of all of the gcc ports, I expect this not to work, because software compiled using gcc links with the gcc libraries, so those libraries will need to be built for the same architectures as the program. Clang also has a library, though I don't know how it gets used. I have never seen a program linked with the clang library, so maybe for clang this idea will work.




More information about the macports-users mailing list