Wrap each avr toolchain binary with a script that spies and reports on its command line arguments:
cd arduino-1.8.13/hardware/tools/avr
mv bin bin.real
mkdir bin
cd bin
cp path/to/wrapper .
chmod +x wrapper
ls ../bin.real | xargs -n 1 -I % ln -s wrapper %
Compile, and see what happened:
cat /tmp/avr.*
The build artefacts in /tmp/arduino_build_??????
are also useful.