https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87190
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.org --- Comment #2 from Alexander Monakov <amonakov at gcc dot gnu.org> --- In the future please consider making reports more concise and to the point. > $ gcc -fvisibility=hidden -shared bar.c ./libfoo.a -o libbar.so Here a good solution is to ensure libfoo's symbols have hidden visibility in the first place, not have the linker downgrade it. I agree the documentation could be improved with examples to better showcase good practices. > If someone is willing to make the leap that GCC should take the > -fvisibility=hidden compiler option and turn it into a linker option like > -Wl,--exclude-libs,All Please no. -fvisiblity= takes 4 different values, and having some of them implicitly turn on a linker option, but only on gnu-compatible linkers, is ridiculous. Orthogonal, easy-to-explain options are good.