It's still possible to override it, just use -optl-Wl,-soname, eg:
ghc -shared -dynamic foo.o -o libfoo.so -optl-Wl,-soname,libbar.so
md_c_flags
++ o_files
++ [ "-shared", "-Wl,-Bsymbolic" ] -- we need symbolic linking to resolve non-PIC intra-package-relocations
md_c_flags
++ o_files
++ [ "-shared", "-Wl,-Bsymbolic" ] -- we need symbolic linking to resolve non-PIC intra-package-relocations
+ ++ [ "-Wl,-soname," ++ takeFileName output_fn ] -- set the library soname
++ extra_ld_inputs
++ lib_path_opts
++ extra_ld_opts
++ extra_ld_inputs
++ lib_path_opts
++ extra_ld_opts