<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Feb 9, 2017 at 2:46 PM Tobias von Koch <<a href="mailto:tobias.von.koch@gmail.com">tobias.von.koch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On Wed, Feb 8, 2017 at 7:21 PM, Chandler Carruth <span dir="ltr" class="gmail_msg"><<a href="mailto:chandlerc@gmail.com" class="gmail_msg" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="m_7017874239008837365m_9143901571256477510m_-1562929267360893657gmail_msg gmail_msg">
+    // The Freescale PPC SDK has the gcc libraries in<br class="m_7017874239008837365m_9143901571256477510m_-1562929267360893657gmail_msg gmail_msg">
+    // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well.<br class="m_7017874239008837365m_9143901571256477510m_-1562929267360893657gmail_msg gmail_msg">
+    "/" + CandidateTriple.str(),<br class="m_7017874239008837365m_9143901571256477510m_-1562929267360893657gmail_msg gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So, this is really bad it turns out.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">We use this directory to walk every installed GCC version. But because this is just a normal lib directory on many systems (ever Debian and Ubuntu system for example) this goes very badly. It goes even more badly because of the (questionable) design of LLVM's directory iterator:</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">Wow, this is pretty bad, but it really sounds like the iterator should be fixed rather than trying to hack around it.</div></div></div></div></blockquote><div><br></div><div>I mean, we should.</div><div><br></div><div>But even then, walking the entire directory seems bad too... See below.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> Doesn't this happen for the other directories as well (which, admittedly, will have less entries)?</div></div></div></div></blockquote><div><br></div><div>The *only* entries in the other directories are the actual installed GCC toolchains though, so walking them makes a lot of sense. The tricky thing is that this isn't a gcc-specific directory.</div><div><br></div><div>I suspect the fix should be to not use this base path as part of the walk to discover GCC toolchains, and instead to hard code the specific toolchain patterns on this specific platform.</div><div><br></div><div>Or we could do the walk, but only when actually on the NXP/Freescale Power platform where this is necessary to find GCC installations.</div><div><br></div><div>Both of those would seem reasonable. Fixing the directory iterator would be icing on the cake IMO. =D</div></div></div>