Opened 6 years ago

Last modified 3 years ago

#48345 assigned defect

Building for 10.4u SDK on 10.6 uses gcc-4.0 even though building directly on 10.4 uses the newer apple-gcc-4.2

Reported by: ryandesign (Ryan Schmidt) Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: base Version: 2.3.99
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)


Ever since MacPorts 2.3.0, the default compiler on Mac OS X 10.4 is the MacPorts-provided version of the Apple GCC 4.2 compiler, because the latest Apple GCC provided by Tiger's Xcode is 4.0, which was deemed too old.

However, if building on Snow Leopard using the Mac OS X 10.4u SDK, MacPorts uses Apple GCC 4.0 from Xcode.


Why does it do this? This means that software built on Tiger uses a newer compiler than software built for Tiger on Snow Leopard. Shouldn't it use Apple GCC 4.2 from Xcode, or from MacPorts, to match what would happen when building directly on Tiger?

I assume this is simply a remnant of when MacPorts < 2.3 used Apple GCC 4.0 on Tiger.

Jeremy, you made this change in r92159 but no ticket number was referenced in the commit message. I remember Snow Leopard issuing an error saying the 10.4u SDK is not compatible with gcc 4.2, but that can't be true or else it wouldn't work directly on Tiger either, but it does work there.

Change History (9)

comment:1 Changed 6 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Wow, that was 3 years ago. Sorry, but the reasoning has left my brain at this point. I remember making that change and being upset that it was that way, but I don't recall exactly what the fallout was.

Probably the easiest way to find out is to revert it and see what breaks. Since you're interested in that case, can you give it a whirl and see what falls out? It might be the case that gcc-4.2 doesn't work for some reason, but maybe I fixed that in apple-gcc-4.2.

comment:2 Changed 3 years ago by jmroot (Joshua Root)

The Xcode 3.1 release notes say:

GCC 4.2 is a new optional compiler with stricter C and C++ language enforcement, security enhancements, performance optimizations, and bug fixes over GCC 4.0. Requires the Mac OS X 10.5 SDK or "Current OS" SDK

The Xcode 3.2 release notes say:

  • Using the Clang compiler requires the 10.6 SDK
  • Using GCC LLVM or GCC 4.2 requires the 10.5 SDK or 10.6 SDK

See also e.g.:, #18765, #21511, #20948, #21662, #23149, #28046, #28800, #31946

comment:3 Changed 3 years ago by pmetzger (Perry E. Metzger)

Owner: changed from macports-tickets@… to kencu
Status: newassigned

I've assigned this to Ken on the basis that he seems to be the person that cares the most about the ancient stuff. Ken, if you don't want to own this, feel free to give it back to macports-tickets.

comment:4 Changed 3 years ago by kencu (Ken)

Long live SnowLeopard! I use it all day, every day :> Don't know if I can actually fix this, though.

On the rare times I build against the 10.4u SDK on SnowLeopard (TenFourFox for Intel comes to mind) I force the compiler I want rather than let MacPorts logic choose one for me.

This ticket would seem destined for a "wontfix" in the end...

comment:5 Changed 3 years ago by ryandesign (Ryan Schmidt)

Thanks Josh for the reminder about previous tickets. So the 10.4u SDK really does still require gcc-4.0, and is not compatible with gcc-4.2. I verified that just now using the FFView port, which was mentioned in one of those tickets.

It doesn't make sense that MacPorts base only sets the compiler to gcc-4.0 when using the 10.4u SDK on Snow Leopard. It needs to do that on Tiger and Leopard as well.

For Leopard, the problem is visible; the build clearly fails with gcc-4.2. For Tiger, the problem is not visible for FFView and other ports building using Xcode projects (most of the tickets Josh mentioned) because the xcode portgroup can't use any MacPorts compiler. So although on Tiger we are setting the compiler to the MacPorts apple-gcc-4.2 compiler, the Xcode portgroup ignores that and continues to use the Xcode gcc-4.0 compiler, thus the build doesn't fail.

On Snow Leopard with Xcode 4, we're using llvm-gcc-4.2. This does seem to work with the 10.4u SDK, so there's no problem there.

On Leopard, llvm-gcc-4.2 does not work with the 10.4u SDK, so we should not try to use that as a fallback.

comment:6 in reply to:  5 Changed 3 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign:

It doesn't make sense that MacPorts base only sets the compiler to gcc-4.0 when using the 10.4u SDK on Snow Leopard. It needs to do that on Tiger and Leopard as well.

It looks like this change is part of That will resolve this ticket.

comment:7 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:8 Changed 3 years ago by kencu (Ken)

to build TenFourFox (Firefox) on 10.6.8 , 10.5, and 10.4 (Intel) and on 10.4 & 10.5 PPC against the 10.4u SDK, we use gcc-4.8 on all systems. It works perfectly well.

I have also used gcc6 to build it on most systems.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:9 Changed 3 years ago by kencu (Ken)

Owner: changed from kencu to ryandesign
Note: See TracTickets for help on using tickets.