Building Blender from source with static linking
The most relevant line here is: 

lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005 Please submit a full bug report

The compiler has hit code that caused it to fail.  It's not possible to continue this build without fixing the compiler, or changing compilers.

I encourage you to submit a bug report.  gcc-7 is still widely deployed and this will definitely get looked at.