This mode never works (mismatching crtbeginT.o and crtendS.o) and probably unsupported by GCC on glibc based Linux distro (incorrect crtbeginT.o causes linker error) but makes sense (-shared means building a shared object, -static means avoid shared object dependencies) and can be used on musl based Linux distro. mingw supports this mode as well.