Bug#1057838: clang-17: c++ include dir from sysroot unexpectedly in include paths when in wasm c mode

Israel Galadima izzygaladima at gmail.com
Sat Dec 9 11:45:12 GMT 2023


Package: clang-17
Version: 1:17.0.6-1
Severity: important
X-Debbugs-Cc: izzygaladima at gmail.com

Dear Maintainer,

When I checked the include paths for clang-17 in c mode with wasm target and sysroot,
I saw the c++ include dir from the sysroot among the include paths.

$ clang-17 -target wasm32-unknown-emscripten --sysroot=/home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot -E - -v
Debian clang version 17.0.6 (1)
Target: wasm32-unknown-emscripten
...
...
...
ignoring nonexistent directory "/home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/local/include/wasm32-emscripten"
ignoring nonexistent directory "/home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/local/include"
ignoring nonexistent directory "/home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/include/wasm32-emscripten"
ignoring nonexistent directory "/home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/include/c++/v1/backward" # I did not expect this to be here
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/llvm-17/lib/clang/17/include
 /home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/include/c++/v1 # I did not expect this to be here
 /home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/include
End of search list.

I didn't expect to see /home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/include/c++/v1
in the include paths.
I didn't expect clang to attempt to add /home/izzygala/node-packaging/emscripten/emscripten/cache/sysroot/include/c++/v1/backward
to the include paths.

I tried the same setup with a pre-built clang binary on Windows and it does not add the c++ include
dir from the sysroot to the include paths for c mode with wasm target and sysroot.

PS C:\Users\Isreal Galadima\Documents\Code\emscripten> clang -target wasm32-unknown-emscripten --sysroot="C:/Users/Isreal Galadima/Documents/Code/emscripten/cache/sysroot" -E - -v
clang version 17.0.6
Target: wasm32-unknown-emscripten
Thread model: posix
...
...
...
ignoring nonexistent directory "C:/Users/Isreal Galadima/Documents/Code/emscripten/cache/sysroot/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
 C:\Program Files\LLVM\lib\clang\17\include
 C:/Users/Isreal Galadima/Documents/Code/emscripten/cache/sysroot/include
End of search list.

I think this [1] patch on Salsa may be the cause. Thanks.


1. https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/17/debian/patches/wasm/wasm-sysroot-usr.diff

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.15.123.1-microsoft-standard-WSL2 (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages clang-17 depends on:
ii  binutils                2.41.50.20231202-1
ii  libc6                   2.37-13
ii  libc6-dev               2.37-13
ii  libclang-common-17-dev  1:17.0.6-1
ii  libclang-cpp17          1:17.0.6-1
ii  libclang1-17            1:17.0.6-1
ii  libgcc-13-dev           13.2.0-8
ii  libgcc-s1               13.2.0-8
ii  libllvm17               1:17.0.6-1
ii  libobjc-13-dev          13.2.0-8
ii  libstdc++-13-dev        13.2.0-8
ii  libstdc++6              13.2.0-8
ii  llvm-17-linker-tools    1:17.0.6-1

Versions of packages clang-17 recommends:
ii  llvm-17-dev  1:17.0.6-1
ii  python3      3.11.6-1

Versions of packages clang-17 suggests:
pn  clang-17-doc  <none>
pn  wasi-libc     <none>

-- no debconf information



More information about the Pkg-llvm-team mailing list