This relands commit 73134743. It failed on Windows/Mac because `-fjmc` is only checked for ELF targets. Check the flag unconditionally instead and issue a warning for non-ELF targets.