iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.84k stars 611 forks source link

Fail to build WebGPU backend tint library with clang-16 #16045

Open hcindyl opened 10 months ago

hcindyl commented 10 months ago

What happened?

libtint is used to build WebGPU target plugins. However, the pinned commit https://dawn.googlesource.com/tint/+/fdb8787e9c1b79770bd98a8faf37fbe48a3077a4 hit unsafe buffer usage warning when build with clang16+, see

https://gist.github.com/hcindyl/d33a17b365e00f54cadec1e300237980

The faulty code was no longer at dawn tint ToT. Unfortunately, at tint ToT libtint requires abseil source code to be synced first to its third_party link, which can't be supported from FetchContent_Declare macro https://github.com/openxla/iree/blob/ef8982c4171c37129e195376af8ca4dd154710f3/compiler/plugins/target/WebGPU/tint/CMakeLists.txt#L8-L13

Steps to reproduce your issue

export CC=clang-16 export CXX=clang++-16 build_tools/cmake/build_host_tools.sh

What component(s) does this issue relate to?

Compiler

Version information

No response

Additional context

No response

hcindyl commented 10 months ago

@ScottTodd FYI.

hcindyl commented 10 months ago

The warning only exists in clang16+ initial commit. It may not be a bug for most users now, but as clang-16 rolled out to the Linux distributions (it is the default for debian testing), more users will hit it.