Getting the compiler used to build a NativeBinarySpec

I am trying to build a plugin that needs to know the native compiler used to build a binary. I have access to a NativeBinarySpec, however nothing in there seems to give me access to the compiler used. Is there any way to get this? I am using Gradle 4.9.