During native compilation, is there a way to modify linker flags for a specific dependency?

Hello,

I am building some large shared libraries with GCC that have many native dependencies, and need to be able to toggle the -whole-archive flag for particular dependencies being fed to the linker. I have not found a way to achieve what I am looking for yet. Is there currently a way to do this, and if not is it planned for a future Gradle release?

Thanks! Paul