<div dir="ltr"><div dir="ltr">Darwin has really weird behavior for "-isysroot", I think for some historical reason, I'm not really sure. I believe it was added to Clang to be compatible with the behavior of Darwin GCC. But I don't know why Darwin GCC did this.</div><div dir="ltr"><br></div><div dir="ltr">Usually, -isysroot is the sysroot used only for looking for header files, and if -isysroot isn't specified, then the value specified by --sysroot is used for header searching also. But, on darwin, -isysroot almost acts as an alias for --sysroot, in that it applies to libraries as well. Unless --sysroot is specified, in which case that takes precedence for libraries. Darwin also has a bunch of weird magic for inferring the default "-target" argument, based on the path name passed to -isysroot.</div><div dir="ltr"><br></div><div>So, this is what you're seeing: the test is asserting that running "clang -isysroot FOO" will look in the directory FOO for libraries, on Darwin. But because you've built it with a default sysroot value, that no longer occurs -- now it's going to look for libraries in your default sysroot, instead. So, this does indicate an actual problem, but it may well be that none of your users rely on this weirdness, and therefore maybe it's fine that this test is broken.</div><div></div><div><br></div><div>It'd be really nice if all of that weirdness could be removed from the Darwin code, and sysroot and isysroot would just act as they do everywhere else. But I have no idea if that'd break things.</div><div><br></div><div>As for the other failures: at least some of those (if not all) seem to be harmless test fragility -- they are assuming sysroot is unset by default, which then implies that Clang will go looking next to its own directory for various bits and pieces. If you're configuring a clang distribution with a default sysroot, then that's probably reasonably expected that it not do that. These tests could probably be repaired by adding "--sysroot=" to the command line. (But, note: I haven't actually investigated them all.)</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 1, 2020 at 12:52 PM <a href="mailto:llvm@dyatkovskiy.com">llvm@dyatkovskiy.com</a> via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi!</div><div> </div><div>We've just tried to setup "DEFAULT_SYSROOT" in cmake while compiling clang for Darwin and bumped into several test failures.</div><div> </div><div>Most indicating is a "sysroot.c" failure:<div><a href="https://pastebin.com/Bh1eVRb4" target="_blank">https://pastebin.com/Bh1eVRb4</a></div><div> </div><div>It seems that one of subtests passes "--isysroot" into the driver call, and expects that driver will pass the same value into "-syslibroot" for linker. But as long as default sysroot has been specified, it overwhelms "--isysroot" impact on linker and thus bypass another string into "-syslibroot".</div><div> </div><div>Another question. Why such tests relies on a logic, that if you pass cc1 related parameter into the driver it should bypass it into the linker. Obviously it is a very fragile assumption, or I miss something and there is special role for "isysroot" while passing to driver?</div><div> </div><div>Thanks!</div><div> </div><div>Also here is a check-clang log with full list of failures:</div><div> </div><div><a href="https://pastebin.com/GxPcS5sf" target="_blank">https://pastebin.com/GxPcS5sf</a></div><div> </div><div>And this is a CI job which fails:</div><div> </div><div><a href="https://github.com/spacemaze/cppl/actions/runs/148363495" target="_blank">https://github.com/spacemaze/cppl/actions/runs/148363495</a></div> <div>-Stepan Dyatkovskiy</div></div>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>