On 8/12/26 07:50, LIU Hao wrote:
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")`.

Thanks, pushed to master branch.

Reply via email to