Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 7ab3c4f

Browse files
committed
Revert "Bump minimum toolchain version"
Reverting D57264 again, it looks like we're down to two bots that need fixing: polly-amd64-linux polly-arm-linux They both have old versions of libstdc++ and recent clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352954 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2e3ef19 commit 7ab3c4f

File tree

4 files changed

+40
-87
lines changed

4 files changed

+40
-87
lines changed

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,9 @@ option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF)
383383
set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
384384
"Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
385385

386-
option(LLVM_FORCE_USE_OLD_TOOLCHAIN
386+
option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN
387387
"Set to ON to force using an old, unsupported host toolchain." OFF)
388388

389-
option(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN
390-
"Set to ON to only warn when using a toolchain which is about to be deprecated, instead of emitting an error." OFF)
391-
392389
option(LLVM_USE_INTEL_JITEVENTS
393390
"Use Intel JIT API to inform Intel(R) VTune(TM) Amplifier XE 2011 about JIT code"
394391
OFF)

cmake/modules/CheckCompilerVersion.cmake

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

77
set(GCC_MIN 4.8)
8-
set(GCC_SOFT_ERROR 5.1)
8+
set(GCC_WARN 4.8)
99
set(CLANG_MIN 3.1)
10-
set(CLANG_SOFT_ERROR 3.5)
10+
set(CLANG_WARN 3.1)
1111
set(APPLECLANG_MIN 3.1)
12-
set(APPLECLANG_SOFT_ERROR 6.0)
13-
set(MSVC_MIN 19.00.24213.1)
14-
set(MSVC_SOFT_ERROR 19.1)
15-
16-
# Map the above GCC versions to dates: https://gcc.gnu.org/develop.html#timeline
17-
set(GCC_MIN_DATE 20130322)
18-
set(GCC_SOFT_ERROR_DATE 20150422)
19-
12+
set(APPLECLANG_WARN 3.1)
13+
set(MSVC_MIN 19.0)
14+
set(MSVC_WARN 19.00.24213.1)
2015

2116
if(DEFINED LLVM_COMPILER_CHECKED)
2217
return()
@@ -27,25 +22,21 @@ if(LLVM_FORCE_USE_OLD_TOOLCHAIN)
2722
return()
2823
endif()
2924

30-
function(check_compiler_version NAME NICE_NAME MINIMUM_VERSION SOFT_ERROR_VERSION)
25+
function(check_compiler_version NAME NICE_NAME MINIMUM_VERSION WARN_VERSION)
3126
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL NAME)
3227
return()
3328
endif()
3429
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_VERSION)
3530
message(FATAL_ERROR "Host ${NICE_NAME} version must be at least ${MINIMUM_VERSION}, your version is ${CMAKE_CXX_COMPILER_VERSION}.")
36-
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS SOFT_ERROR_VERSION)
37-
if(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN)
38-
message(WARNING "Host ${NICE_NAME} version should be at least ${SOFT_ERROR_VERSION} because LLVM will soon use new C++ features which your toolchain version doesn't support. Your version is ${CMAKE_CXX_COMPILER_VERSION}. Ignoring because you've set LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN, but very soon your toolchain won't be supported.")
39-
else()
40-
message(FATAL_ERROR "Host ${NICE_NAME} version should be at least ${SOFT_ERROR_VERSION} because LLVM will soon use new C++ features which your toolchain version doesn't support. Your version is ${CMAKE_CXX_COMPILER_VERSION}. You can temporarily opt out using LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN, but very soon your toolchain won't be supported.")
41-
endif()
31+
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS WARN_VERSION)
32+
message(WARNING "Host ${NICE_NAME} version must be at least ${WARN_VERSION} due to miscompiles from earlier versions, your version is ${CMAKE_CXX_COMPILER_VERSION}.")
4233
endif()
4334
endfunction(check_compiler_version)
4435

