Anyone have a moment to take a look at the CI failure for https://github.com/WebAssembly/wasi-libc/pull/270 ? I was getting there is with my (admitting highly nonstandard) toolchain before my change. So I am a confused what's up.
I think I am using -isysroot wrong, but I do not understand how the --sysroot prior worked either the more I read the sparse GCC and Clang documentation on this. I would like to replace both with a plain old -I, but then I get another spooky error.
In particular __strong_reference is only used in _Exit.c and nanosleep.c, and those files don't seem to (before or after) get the include needed for __strong_reference's CPP definition, and yet it worked before.
"-isysroot "/home/runner/work/wasi-libc/wasi-libc/sysroot/include"
should this be " -isysroot "/home/runner/work/wasi-libc/wasi-libc/sysroot", without the trailing include? the docs for -isysroot say it works like -sysroot, which suggests it inteprrets the path as the root of the sysroot
So I think "-isysroot "/home/runner/work/wasi-libc/wasi-libc/sysroot" would work for CI.
but the docs also talk about things like $sysroot/usr/include. And neither works in my local build! I think sysroot is very magic in that the paths that it looks for within the sysroot are somehow configurable.
hrm, I've not encountered things looking for "usr" inside sysroot. That's... unfortunate.
So yeah in conclusion it would be nice to just use plain old -I
an avoid all that spooky ambient configuration that effects what exactly "sysroot" things do.
Yeah, or -isystem so that it does the right thing wrt <....h> includes
But then, I get the __strong_reference error. In fact, -I ... -isysroot together also causes the __strong_reference error! madness!
what is the __strong_reference error?
Dan Gohman said:
Yeah, or
-isystemso that it does the right thing wrt<....h>includes
What exactly do you mean? <...> vs ".."?
Yeah. -isystem is like -I but marks the directory as a "system" include directory.
John Ericson said:
In particular
__strong_referenceis only used in_Exit.candnanosleep.c, and those files don't seem to (before or after) get the include needed for__strong_reference's CPP definition, and yet it worked before.
It doesn't get the macro def and at least one of those two files fail to build.
Dan Gohman said:
Yeah.
-isystemis like-Ibut marks the directory as a "system" include directory.
there is also -Iquote and -isystem.
I will try some of those
Include directories provided by wasi-libc should be treated as "system" directories.
OK -isystem + -isysroot worked!
Now trying just -isystem.
-I does affect <...> lookup too. I think Postel's law muddled the distinctions long ago :) but I will check the docs.
Yeah I forget the exact rules because srsly
OK! -isystem alone works, and -idirafter also works.
So the issue wasn't "systemness" but order --- that the other -I must override this. Yuck!!!
Wrote a big fat comment and pushed :).
Last updated: Dec 06 2025 at 06:05 UTC