[llvm-dev] "Export ordinal too large" when linking LLVM.dll with MinGW64

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Fri Aug 23 12:47:59 PDT 2019


Ultimately I think LLVM needs to add export annotations to the source code.
This would drastically cut down on the number of exported symbols.

There was a recent attempt to start something like this in
https://reviews.llvm.org/D54439, but I guess it is currently reverted.

On Fri, Aug 23, 2019 at 1:36 AM Rui Ueyama via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> IIUC, it is the COFF file format limitation that you can export only up to
> 65535 symbols from a DLL. The Export Ordinal Table in the COFF file is an
> array of 16-bit indices to Export Address Table, so it can't export symbols
> more than 2^16. I don't know if there's a workaround for this issue -- I
> googled it and found that several open-source project faced the issue and
> some of them decided to split a DLL into multiple ones, but I don't think
> we want to do that...
>
> On Thu, Aug 15, 2019 at 5:01 AM Valentin Churavy via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Just ran into the same problem, but with `-DLLVM_BUILD_TOOLS=ON` since
>> the tools link against shlib and use the C++ interface I can't use Cosmin's
>> solution. I managed to get through with using `RelWithDebInfo` instead of
>> `Debug`
>>
>>
>>
>> On Sat, Jun 22, 2019 at 5:20 AM Cosmin Apreutesei via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>
>>> Update: looks like the the problem was that the cmake script in
>>> tools/llvm-shlib was set to export all symbols instead of just the C
>>> symbols, and those are way too many (max is 65535).
>>>
>>> Changing tools\llvm-shlib\simple_version_script.map.in to read "LLVM_8
>>> { global: LLVM*; local: *; };" fixed it for me and now I have a dll.
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190823/0898b783/attachment.html>


More information about the llvm-dev mailing list