MacPorts wants to install apple-gcc42 on 10.6 all of a sudden?

"René J.V. Bertin" rjvbertin at
Mon Apr 22 05:35:45 PDT 2013

On Apr 22, 2013, at 14:08, Clemens Lang wrote:

> Which version of MacPorts are you running? Do you use MacPorts trunk?
> What port are you trying to install when MacPorts attempts to install
> apple-gcc42?

I'm at 2.1.3, I've been keeping the tree up to date with selfupdate and upgrade outdated.
The culprit port is ffmpeg in its universal variant.

> This might very well be the problem -- MacPorts base often only checks
> the Xcode version to find out which compilers are available and/or
> buggy. Since base doesn't currently support multiple Xcode versions
> simultanously, it probably ignores your Xcode 3.x completely.

Indeed. In the end I stumbled on a page that mentioned xcode-select, a utility I had of course never used as I'd never had multiple Xcode versions installed. I used it to reset the default IDE back to Xcode 3.x (appropriate in my case) and my issues went away.

> uses internally to build ports. Read
> section "The problem with the default compiler" to find out why.

I started reading that page but stopped when it became apparent I wasn't going to find a direct answer. I'll have another look, but I won't be convinced easily that there ought NOT be a mechanism to specify the compiler used internally and/or the default compile time options to use! ;)

> Changing /usr/bin/clang is a bad thing. This is Apple land. You

I beg to disagree :) I did exactly what the Xcode installer would have done had I installed in the default location, i.e. change a symlink. The only 'bad' thing that could happen is that building with the default clang profile now fails because some undocumented feature or bug in the compiler has been removed, for the rest it just comes down to using an updated version of the same compiler.
Not that I ever used the default clang in Xcode 3.x - it's been a while I added a compspec to use either a version I built myself, or clang-mp-3.3 if I had a reason not to use gcc.

>> Why is clang being favoured, and how do I force the use of gcc-4.2 ?
> Clang is always preferred, if available. Apple GCC 4.2 is dead software.

Maybe dead, but it's still the default compiler on 10.6 systems without Xcode 4. Given how short-lived Xcode 4.2 for 10.6 was, I'm tempted to suggest to stick to gcc-4.2 on that OS version.

> stuff as possible with clang in order to find and fix bugs. As said, if
> a port doesn't build for you with clang, that's a bug and you should
> file a ticket.

Is there a way to test-build a port without messing up one's installation tree? I guess bugs on 10.6 are probably not of the highest priority for you and I need a working installation ...

> You can force gcc-4.2 on a per-port base by appending
> configure.compiler=gcc-4.2 to the command line, but this is meant as a
> temporary solution to test whether the problem is the compiler.

Indeed. I'm sure there must be a way to set configure.compiler on a permanent basis O:-) (I even saw a patch, but it wasn't evident to me it's included in the default installation.)


More information about the macports-users mailing list