gcc/mingw32: Do not export `HOST_EXTRA_OBJS_SYMBOL`

When building with `--enable-plugin`, the linker is passed `--export-all-symbols`
so it attempts to export `HOST_EXTRA_OBJS_SYMBOL` which is an artificial symbol
and is not prefixed with an underscore. For i686, the convention is that if the
linker is told to export `foo`, it looks for `_foo`. Therefore in this case it
attempts to export `_HOST_EXTRA_OBJS_SYMBOL` which isn't defined:

   ld.exe: cannot export HOST_EXTRA_OBJS_SYMBOL: symbol not found
   collect2.exe: error: ld returned 1 exit status

Since this symbol is only used to create a reference to pull in the manifest
resource for an image, the fix is to mark it as `visibility("hidden")` so it
will not be exported, despite `--export-all-symbols`.

In addition, since this is a C++ file, `extern "C"` is added for correctness.

gcc/ChangeLog:

	* config/i386/sym-mingw32.cc: Add `extern "C"` and `visibility("hidden")`.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
1 file changed