gccspec.c assumes that it can detect Objective-C files because they have a .m extension, but a user can pass '-ObjC' or '-x objective-c' or '-x c' to override the extension.
Confirmed, via a dicussion that is going on the gnustep mailing list. The reason why most people don't see an issue with this anymore is because Linux uses --as-needed option to the linker.
The file is now c/gccspec.cc but the check there is still the same for .m/.mi and does not check for -x or -ObjC