Skip to contentSkip to conversation

LLVM 21 compatibility issue with swab.h

DISCUSSION Theron York 2 participants 2 messages May 29

lore
Share & tools
lore
#0 lore raw

Hello,

Building Linux kernel 7.0.6 on Gentoo with LLVM  fails:
  error: unknown type name '__attribute_const__'

Setup:
- Gentoo Linux
- LLVM 21 (clang)
- musl libc
- x86_64

Workaround:
  sed -i 's/__attribute_const__/__attribute__((const))/g' ./include/uapi/linux/swab.h

Thanks,
Theron York

#1 lore raw

Hi Theron,

Quoted 9 lines · Theron York

Building Linux kernel 7.0.6 on Gentoo with LLVM  fails:
  error: unknown type name '__attribute_const__'

Setup:
- Gentoo Linux
- LLVM 21 (clang)
- musl libc
- x86_64

Quoted 3 lines

Workaround:
  sed -i 's/__attribute_const__/__attribute__((const))/g' ./include/uapi/linux/swab.h

can you post all the commands you are executing from a clean source checkout *and* the full error message?
That will make it much easier to help you.

Thomas