[RFC] Increase minimum supported GCC version for building LLVM to 4.8

According to the documentation at http://llvm.org/docs/GettingStarted.html#software, compiling LLVM with GCC requires at least version 4.7.0. However, there are apparently several problems building current LLVM/Clang with gcc 4.7.X. This proposal is to increase the minimum required GCC to 4.8.

This is split off of the thread started here:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105742.html
which is a fairly recent regression in being able to compile LTO.cpp with GCC 4.7.4, which I tracked down to a known GCC bug.

According to James Knight, it is not the only place where GCC 4.7.X cannot compile the clang toolchain, which apparently hasn’t been buildable by GCC 4.7.X in >3 months:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105825.html

Renato also suggests bumping the minimum to 4.8, as that is the oldest shipped version in most stable Linux distributions:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105826.html

We currently have many buildbots building with GCC 4.8, but none with GCC 4.7.X, which is why this issue was not discovered previously.

Thoughts?

Thanks,
Teresa

+1. I’ve been bitten by the 4.7 STL’s lack of std::map::emplace a few times, so I support this.

This makes sense to me. Especially since, in practice, we’ve already done it :wink:

-Hal

Same here. I still remember the disappointment about the emplace.

+1

-Krzysztof

Fine with me.

Joerg

+1 from me.

But which version of 4.8.x? 4.8.0 was released in March 2013 while 4.8.5 is June 2015 (see https://gcc.gnu.org/releases.html)

Thats an awfully long time between those dates, so i can’t imagine everyone being on 4.8.5, but shouldn’t we aim for the highest possible one if we’re bumping versions anyway?

Looking at Ubuntu 14.04 LTS (http://packages.ubuntu.com/search?keywords=gcc-4.8), appears that 4.8.4 is available for many platforms, so if possible that might be a good version to do.

Cheers,
Pete

Teresa Johnson via llvm-dev <llvm-dev@lists.llvm.org> writes:

According to the documentation at
Getting Started with the LLVM System — LLVM 16.0.0git documentation, compiling LLVM with GCC
requires at least version 4.7.0. However, there are apparently several
problems building current LLVM/Clang with gcc 4.7.X. This proposal is to
increase the minimum required GCC to 4.8.

-1 unless it's particularly hard to fix the incompatibilities that have
been introduced or there are strong pain points in supporting 4.7.4. We
should only increase the minimum version of our host compilers if we
have strong motivation to do so.

We do: Everyone we care about has already done so, including not just all
developers, but all users anyone can find.

Nobody is testing or ensuring it builds with 4.7, nor is there any
compelling reason anyone can give to do so

Testing with 4.7 would actually require people go and install non-default
compilers for their long term supported distros in the buildbots, etc
(that's a pain point right there).

Last i looked, 3.9 did not even build with gcc 4.7, and not a single
complaint, bug filed, etc.

(note: I haven't double checked this, it was definitely true at one point).

Even the case where someone noticed that Teresa points out is an odd case,
and not a normal usage.

I think the above is a pretty strong motivation, even if it's not the
typical motivation of "it adds x feature we want".

We can certainly offer support for 4.7 if we want to, but if we are
offering 4.7 just because 4.8 doesn't have magical new features that we
would upgrade to, that seems wrong.
We should offer support for 4.7 because someone actually wants it, and we
care about that someone.
Otherwise, it fails the very trivial test of "who cares if we support 4.7
or not"

They’re all similar in features support.

The long range of dates is just because they’re better at long term support than we are. :slight_smile:

Different distros will have different dot versions, but they are essentially the same for our purposes (c++ support).

Cheers,
Renato

I don't know the specific bug history of GCC 4.8.x, but updating to a
different tiny version is *much* less involved, since you typically only
care about codegen fixes.

In case it matters, NetBSD 7.0 ships a January 2015 snapshot of GCC,
between 4.8.4 and 4.8.5.

Joerg

Ubuntu Trusty ships 4.8.2 and I have a RedHat with 4.8.3.

It shouldn't really matter which dot version, they're mostly bug
fixes, not additional support.

In practice...
* If LLVM builds with 4.8.0 but not with 4.8.2, it probably means
there's a bug in LLVM that needs fixing.
* if LLVM builds with 4.8.2 but not with 4.8.0, it probably means
there's a bug in 4.8.0 that was fixed in 4.8.3.

Sometimes, the latter case is also platform specific. We used to have
a long list of those cases pre 4.7, but they seem to have all
disappeared by now.

So, unless we have specific concerns, we should not specify the dot
version, just say "4.8".

cheers,
--renato

Hi Justin,

Wanted to follow up to see if Danny’s response or the other responses addressed your concerns.

Rather than specific new features in gcc 4.8+, it is more an issue of 4.7 being stale, as evidenced by some of the issues reported here and in the thread I pointed to, and 4.8 being the version shipped with Linux distros. Gcc is currently at 6.X, so 4.7 is quite a few major releases ago (even taking into account the change in Gcc major release version numbering).

Thanks,
Teresa

Hi Justin,

Wanted to follow up to see if Danny's response or the other responses
addressed your concerns.

Rather than specific new features in gcc 4.8+, it is more an issue of 4.7
being stale, as evidenced by some of the issues reported here and in the
thread I pointed to, and 4.8 being the version shipped with Linux distros.
Gcc is currently at 6.X, so 4.7 is quite a few major releases ago (even
taking into account the change in Gcc major release version numbering).

To complement Danny's response:

Testing with 4.7 would actually require people go and install non-default

compilers for their long term supported distros in the buildbots, etc
(that's a pain point right there).

This is the strongest reason why we want to move to 4.8: because we're
testing it heavily, no one has been testing 4.7 for a long time, and it
would take a non-trivial amount of effort to start and continue testing 4.7.

I think we need to turn the question around: Given the high costs involved,
is there such a strong need to retain 4.7 compatibility?

cheers,
--renato

Yes, Danny’s response directly addressed my concerns, thanks. Sorry I wasn’t explicit about that.

Great, thanks for the confirmation! I think at this point I will send a patch for review, given the support.
Teresa

Great! Thanks Teresa!

We should also start the discussion about bumping the Clang version as
well. I think the goal is to have provable record of support by linking to
specific buildbots with those configurations, for all compilers we promise
to support.

But in a different thread. :slight_smile:

cheers,
--renato

FYI, the patch is https://reviews.llvm.org/D25683. Advertising it here since I haven’t gotten any traffic on the patch.

Teresa