Unpleasantly late ROOT 6.10.04 compilation error with GCC 7.1

Looks like all your problems stem from your gcc distribution. The CMake file shipped with ROOT copies the wchar.h file from your distribution before compilation (core/clingutils/CMakeLists.txt):

# These headers do not have complete include guards on all platforms we
# support. This means that the PCH cannot provide their representation at
# runtime and clang will hit disk, triggering a possible incompatibility
# of that file in build-time versus run-time (different length etc).
# Capture their build-time version here, and inject it into runtime.
foreach(file wchar.h bits/stat.h bits/time.h)
  if(EXISTS /usr/include/${file})
    list(APPEND copy_commands COMMAND ${CMAKE_COMMAND} -E copy /usr/include/${file} ${CMAKE_BINARY_DIR}/etc/cling/lib/clang/${LLVM_VERSION}/include/${file})
  endif()
endforeach()

Maybe you have clashing gcc packages? (EDIT: This was the issue with OP.) Have you tried building something simple that use the string header?