Bug#1052009: Provide compiler-rt builtins for windows/mingw-64

Norbert Lange nolange79 at gmail.com
Mon Jun 17 14:08:18 BST 2024


So, this went rather smooth. just had to copy over stuff from wasm.

The patch builds the compiler-rt libraries for windows. in short,
there will be 2 new files in libclang-rt-18-dev:

/usr/lib/llvm-18/lib/clang/18/lib/windows/libclang_rt.builtins-i386.a
/usr/lib/llvm-18/lib/clang/18/lib/windows/libclang_rt.builtins-x86_64.a

The result is that, aslong as mingw-w64-x86-64-dev is installed, this will work:
clang -rtlib=compiler-rt -target x86_64-w64-mingw test.cpp

Notably, I hard-coded those archs, windows support would make sense
for aarch64 and armv7 aswell.
I am unsure how the policy is, when to build which target
architecture, clang/llvm wont care.

maybe place all windows builtins into an libclang-rt-18-dev-w64
package for all architectures?

regards, Norbert

Am Di., 30. Apr. 2024 um 22:14 Uhr schrieb Norbert Lange <nolange79 at gmail.com>:
>
> Am So., 28. Apr. 2024 um 18:17 Uhr schrieb Sylvestre Ledru
> <sylvestre at debian.org>:
> >
> > Hello
> >
> >
> > Le 16/09/2023 à 00:29, Norbert Lange a écrit :
> > > Package: libclang-rt-16-dev
> > > Version: 1:16.0.6-3
> > > Severity: wishlist
> > > X-Debbugs-Cc: nolange79 at gmail.com
> > >
> > > Adding the compiler-rt library for windows / mingw-64 would allow ease building
> > > mingw-64 tools,
> > > the builtins seem to be pretty universal for any windows target.
> > >
> > > There is a project providing a full mingw toolchain for reference:
> > > https://github.com/mstorsjo/llvm-mingw
> > >
> > > I am able to create the builtins just with the mingw-w64-common package and
> > > debians llvm/clang like this:
> >
> > Sorry but I am not a windows user (or interested by this space), could
> > you please provide a MR to implement this?
>
> I am not windows user (or interested by this space) but I am forced to build
> for it and I prefer still staying away from that OS as much as possible.
>
> The package is a a bit of a monster though, both in complexity as well
> as build-time.
> Any tips for hacking around?
>
> Ill try to look at 'build-wasm/compiler-rt-%'.
>
> I am meant to use STAGE2 binaries? Are those the final ones?
>
> Given that clang is a native crosscompiler, I guess it makes sense providing
> the mingw builtins as "all" package like libclang-rt-18-dev-wasm32?
>
> Ill see if I  find time for that next week.
>
> Regards, Norbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm_add_win_compiler_rt.patch
Type: text/x-patch
Size: 3897 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20240617/7e16e26b/attachment.bin>


More information about the Pkg-llvm-team mailing list