Skip to content

Clang-15 fails to select proper candidate GCC installation on CentOS7 with multiple devtoolset versions #57843

@sfc-gh-mheimel

Description

@sfc-gh-mheimel

This is a (somewhat obscure) issue that was introduced by a recent driver change to the GCC candidate selection code for RHEL devtoolset installations:

  • Before this change, the driver would enumerate a list of hardcoded /opt/rh/devtoolset-XXX path prefixes for the various devtoolset versions, from which the driver selects the one that provides the GCC installation with the highest version number.
  • After this change, the driver iterates over the /opt/rh folder and selects the devtoolset-XXX path with the highest number. Only this path is checked for a GCC candidate installation.

This change causes problems on systems that have multiple devtoolset versions installed where the latest version does not provide a GCC installation. For instance, consider a system that has a full devtoolset-10 installation as well as a partial (say, only binutils) devtoolset-11 installation. In this case, the clang-15 driver will fail to detect the devtoolset-10 GCC candidate and fall back to the ancient system GCC, while clang-14 will correctly pick up devtoolset-10.

This issue particularly affects ARM installations of CentOS7: For some reason, CentOS does not provide a devtoolset-11-gcc package for ARM. In our case, we therefore have to rely on using both devtoolset-11-binutils and devtoolset-10-gcc, which means the above bug currently prevents us from migrating to clang 15.

Metadata

Metadata

Assignees

Labels

clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'platform:linux

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions