dev-util/cmake-3.9.6 , dev-util/cmake-3.10.2 , dev-util/cmake-3.11.4 , dev-util/cmake-3.12.0_rc2 somehow have the same problem for me during the compilation. Because of the last message before error I think it occures in the makefile. Reproducible: Always Steps to Reproduce: 1.emerge --ask --verbose ~dev-util/cmake-3.9.6 2.hit enter 3.wait to the until ~80-90% compiled Actual Results: make: *** [Makefile:163: all] Error 2 * ERROR: dev-util/cmake-3.9.6::gentoo failed (compile phase): Expected Results: Everything compiled, I'm satisfied. Before that I had no cmake somehow so I downloaded (without merging) cmake 3.8.2, but as I suspect it isn't related to the bug in the makefile, if it is makefile's problem. Before that I also had a bug with rhash lib while compiling cmake, but version recommended to merge in other bug report helped. After the first fail I have got latest snapshot & did emerge --sync.
Created attachment 538408 [details] log of emerge emerge --verbose ~dev-util/cmake-3.12.0_rc2 call list, as I think potential error is in the end.
Created attachment 538410 [details] emerge --info output
From the build log: [ 76%] Linking CXX executable ../bin/cmake cd /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/Source && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmake.dir/link.txt --verbose=1 /usr/bin/i686-pc-linux-gnu-g++ -O1 -march=i386 -pipe -Wl,-O1 -Wl,--as-needed -rdynamic CMakeFiles/cmake.dir/cmakemain.cxx.o CMakeFiles/cmake.dir/cmcmd.cxx.o -o ../bin/cmake libCMakeLib.a kwsys/libcmsys.a -ldl -lexpat -lz -larchive ../Utilities/cmcompress/libcmcompress .a -lcurl ../Utilities/cmjsoncpp/libcmjsoncpp.a /usr/lib/librhash.so libCMakeLib.a(cmGeneratedFileStream.cxx.o): In function `std::locale::locale<codecvt>(std::locale const&, codecvt*)': cmGeneratedFileStream.cxx:(.text._ZNSt6localeC2I7codecvtEERKS_PT_[_ZNSt6localeC5I7codecvtEERKS_PT_]+0xf6): undefined reference to `__atomic_fetch_add_4' collect2: error: ld returned 1 exit status make[2]: *** [Source/CMakeFiles/cmake.dir/build.make:130: bin/cmake] Error 1 make[2]: Leaving directory '/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build' make[1]: *** [CMakeFiles/Makefile2:1540: Source/CMakeFiles/cmake.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....
Created attachment 574090 [details] build.log
Created attachment 574092 [details] emerge --info
I understand that on i386, explicit linking to libatomic is required while not necessary on i586 and later. Is there any particular reason you're using -march=i386 instead of -march=1686?