I have an Arduino based board using ATmega168PB, but so far only Atmel's provided toolchain supports this microcontroller. I can download the toolchain from Atmel's website, but I am not sure how to make the Arduino environment use it.
In the directory for the new core create a new
platform.txt and give the entry for
compiler.path the location of the
bin/ directory containing the Atmel toolchain.