Skip to content

Commit 4c72deb

Browse files
committed
1 parent 194d196 commit 4c72deb

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

llvm/cmake/modules/CheckCompilerVersion.cmake

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
include(CheckCXXSourceCompiles)
66

77
set(GCC_MIN 5.1)
8-
set(GCC_SOFT_ERROR 5.1)
8+
set(GCC_SOFT_ERROR 7.1)
99
set(CLANG_MIN 3.5)
10-
set(CLANG_SOFT_ERROR 3.5)
10+
set(CLANG_SOFT_ERROR 5.0)
1111
set(APPLECLANG_MIN 6.0)
12-
set(APPLECLANG_SOFT_ERROR 6.0)
12+
set(APPLECLANG_SOFT_ERROR 9.3)
1313

1414
# https://en.wikipedia.org/wiki/Microsoft_Visual_C#Internal_version_numbering
1515
# _MSC_VER == 1920 MSVC++ 14.20 Visual Studio 2019 Version 16.0
@@ -19,7 +19,7 @@ set(MSVC_SOFT_ERROR 19.27)
1919

2020
# Map the above GCC versions to dates: https://gcc.gnu.org/develop.html#timeline
2121
set(GCC_MIN_DATE 20150422)
22-
set(GCC_SOFT_ERROR_DATE 20150422)
22+
set(LIBSTDCXX_SOFT_ERROR 7)
2323

2424

2525
if(DEFINED LLVM_COMPILER_CHECKED)
@@ -97,27 +97,21 @@ int main() { ++chk; return 0; }
9797
if(NOT LLVM_LIBSTDCXX_MIN)
9898
message(FATAL_ERROR "libstdc++ version must be at least ${GCC_MIN}.")
9999
endif()
100-
# Test for libstdc++ version of at least 5.1 by checking for std::iostream_category().
101-
# Note: We should check _GLIBCXX_RELEASE when possible (i.e., for GCC 7.1 and up).
102100
check_cxx_source_compiles("
103101
#include <iosfwd>
104102
#if defined(__GLIBCXX__)
105-
#if __GLIBCXX__ < ${GCC_SOFT_ERROR_DATE}
103+
#if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < ${LIBSTDCXX_SOFT_ERROR}
106104
#error Unsupported libstdc++ version
107105
#endif
108106
#endif
109-
#if defined(__GLIBCXX__)
110-
#include <ios>
111-
void foo(void) { (void) std::iostream_category(); }
112-
#endif
113107
int main() { return 0; }
114108
"
115109
LLVM_LIBSTDCXX_SOFT_ERROR)
116110
if(NOT LLVM_LIBSTDCXX_SOFT_ERROR)
117111
if(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN)
118-
message(WARNING "libstdc++ version should be at least ${GCC_SOFT_ERROR} because LLVM will soon use new C++ features which your toolchain version doesn't support. Ignoring because you've set LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN, but very soon your toolchain won't be supported.")
112+
message(WARNING "libstdc++ version should be at least ${LIBSTDCXX_SOFT_ERROR} because LLVM will soon use new C++ features which your toolchain version doesn't support. Ignoring because you've set LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN, but very soon your toolchain won't be supported.")
119113
else()
120-
message(FATAL_ERROR "libstdc++ version should be at least ${GCC_SOFT_ERROR} because LLVM will soon use new C++ features which your toolchain version doesn't support. You can temporarily opt out using LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN, but very soon your toolchain won't be supported.")
114+
message(FATAL_ERROR "libstdc++ version should be at least ${LIBSTDCXX_SOFT_ERROR} because LLVM will soon use new C++ features which your toolchain version doesn't support. You can temporarily opt out using LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN, but very soon your toolchain won't be supported.")
121115
endif()
122116
endif()
123117
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})

llvm/docs/GettingStarted.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ uses the package and provides other details.
175175
Package Version Notes
176176
=========================================================== ============ ==========================================
177177
`CMake <http://cmake.org/>`__ >=3.13.4 Makefile/workspace generator
178-
`GCC <http://gcc.gnu.org/>`_ >=5.1.0 C/C++ compiler\ :sup:`1`
178+
`GCC <http://gcc.gnu.org/>`_ >=7.1.0 C/C++ compiler\ :sup:`1`
179179
`python <http://www.python.org/>`_ >=3.6 Automated test suite\ :sup:`2`
180180
`zlib <http://zlib.net>`_ >=1.2.3.4 Compression library\ :sup:`3`
181181
`GNU Make <http://savannah.gnu.org/projects/make>`_ 3.79, 3.79.1 Makefile/build processor\ :sup:`4`
@@ -235,10 +235,10 @@ LLVM is written using the subset of C++ documented in :doc:`coding
235235
standards<CodingStandards>`. To enforce this language version, we check the most
236236
popular host toolchains for specific minimum versions in our build systems:
237237

238-
* Clang 3.5
239-
* Apple Clang 6.0
240-
* GCC 5.1
241-
* Visual Studio 2019
238+
* Clang 5.0
239+
* Apple Clang 9.3
240+
* GCC 7.1
241+
* Visual Studio 2019 16.7
242242

243243
Anything older than these toolchains *may* work, but will require forcing the
244244
build system with a special option and is not really a supported host platform.
@@ -303,11 +303,11 @@ GCC from source. It is also quite easy to do these days.
303303
.. _github gist:
304304
https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
305305

306-
Easy steps for installing GCC 5.1.0:
306+
Easy steps for installing GCC 7.1.0:
307307

308308
.. code-block:: console
309309
310-
% gcc_version=5.1.0
310+
% gcc_version=7.1.0
311311
% wget https://ftp.gnu.org/gnu/gcc/gcc-${gcc_version}/gcc-${gcc_version}.tar.bz2
312312
% wget https://ftp.gnu.org/gnu/gcc/gcc-${gcc_version}/gcc-${gcc_version}.tar.bz2.sig
313313
% wget https://ftp.gnu.org/gnu/gnu-keyring.gpg

llvm/docs/ReleaseNotes.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,26 @@ Non-comprehensive list of changes in this release
4242
functionality, or simply have a lot to talk about), see the `NOTE` below
4343
for adding a new subsection.
4444
45+
* ...
4546

46-
.. NOTE
47-
If you would like to document a larger change, then you can add a
48-
subsection about it right here. You can copy the following boilerplate
49-
and un-indent it (the indentation causes it to be inside this comment).
47+
Update on required toolchains to build LLVM
48+
-------------------
5049

51-
Special New Feature
52-
-------------------
50+
With LLVM 15.x we will raise the version requirements of the toolchain used
51+
to build LLVM. The new requirements are as follows:
5352

54-
Makes programs 10x faster by doing Special New Thing.
53+
* GCC >= 7.1
54+
* Clang >= 5.0
55+
* Apple Clang >= 9.3
56+
* Visual Studio 2019 >= 16.7
5557

56-
* ...
58+
In LLVM 15.x these requirements will be "soft" requirements and the version
59+
check can be skipped by passing -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON
60+
to CMake.
61+
62+
With the release of LLVM 16.x these requirements will be hard and LLVM developers
63+
can start using C++17 features, making it impossible to build with older
64+
versions of these toolchains.
5765

5866
Changes to the LLVM IR
5967
----------------------

0 commit comments

Comments
 (0)