#1129048 /usr/lib/x86_64-linux-gnu/libc++.modules.json contains incorrect paths

Package:
libc++-21-dev
Source:
libc++-21-dev
Description:
LLVM C++ Standard library (development files)
Submitter:
Boris Kolpackov
Date:
2026-03-03 08:37:01 UTC
Severity:
normal
#1129048#5
Date:
2026-02-26 11:32:43 UTC
From:
To:
Package libc++-21-dev contains two libc++.modules.json files:

$ dpkg -S libc++.modules.json
libc++-21-dev: /usr/lib/llvm-21/lib/libc++.modules.json
libc++-21-dev: /usr/lib/x86_64-linux-gnu/libc++.modules.json

While the first one looks good, the second contains incorrect paths:

$ cat /usr/lib/x86_64-linux-gnu/libc++.modules.json
[...]
"source-path": "../share/libc++/v1/std.cppm",
[...]

$ ls /usr/lib/x86_64-linux-gnu/../share/libc++/v1/std.cppm
ls: cannot access '/usr/lib/x86_64-linux-gnu/../share/libc++/v1/std.cppm': No such file or directory

Naturally, Clang chooses to print the path to the broken file:

$ clang++-21 -print-file-name=libc++.modules.json
/lib/x86_64-linux-gnu/libc++.modules.json

Feels like either Clang needs to be fixed to report the other file
(and the broken file probably removed) or the broken file needs to
be fixed.

BTW, this bug can be worked around with the following symlink:

# mkdir /usr/lib/share
# ln -s /usr/lib/llvm-21/share/libc++ /usr/lib/share/

#1129048#10
Date:
2026-03-03 08:26:16 UTC
From:
To:
BTW, the same issue is present in clang-22/libc++-22-dev versions
1:22.1.0-2.