Gradle shouldn't require C++ compiler to build pure C programs

On Linux with only gcc installed (without g++), Gradle fails to build any program because it attempts to call g++ to link the program.

The cause seems to be in:

subprojects/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/gcc, line 190 (checked out from master@aa7359f8525e560d4809887e8c0b227a0565319e).

The linker is hardcoded to “g++”. I think the solution would be to just change it to “gcc”, but I don’t know if “g++” does any different steps before calling the linker.

Gradle Version: 2.14.1
Operating System: Ubuntu GNU/Linux 16.04