After adding -save-temps to CXX_DEFINES in build/src/osg/CMakeFiles/osg.dir/flags.make all the files of libosg compiles fine:
Linking CXX shared library ../../lib/libosg.so [ 14%] Built target osg
It seems adding -save-temps to compilation flags workaround the internal compiler errors.
After adding -save-temps to CXX_DEFINES in build/src/ osg/CMakeFiles/ osg.dir/ flags.make all the files of libosg compiles fine:
Linking CXX shared library ../../lib/libosg.so
[ 14%] Built target osg
It seems adding -save-temps to compilation flags workaround the internal compiler errors.