CMake fails to build on ppc64le
I found this issue when building 3.15.3 and it is also present in the current trunk code. On a Power9 (ppc64le) the ./bootstrap
is failing for me with:
CMake Error at CMakeLists.txt:92 (message):
The C++ compiler does not support C++11 (e.g. std::unique_ptr).
I am using GCC 8.3.0 on Red Hat Enterprise Linux Server 7.6.
If I remove the block of code starting at https://gitlab.kitware.com/cmake/cmake/blob/master/CompileFlags.cmake#L56 then the build succeeds and I've used the CMake produced to build other software.
CMakeFiles/CMakeError.log
after failure - and how I worked out what to remove to get the build to work:
Determining if compiler supports C++ make_unique failed with the following output:
Change Dir: /rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_943a5/fast && gmake -f CMakeFiles/cmTC_943a5.dir/build.make CMakeFiles/cmTC_943a5.dir/build
gmake[1]: Entering directory `/rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_943a5.dir/cm_cxx_make_unique.cxx.o
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/GCCcore/8.3.0/bin/g++ -std=gnu++17 -o CMakeFiles/cmTC_943a5.dir/cm_cxx_make_unique.cxx.o -c /rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/Source/Checks/cm_cxx_make_unique.cxx
Linking CXX executable cmTC_943a5
/rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_943a5.dir/link.txt --verbose=1
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/GCCcore/8.3.0/bin/g++ -Wl,--no-multi-toc CMakeFiles/cmTC_943a5.dir/cm_cxx_make_unique.cxx.o -o cmTC_943a5
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/binutils/2.32-GCCcore-8.3.0/bin/ld.gold: --no-multi-toc: unknown option
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/binutils/2.32-GCCcore-8.3.0/bin/ld.gold: use the --help option for usage information
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_943a5] Error 1
gmake[1]: Leaving directory `/rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_943a5/fast] Error 2
Determining if compiler supports C++ unique_ptr failed with the following output:
Change Dir: /rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_ee1e5/fast && gmake -f CMakeFiles/cmTC_ee1e5.dir/build.make CMakeFiles/cmTC_ee1e5.dir/build
gmake[1]: Entering directory `/rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_ee1e5.dir/cm_cxx_unique_ptr.cxx.o
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/GCCcore/8.3.0/bin/g++ -std=gnu++17 -o CMakeFiles/cmTC_ee1e5.dir/cm_cxx_unique_ptr.cxx.o -c /rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/Source/Checks/cm_cxx_unique_ptr.cxx
Linking CXX executable cmTC_ee1e5
/rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_ee1e5.dir/link.txt --verbose=1
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/GCCcore/8.3.0/bin/g++ -Wl,--no-multi-toc CMakeFiles/cmTC_ee1e5.dir/cm_cxx_unique_ptr.cxx.o -o cmTC_ee1e5
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/binutils/2.32-GCCcore-8.3.0/bin/ld.gold: --no-multi-toc: unknown option
/rds/bear-apps/devel/2019b/branfosj-eb-2/EL7/EL7-power9/software/binutils/2.32-GCCcore-8.3.0/bin/ld.gold: use the --help option for usage information
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_ee1e5] Error 1
gmake[1]: Leaving directory `/rds/projects/2017/branfosj-rse/ProblemSolving/cmake/cmake/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_ee1e5/fast] Error 2
The --no-multi-toc
is not an option in the ld.gold
:
$ ld.gold --help | grep toc
--toc-optimize (PowerPC64 only) Optimize TOC code sequences (default)
--no-toc-optimize (PowerPC64 only) Don't optimize TOC code sequences
--toc-sort (PowerPC64 only) Sort TOC and GOT sections (default)
--no-toc-sort (PowerPC64 only) Don't sort TOC and GOT sections
It does appear in ld.bfh
:
$ ld.bfd --help | grep toc
--no-toc-optimize Don't optimize the TOC section
--no-multi-toc Disallow automatic multiple toc sections
--no-toc-sort Don't sort TOC and GOT sections
--no-toc-optimize Don't optimize the TOC section
--no-multi-toc Disallow automatic multiple toc sections
--no-toc-sort Don't sort TOC and GOT sections