ld libSDL2.a
will try to produce an executable out of just the SDL2 static library, so that’s not going to work unless you also link in a main program.
I tried brew install --build-from-source sdl2
and then this:
$lipo -info libSDL2.a
input file libSDL2.a is not a fat file
Non-fat file: libSDL2.a is architecture: x86_64
This recent commit removed -fpascal-strings
so current HG may build with gcc now.