Hello,
starting from 15.0.7, I contributed several patches for building
clang/llvm with Cygwin.
At that time, clang was the only way for building executables for
Windows On ARM64 without using MSVC, so I made some packages for
CYGWIN with the newer versions.
Nowaday, this is not true anymore because GCC15 allows to create an
aarch64-w64-mingw32 cross compiler that can be used for this purpose,
so I stopped to update it after version 18.

Me too I got the "export ordinal too large" error and unfortunately
there is not much to do for bypassing it if you build a monolithic
shared library.
However, there is another way for bypassing this issue, by creating
smaller shared libraries instead of a single gigantic DLL.
You can do it by adding:
 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
to CMake and it will work.

IMPORTANT:
If you have your locale set on a language different than english,
don't forget to add this environment variable:

export LANG=C

otherwise GNU LD won't be detected by CMake, see here:
https://github.com/llvm/llvm-project/issues/62634

I had contributed a patch for fixing it long time ago:
https://github.com/llvm/llvm-project/pull/95913
but unfortunately it has not been committed yet, as far as I know.

I hope that you will find it useful.

Sincerely,

Carlo Bramini.

Il giorno dom 13 apr 2025 alle ore 21:34 Jeremy Drake via Cygwin-apps
<cygwin-apps@cygwin.com> ha scritto:
>
> On Sat, 12 Apr 2025, Jeremy Drake via Cygwin-apps wrote:
>
> > Maybe setting -DCMAKE_CXX_STANDARD=20 would work around this?  It would at
> > least take a different path in that if/elif block in basic_string.
>
> It does indeed work around this, and builds a functional dylib llvm/clang
> on Cygwin.
>
> > But I
> > think we need to figure out why the extern template isn't working
> > regardless.
>
> I opened https://github.com/msys2/MSYS2-packages/issues/5329 .  If this
> reproduces with a mingw-w64 libstdc++ built with the gcc4 abi option,
> I would feel more comfortable opening an issue with llvm/llvm-project than
> I would for a target that already requires a bunch of non-upstreamed hacks
> to work at all.

Reply via email to