This is an archive of the discontinued LLVM Phabricator instance.

[docs] Bump minimum GCC version to 7.4
ClosedPublic

Authored by MaskRay on Jul 25 2023, 7:58 PM.

Details

Summary

GCC 7.3 cannot build 16.x releases.

In file included from /tmp/llvm-16/llvm/lib/Transforms/IPO/AttributorAttributes.cpp:14:0:
/tmp/llvm-16/llvm/include/llvm/Transforms/IPO/Attributor.h:1137:32: error: duplicate initialization of ‘llvm::AnalysisGetter::HasLegacyWrapper<Analysis, std::void_t<typename Analysis::Lega
cyWrapper> >’
 constexpr bool AnalysisGetter::HasLegacyWrapper<
                                ^~~~~~~~~~~~~~~~~
       Analysis, std::void_t<typename Analysis::LegacyWrapper>> = true;
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/llvm-16/llvm/include/llvm/Transforms/IPO/Attributor.h:1137:32: error: got 1 template parameters for ‘constexpr const bool llvm::AnalysisGetter::HasLegacyWrapper< <template-parameter-1
-1>, <template-parameter-1-2> >’
/tmp/llvm-16/llvm/include/llvm/Transforms/IPO/Attributor.h:1137:32: error:   but 2 required

The 17.x and main branches have more failures, e.g.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp: `error: cannot decompose class type ‘std::pair<llvm::Value*, const llvm::SCEV*>’: ...`

We probably should just give up 7.1 and say that GCC<=7.3 is unsupported.
There is evidence that GCC 7.4 works.
I have verified that GCC 7.5 is able to build check-{llvm,clang,clang-tools,lldb,lld,polly,mlir,bolt},
but not flang due to at least flang/Common/enum-class.h and a <charconv> in a unittest.

Link: https://discourse.llvm.org/t/require-gcc-7-5-as-gcc-7-3-cannot-build-llvm/72310

Diff Detail

Event Timeline

MaskRay created this revision.Jul 25 2023, 7:58 PM
Herald added a reviewer: ctetreau. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
MaskRay requested review of this revision.Jul 25 2023, 7:58 PM
MaskRay edited the summary of this revision. (Show Details)Jul 25 2023, 8:16 PM
aaron.ballman added subscribers: cfe-commits, Restricted Project, aaron.ballman.

There's a mention on the RFC thread that Ubuntu 18.04 still ships with GCC 7.3. That's an LTS release but it EOLed just last month, so it's not clear how disruptive this would be. (To be clear, I'm not saying I'm opposed to the changes.)

Matt added a subscriber: Matt.Jul 26 2023, 10:29 AM

There's a mention on the RFC thread that Ubuntu 18.04 still ships with GCC 7.3. That's an LTS release but it EOLed just last month, so it's not clear how disruptive this would be. (To be clear, I'm not saying I'm opposed to the changes.)

The entire 16.x releases LLVMAnalysis cannot be built with GCC 7.3, so this CMake change shouldn't be a larger disruption to any GCC <= 7.3 user.
And we should get the GCC bump patch into 17.x so that users will not get confused by the supportness.

The question is whether we bump to 7.4 or 7.5. I'd prefer 7.5, as there appears to be more users on 7.5 and can verify that 7.5 works reliably.

There is a user who prefers 7.4 but 7.5 works for them.
https://discourse.llvm.org/t/require-gcc-7-5-as-gcc-7-3-cannot-build-llvm-16-x-or-main/72310/29 says that Ubuntu 18.04 (End of Standard Support in June 2023) gets GCC 7.5 updates.

There's a mention on the RFC thread that Ubuntu 18.04 still ships with GCC 7.3. That's an LTS release but it EOLed just last month, so it's not clear how disruptive this would be. (To be clear, I'm not saying I'm opposed to the changes.)

The entire 16.x releases LLVMAnalysis cannot be built with GCC 7.3, so this CMake change shouldn't be a larger disruption to any GCC <= 7.3 user.
And we should get the GCC bump patch into 17.x so that users will not get confused by the supportness.

The question is whether we bump to 7.4 or 7.5. I'd prefer 7.5, as there appears to be more users on 7.5 and can verify that 7.5 works reliably.

There is a user who prefers 7.4 but 7.5 works for them.
https://discourse.llvm.org/t/require-gcc-7-5-as-gcc-7-3-cannot-build-llvm-16-x-or-main/72310/29 says that Ubuntu 18.04 (End of Standard Support in June 2023) gets GCC 7.5 updates.

Okay, it sounds like the changes won't be particularly disruptive then, so this is reasonable to me. Thank you!

llvm/docs/GettingStarted.rst
284–298
aaron.ballman accepted this revision.Jul 31 2023, 6:06 AM

LG with the minor cleanup I found.

This revision is now accepted and ready to land.Jul 31 2023, 6:06 AM

Given that folks have successfully tested with GCC 7.4, and the lateness of the change in the release process for LLVM 17, I think it'd be better to require GCC 7.4 (the earliest that actually works), instead of increasing the requirement to 7.5.

MaskRay updated this revision to Diff 545768.Jul 31 2023, 1:03 PM
MaskRay retitled this revision from [docs] Bump minimum GCC version to 7.5 to [docs] Bump minimum GCC version to 7.4.
MaskRay edited the summary of this revision. (Show Details)

7.5 => 7.4

MaskRay updated this revision to Diff 545769.Jul 31 2023, 1:06 PM
MaskRay edited the summary of this revision. (Show Details)

reword description

This revision was landed with ongoing or failed builds.Jul 31 2023, 1:10 PM
This revision was automatically updated to reflect the committed changes.
PiotrZSL added inline comments.
llvm/docs/GettingStarted.rst
345

What about Glibc version ?
I were using GCC 9.1 + glibc 2.13 + some old kernel to compile Clang 15, after upgrading to Clang 16 I had to upgrade to kernel 3.11 and glibc 2.17 due to missing (I think) aligned_alloc.

MaskRay added inline comments.Jul 31 2023, 1:34 PM
llvm/docs/GettingStarted.rst
345

glibc support is worth its own discussion. glibc 2.13 was released in 2011. It's possible that no others has actively used this old version.

I think 2.19 has been tested and should work, but I am unclear about the support of older releases.

aaron.ballman added inline comments.Jul 31 2023, 1:37 PM
llvm/docs/GettingStarted.rst
284–298

I think you missed these requested changes when landing.

MaskRay added inline comments.Jul 31 2023, 1:49 PM
llvm/docs/GettingStarted.rst
284–298

Sorry:( Would you mind fixing it?

aaron.ballman added inline comments.Aug 1 2023, 4:19 AM
llvm/docs/GettingStarted.rst
284–298

No worries! I fixed it up in 80e80fa79bf66a74caf959bc420823e2b544dee9 -- can you squash those changes into your patch to move this to the 17.x branch? Or should we run consecutive cherry picks?