Hi!

  PR42904 is a bug where, when compiling a windows DLL using -fwhole-program,
the compiler optimises away the entire library body, because there's no
dependency chain related to 'main' to anchor it.

  It's pointed out that we could perhaps resolve this by inferring attribute
externally_visible anywhere we see dllexport is applied, but I wondered
whether Linux (or any other target) does anything like this (perhaps based on
default visibility or explicit attributes?), or if you are just expected to
annotate all your externally-visible functions if you want to be able to
meaningfully combine -fwhole-program with -shared compilation?

    cheers,
      DaveK


Reply via email to