45-
check_compiler_version("GNU" "GCC" ${GCC_MIN} ${GCC_SOFT_ERROR})
46-
check_compiler_version("Clang" "Clang" ${CLANG_MIN} ${CLANG_SOFT_ERROR})
47-
check_compiler_version("AppleClang" "Apple Clang" ${APPLECLANG_MIN} ${APPLECLANG_SOFT_ERROR})
48-
check_compiler_version("MSVC" "Visual Studio" ${MSVC_MIN} ${MSVC_SOFT_ERROR})
36+
check_compiler_version("GNU" "GCC" ${GCC_MIN} ${GCC_WARN})
37+
check_compiler_version("Clang" "Clang" ${CLANG_MIN} ${CLANG_WARN})
38+
check_compiler_version("AppleClang" "Apple Clang" ${APPLECLANG_MIN} ${APPLECLANG_WARN})
39+
check_compiler_version("MSVC" "Visual Studio" ${MSVC_MIN} ${MSVC_WARN})
4940

5041
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
5142
if (CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
@@ -54,39 +45,20 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
5445
endif()
5546
set(CLANG_CL 1)
5647
elseif(NOT LLVM_ENABLE_LIBCXX)
57-
# Test that we aren't using too old of a version of libstdc++.
48+
# Test that we aren't using too old of a version of libstdc++
49+
# with the Clang compiler. This is tricky as there is no real way to
50+
# check the version of libstdc++ directly. Instead we test for a known
51+
# bug in libstdc++4.6 that is fixed in libstdc++4.7.
5852
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
5953
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
6054
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++0x")
6155
check_cxx_source_compiles("
62-
#include <iosfwd>
63-
#if defined(__GLIBCXX__)
64-
#if __GLIBCXX__ < ${GCC_MIN_DATE}
65-
#error Unsupported libstdc++ version
66-
#endif
67-
#endif
68-
int main() { return 0; }
69-
"
70-
LLVM_LIBSTDCXX_MIN)
71-
if(NOT LLVM_LIBSTDCXX_MIN)
72-
message(FATAL_ERROR "libstdc++ version must be at least ${GCC_MIN}.")
73-
endif()
74-
check_cxx_source_compiles("
75-
#include <iosfwd>
76-
#if defined(__GLIBCXX__)
77-
#if __GLIBCXX__ < ${GCC_SOFT_ERROR_DATE}
78-
#error Unsupported libstdc++ version
79-
#endif
80-
#endif
81-
int main() { return 0; }
82-
"
83-
LLVM_LIBSTDCXX_SOFT_ERROR)
84-
if(NOT LLVM_LIBSTDCXX_SOFT_ERROR)
85-
if(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN)
86-
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.")
87-
else()
88-
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.")
89-
endif()
56+
#include <atomic>
57+
std::atomic<float> x(0.0f);
58+
int main() { return (float)x; }"
59+
LLVM_NO_OLD_LIBSTDCXX)
60+
if(NOT LLVM_NO_OLD_LIBSTDCXX)
61+
message(FATAL_ERROR "Host Clang must be able to find libstdc++4.8 or newer!")
9062
endif()
9163
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
9264
set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})

docs/CMake.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,6 @@ LLVM-specific variables
578578
may not compile at all, or might fail at runtime due to known bugs in these
579579
toolchains.
580580

581-
**LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN**:BOOL
582-
If enabled, the compiler version check will only warn when using a toolchain
583-
which is about to be deprecated, instead of emitting an error.
584-
585581
CMake Caches
586582
============
587583

docs/GettingStarted.rst

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ uses the package and provides other details.
170170
Package Version Notes
171171
=========================================================== ============ ==========================================
172172
`GNU Make <http://savannah.gnu.org/projects/make>`_ 3.79, 3.79.1 Makefile/build processor
173-
`GCC <http://gcc.gnu.org/>`_ >=5.1.0 C/C++ compiler\ :sup:`1`
173+
`GCC <http://gcc.gnu.org/>`_ >=4.8.0 C/C++ compiler\ :sup:`1`
174174
`python <http://www.python.org/>`_ >=2.7 Automated test suite\ :sup:`2`
175175
`zlib <http://zlib.net>`_ >=1.2.3.4 Compression library\ :sup:`3`
176176
=========================================================== ============ ==========================================
@@ -228,15 +228,6 @@ LLVM is written using the subset of C++ documented in :doc:`coding
228228
standards<CodingStandards>`. To enforce this language version, we check the most
229229
popular host toolchains for specific minimum versions in our build systems:
230230

