By using GCC 6.2 to build master (also 7.90.x and 7.02) I stumbled because of some non C++11 conform code fragments in Kodi.
Just yesterday I build imx6 master and didn't have any problem. Also not with any 7.0.X or 7.9X.Y.
What is your build system? Could you post log of the error?
How did you remove the JAVA path fragments?
You could set shorter path in start of file scripts/image
Or you could just build like