# Webp and windows clang-cl 20

**URL:** <https://forum.juce.com/t/webp-and-windows-clang-cl-20/69748>\
**Category:** General JUCE discussion\
**Created:** [October 19, 2026, 3:10pm UTC](https://forum.juce.com/t/webp-and-windows-clang-cl-20/69748 "2026-10-19T15:10:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudara](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sudara/32/8071_2.png) [@sudara](https://forum.juce.com/u/sudara)\
**Post date:** [October 19, 2026, 3:10pm UTC](https://forum.juce.com/t/webp-and-windows-clang-cl-20/69748/1 "2026-10-19T15:10:16Z")

</div>

Howdy howdy!

On Windows with clang-cl from LLVM 19 or 20, the bundled libwebp SSE4.1 and AVX2 sources fail to compile for me, with:

```auto
C:\Program Files\LLVM\lib\clang\20\include\rtmintrin.h(36,1): error: attribute 'target' multiversioning cannot be combined with attribute 'always_inline'
C:\Program Files\LLVM\lib\clang\20\include\intrin.h(166,6): note: function multiversioning caused by this declaration

```

Meat proxy details:

1. Each file wraps libwebp in `#pragma clang attribute push ( __attribute__ ((target ("sse4.1"))), apply_to=function)`. The AVX2 files use `"avx2"`.
2. libwebp’s `src/utils/utils.h` includes `<intrin.h>` when `_MSC_VER` is defined. So under clang-cl, that include happens inside the pragma region.
3. In LLVM 19 and 20, `intrin.h` line 166 declares `void _xend(void);`. The pragma gives that declaration `target("sse4.1")`.
4. `rtmintrin.h` defines `_xend` with `target("rtm")` and `always_inline`. Clang reads the two target attributes as function multiversioning, which it can’t combine with `always_inline`.

My current workaround: [WebP: Include \<intrin.h\> before the SIMD target attribute so clang-cl… · sudara/JUCE@d6c4023 · GitHub](https://github.com/sudara/JUCE/commit/d6c4023ddf2c8d0ba32336a87f2efcf4d26af69a)

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [October 20, 2026, 7:21pm UTC](https://forum.juce.com/t/webp-and-windows-clang-cl-20/69748/2 "2026-10-20T19:21:10Z")

</div>

Thank you for reporting this issue 😉

I have a newer clang-cl on my machine but I think this patch should fix this problem. Can you check this with your clang-cl version?

[fix.patch](https://forum.juce.com/uploads/short-url/nknLvAuiEMZsCvfNRggv8sTsNCb.patch) (1.6 KB)

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [October 21, 2026, 8:38am UTC](https://forum.juce.com/t/webp-and-windows-clang-cl-20/69748/3 "2026-10-21T08:38:11Z")

</div>

I did manage to repro the issue and test the build using clang-cl 20.

---

<div class="post-metadata">

**Author:** ![sudara](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sudara/32/8071_2.png) [@sudara](https://forum.juce.com/u/sudara)\
**Post date:** [October 21, 2026, 1:36pm UTC](https://forum.juce.com/t/webp-and-windows-clang-cl-20/69748/4 "2026-10-21T13:36:47Z")

</div>

That patch does the trick for me. Thanks Attila!

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [October 21, 2026, 2:00pm UTC](https://forum.juce.com/t/webp-and-windows-clang-cl-20/69748/5 "2026-10-21T14:00:26Z")

</div>

A fix is now out on develop

> <https://github.com/juce-framework/JUCE/commit/46561f27af02bab50bd8c781e39f85db3a98b7d0>
>
> Newer clang versions don't require this fix.
> 
> libwebp includes \<intrin.h\> when \_…MSC\_VER is defined. Under clang-cl this
> caused the sse4.1/avx2 target attribute used for the SIMD sources to be
> applied to the declarations in \<intrin.h\> as well. LLVM 19 and 20 declare
> \_xend there, and its always\_inline definition in rtmintrin.h carries a
> different target attribute. Clang treats this as function multiversioning
> and fails with:
> 
> attribute 'target' multiversioning cannot be combined with attribute
> 'always\_inline'
> 
> Including \<intrin.h\> before the target attribute is applied keeps its
> declarations unaffected.
