Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#41782 closed enhancement (fixed)

Default to apple-gcc-4.2 on Tiger

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.3.0
Component: base Version: 2.2.99
Keywords: tiger Cc: jeremyhu (Jeremy Huddleston Sequoia), cooljeanius (Eric Gallager), larryv (Lawrence Velázquez)
Port:

Description

I propose we switch the default compiler on Tiger from gcc-4.0 to apple-gcc-4.2 because gcc-4.0 is old and has numerous problems. So few maintainers have access to Tiger anymore that when the few remaining Tiger users encounter these problems and file tickets, they don't get resolved. We can fix a lot of them, all at once, with this one simple change.

We already switched the default compiler on Leopard from gcc-4.0 to gcc-4.2 in MacPorts 2.2. This was easy since Xcode 3 on Leopard comes with gcc-4.2. Xcode 2 on Tiger does not come with gcc-4.2, so we would have to use the apple-gcc42 port, which imposes an additional dependency on users, but this port does not change much anymore so it's a one-time build and a one-time inconvenience.

In addition to fixing the types of gcc-4.0 problems that this switch fixed on Leopard, it will have two additional benefits on Tiger:

  1. It will let us switch our default configure.cppflags from -I${prefix}/include to -isystem${prefix}/include which will solve a whole set of build problems; see #40656. gcc-4.0 on Tiger has a bug that causes compile failures for C++ code if we make this change.
  2. It will fix undefined symbol errors when using an SDK (e.g. #25053)

I plan to work on a patch for this and then test it on my Tiger machine by uninstalling and reinstalling my ports.

Change History (13)

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

+1

bootstrapping is the biggest annoyance. You'll certainly need to add apple-gcc-4.2 to compiler.blacklist in its own Port if it isn't there already. That should allow the fallback to building it with gcc-4.0 on the first pass.

comment:2 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:3 Changed 11 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:4 in reply to:  1 ; Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jeremyhu@…:

bootstrapping is the biggest annoyance. You'll certainly need to add apple-gcc-4.2 to compiler.blacklist in its own Port if it isn't there already. That should allow the fallback to building it with gcc-4.0 on the first pass.

I set up new Tiger test environment today and am installing everything with this change in place. So far so good.

My plan is for gcc-4.0 to not be in the fallback list by default, since gcc-4.0 won't work for whole bunches of ports on Tiger once I make the change in #40656. So I just set configure.compiler to gcc-4.0 explicitly. I also had to do the same in apple-gcc42's dependency gcc_select, because although it doesn't use a compiler, MacPorts base doesn't know that so it would still add the (circular) build dependency.

comment:5 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Would it be useful to have a "none" option for configure.compiler for cases like this to set CC,CXX,OBJCC to /bin/false

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

Or /usr/bin/false I suppose...

comment:7 in reply to:  4 ; Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Milestone: MacPorts Future
Resolution: fixed
Status: newclosed

Replying to ryandesign@…:

My plan is for gcc-4.0 to not be in the fallback list by default, since gcc-4.0 won't work for whole bunches of ports on Tiger once I make the change in #40656.

Changed my mind. In r115646 I made apple-gcc-4.2 the default on Tiger and left gcc-4.0 and gcc-3.3 in the list, because although they won't work for C++ code, they'll work for C code, while the next and final fallback, macports-clang-3.3, won't even build.

comment:8 in reply to:  6 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jeremyhu@…:

Would it be useful to have a "none" option for configure.compiler for cases like this to set CC,CXX,OBJCC to /bin/false

Replying to jeremyhu@…:

Or /usr/bin/false I suppose...

Interesting, but I'm not sure if it helps any situations other than this specific one with gcc_select on Tiger. In other ports that don't use a compiler, there would be no harm in leaving configure.compiler set to some compiler.

comment:9 in reply to:  4 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

So I just set configure.compiler to gcc-4.0 explicitly.

r115648

I also had to do the same in apple-gcc42's dependency gcc_select, because although it doesn't use a compiler, MacPorts base doesn't know that so it would still add the (circular) build dependency.

r115649

comment:10 in reply to:  7 ; Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to ryandesign@…:

Replying to ryandesign@…:

My plan is for gcc-4.0 to not be in the fallback list by default, since gcc-4.0 won't work for whole bunches of ports on Tiger once I make the change in #40656.

Changed my mind. In r115646 I made apple-gcc-4.2 the default on Tiger and left gcc-4.0 and gcc-3.3 in the list, because although they won't work for C++ code, they'll work for C code, while the next and final fallback, macports-clang-3.3, won't even build.

clang isn't suitable for ppc either, so we should probably remove it from ppc systems.

That being said, it should compile. What is the issue? If you're talking about #38857, I suggest you just provide a patch. It should be straight forward.

I don't have any Tiger machines any more, and VMWare only lets me go back to Leopard.

comment:11 in reply to:  10 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jeremyhu@…:

clang isn't suitable for ppc either, so we should probably remove it from ppc systems.

Mm, and gcc-3.3 isn't suitable for i386 systems.

That being said, it should compile. What is the issue? If you're talking about #38857, I suggest you just provide a patch. It should be straight forward.

For now it's a new problem, #42051.

I don't have any Tiger machines any more, and VMWare only lets me go back to Leopard.

Ah, but you can now, thanks to Landon.

comment:12 in reply to:  4 Changed 11 years ago by jmroot (Joshua Root)

Replying to ryandesign@…:

So I just set configure.compiler to gcc-4.0 explicitly. I also had to do the same in apple-gcc42's dependency gcc_select, because although it doesn't use a compiler, MacPorts base doesn't know that so it would still add the (circular) build dependency.

Note that you can set

configure.compiler.add_deps no

comment:13 Changed 11 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.3.0
Note: See TracTickets for help on using tickets.