Your message dated Fri, 07 Oct 2022 21:46:42 +0000
with message-id <[email protected]>
and subject line Bug#1020746: fixed in llvm-toolchain-14 1:14.0.6-3
has caused the Debian Bug report #1020746,
regarding wasm32-unknown-wasi target attempts to use non-existing include paths
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1020746: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1020746
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: clang-14
Version: 1:14.0.6-2
Severity: normal

Attempting to build a trivial "hello world" program for
the wasm32-unknown-wasi target with:
  clang -v -target wasm32-linux-wasi -o test.wasm test.c

...results in a cc1 command-line that includes:
   -internal-isystem /include/wasm32-wasi -internal-isystem /include
...naturally followed by:
  ignoring nonexistent directory "/include/wasm32-wasi"
  ignoring nonexistent directory "/include"

If one were to pass "-I/usr/include/wasm32-wasi" to work around this, it
becomes apparent that a similar situation is the case for -L:
  wasm-ld-14 ... -L/lib/wasm32-wasi /lib/wasm32-wasi/crt1-command.o ...

Looking at the source, sysroot is prepended on these paths, and seems to
be implied to be always expected. Presumably this originated in a world
where folks had the WASI SDK (and wasi-libc) installed in /opt.

In Debian, the wasi-libc package (the libc for this platform) uses the
/usr/include/wasm32-wasi and /usr/lib/wasm32-wasi paths. Apparently
passing --with-sysroot=/usr works around this issue, pointing clang to
the right paths in Debian.

However, it would be ideal if that indirection was not necessary, and
clang did the right thing out of the box, instead of attempting to
access nonexisting unprefixed paths like /include/.

An example, *untested* kinda hacky fix for this could take the form of
adding this to clang/lib/Driver/ToolChains/WebAssembly.cpp:

  std::string WASI::computeSysRoot() const {
    if (!getDriver().SysRoot.empty())
      return getDriver().SysRoot;
  
    std::string Path = "/usr";
    if (getVFS().exists(Path))
      return Path;
  
    return std::string();
  }

Also see #1014567 which describes my confusion upon encountering
wasi-libc. It can be resolved if this bug is accepted, or repurposed to
be a documentation wishlist bug.

Finally, note that even with the fix described in this bug, compilations
to the wasm32-linux-wasi target will not work until #1010932
(availability of compiler-rt for wasm32) is resolved.

Regards,
Faidon

--- End Message ---
--- Begin Message ---
Source: llvm-toolchain-14
Source-Version: 1:14.0.6-3
Done: Sylvestre Ledru <[email protected]>

We believe that the bug you reported is fixed in the latest version of
llvm-toolchain-14, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sylvestre Ledru <[email protected]> (supplier of updated llvm-toolchain-14 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 30 Aug 2022 16:10:33 +0200
Source: llvm-toolchain-14
Architecture: source
Version: 1:14.0.6-3
Distribution: unstable
Urgency: medium
Maintainer: LLVM Packaging Team <[email protected]>
Changed-By: Sylvestre Ledru <[email protected]>
Closes: 1004112 1010932 1018770 1020746 1020847
Changes:
 llvm-toolchain-14 (1:14.0.6-3) unstable; urgency=medium
 .
   * Fix a typo to silent lintian (Closes: #1018770)
   * Fix some hardcoded paths (Closes: #1020847)
   * Suggest wasi-libc for clang
 .
   [ Witold Baryluk ]
   * Allow libunwind-dev to be coinstallable (Closes: #1004112)
 .
   [ Faidon Liambotis ]
   * Add better support for the WebAssembly (wasm32/wasm64) targets:
     - Ship compiler-rt for the wasm32 and wasm64 targets. (Closes: #1010932)
     - Add patch wasm-compiler-rt-default.diff to default to compiler-rt for
       these targets. libgcc does not currently exist for WebAssembly in neither
       Debian nor upstream, and therefore compiler-rt is the only option.
     - Add patch wasm-sysroot-usr.diff to support a system-installed (i.e. 
shipped
       in /usr) wasi-libc. (Closes: #1020746)
Checksums-Sha1:
 098adf2679323dd7c5b3b1b184ee02c633cd69df 7205 llvm-toolchain-14_14.0.6-3.dsc
 bd6cabea5a20c420f36050a11fa6fa7c68628fbd 154056 
llvm-toolchain-14_14.0.6-3.debian.tar.xz
 8f70b2ce2cb805525c34aded63924a729036f51c 30993 
llvm-toolchain-14_14.0.6-3_amd64.buildinfo
Checksums-Sha256:
 4e0679c9b9e6ae0d3829118976fad210a3dba72ba7db7ad0d5aef33a99d500e1 7205 
llvm-toolchain-14_14.0.6-3.dsc
 968c214a20ec50821e62178508541e1017ae33f39d18c23788a289c5173a7820 154056 
llvm-toolchain-14_14.0.6-3.debian.tar.xz
 8be4b307a7ccfc7e738ad101397f0b8f3c8c9ac2c9e0e431361ae084bc54884f 30993 
llvm-toolchain-14_14.0.6-3_amd64.buildinfo
Files:
 728e1cde592b075891f83f72ec6cc130 7205 devel optional 
llvm-toolchain-14_14.0.6-3.dsc
 9d37910e7d446329c560300f1bc3ed5b 154056 devel optional 
llvm-toolchain-14_14.0.6-3.debian.tar.xz
 aa04b76d7aa8bd41a99a21b3f65a3ca9 30993 devel optional 
llvm-toolchain-14_14.0.6-3_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEtg21mU05vsTRqVzPfmUo2nUvG+EFAmNAlg4ACgkQfmUo2nUv
G+Edjg//d+eHMocD/oo3TybedE3coqVkU3Arf0uzj7+HxEJsFD2gRwYS2JdQtFHe
FplDSMlW8APsvTjof2lV4ldyzUAkU3A5KNajljTeZjB1csRTjtn2rrnTSsALUBRD
+oltgP0CHUYRFLH+vyWotX/xTzt8NBF0hctENgDodLuiFC6iESeDjqN+dc8PhVOV
QG4Lv2d1CKkFaC4ExBt+SJlzRAd8ONLZUCHmBktrG2hHyqljL/pDi4qPfzB+I3vz
uis8/IDVVEnLiVMf3tElblSEfGb0tZ50P5IMQnFpSz0qVjV/vHCjqt5c4Vn8Vfj4
pK34mHGXx4bgsECg33zUhCTzR5Orsqyq0PDxX3G5OP6T2ldKqlrRhzYeQlX4bHv7
Y+jVnuiq6KgCJ51zNAYWFBjhY4pF+lCVTR+Vohw9Ob4NIT35k+tX+qxr4b6yOXxk
rlNV1sY/JCWDkNvZCfsiyjQXeg6OOX68T00/JBaapy0ef3oKftKETu4i/7gQgAZH
CaUeyrYDLrr42+Z72BhnnJARbJLHH+6r+Yf0zD01Vi7U5KUMcTwhDDb44EbVy0E5
AKdG/cwnUkNFcrm57iTbDbO5Oeyu1KcqHh8PDnooMiVs6t6HYF5GoYbrkV/gFMee
Rd8wPKsJwEp8xRkxCW+8JdDrkRm8q/BXt6rAVf4CGbQoamDD+Cs=
=dJIP
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to