231-
* Clang 3.5
232-
* Apple Clang 6.0
233-
* GCC 5.1
234-
* Visual Studio 2017
235-
236-
The below versions currently soft-error as we transition to the new compiler
237-
versions listed above. The LLVM codebase is currently known to compile correctly
238-
with the following compilers, though this will change in the near future:
239-
240231
* Clang 3.1
241232
* Apple Clang 3.1
242233
* GCC 4.8
@@ -292,44 +283,41 @@ The first step is to get a recent GCC toolchain installed. The most common
292283
distribution on which users have struggled with the version requirements is
293284
Ubuntu Precise, 12.04 LTS. For this distribution, one easy option is to install
294285
the `toolchain testing PPA`_ and use it to install a modern GCC. There is
295-
a really nice discussions of this on the `ask ubuntu stack exchange`_ and a
296-
`github gist`_ with updated commands. However, not all users can use PPAs and
297-
there are many other distributions, so it may be necessary (or just useful, if
298-
you're here you *are* doing compiler development after all) to build and install
299-
GCC from source. It is also quite easy to do these days.
286+
a really nice discussions of this on the `ask ubuntu stack exchange`_. However,
287+
not all users can use PPAs and there are many other distributions, so it may be
288+
necessary (or just useful, if you're here you *are* doing compiler development
289+
after all) to build and install GCC from source. It is also quite easy to do
290+
these days.
300291

301292
.. _toolchain testing PPA:
302293
https://launchpad.net/~ubuntu-toolchain-r/+archive/test
303294
.. _ask ubuntu stack exchange:
304-
https://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu/581497#58149
305-
.. _github gist:
306-
https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
295+
http://askubuntu.com/questions/271388/how-to-install-gcc-4-8-in-ubuntu-12-04-from-the-terminal
307296

308-
Easy steps for installing GCC 5.1.0:
297+
Easy steps for installing GCC 4.8.2:
309298

310299
.. code-block:: console
311300
312-
% gcc_version=5.1.0
313-
% wget https://ftp.gnu.org/gnu/gcc/gcc-${gcc_version}/gcc-${gcc_version}.tar.bz2
314-
% wget https://ftp.gnu.org/gnu/gcc/gcc-${gcc_version}/gcc-${gcc_version}.tar.bz2.sig
301+
% wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
302+
% wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2.sig
315303
% wget https://ftp.gnu.org/gnu/gnu-keyring.gpg
316-
% signature_invalid=`gpg --verify --no-default-keyring --keyring ./gnu-keyring.gpg gcc-${gcc_version}.tar.bz2.sig`
304+
% signature_invalid=`gpg --verify --no-default-keyring --keyring ./gnu-keyring.gpg gcc-4.8.2.tar.bz2.sig`
317305
% if [ $signature_invalid ]; then echo "Invalid signature" ; exit 1 ; fi
318-
% tar -xvjf gcc-${gcc_version}.tar.bz2
319-
% cd gcc-${gcc_version}
306+
% tar -xvjf gcc-4.8.2.tar.bz2
307+
% cd gcc-4.8.2
320308
% ./contrib/download_prerequisites
321309
% cd ..
322-
% mkdir gcc-${gcc_version}-build
323-
% cd gcc-${gcc_version}-build
324-
% $PWD/../gcc-${gcc_version}/configure --prefix=$HOME/toolchains --enable-languages=c,c++
310+
% mkdir gcc-4.8.2-build
311+
% cd gcc-4.8.2-build
312+
% $PWD/../gcc-4.8.2/configure --prefix=$HOME/toolchains --enable-languages=c,c++
325313
% make -j$(nproc)
326314
% make install
327315
328316
For more details, check out the excellent `GCC wiki entry`_, where I got most
329317
of this information from.
330318

331319
.. _GCC wiki entry:
332-
https://gcc.gnu.org/wiki/InstallingGCC
320+
http://gcc.gnu.org/wiki/InstallingGCC
333321

334322
Once you have a GCC toolchain, configure your build of LLVM to use the new
335323
toolchain for your host compiler and C++ standard library. Because the new

0 commit comments

Comments
 (0)