I'm getting these errors in config.log when I try to build:

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
configure:4307: $? = 0
configure:4296: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4307: $? = 1
configure:4296: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:4307: $? = 1
configure:4327: checking whether the C compiler works
configure:4349: gcc -O2 -I/home/andrew/sudowrt-firmware/built_firmware/builder.ar71xx/staging_dir/host/include -I/home/andrew/sudowrt-firmware/built_firmware/builder.ar71xx/staging_dir/host/usr/include -I/home/andrew/sudowrt-firmware/built_firmware/builder.ar71xx/staging_dir/host/include -I/home/andrew/sudowrt-firmware/built_firmware/builder.ar71xx/staging_dir/host/usr/include -L/home/andrew/sudowrt-firmware/built_firmware/builder.ar71xx/staging_dir/host/lib -L/home/andrew/sudowrt-firmware/built_firmware/builder.ar71xx/staging_dir/host/usr/lib conftest.c  >&5
gcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
compilation terminated.
configure:4353: $? = 1
configure:4391: result: no


liblto_plugin.so is on my system in the PATH, so I'm kinda stumped. Also not sure what's going on with the 'unrecognized command line option' errors.

Earlier, it couldn't find the `cc1` binary, but I fixed that with a symlink. Not sure where I could add a symlink for this file, though. 

Any thoughts? I was able to build OpenWRT without a hitch, so I think the issue is in something SudoWRT is doing.


Andy