<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Nov 7, 2018 at 10:32 AM Mikael Holmén via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">uabelho added a comment.<br>
<br>
Hi,<br>
<br>
I've got a post-review comment about the use of SCHED_IDLE vs the needed gcc version.<br>
<br>
<br>
<br>
================<br>
Comment at: clang-tools-extra/trunk/clangd/Threading.cpp:110<br>
+      T.native_handle(),<br>
+      Priority == ThreadPriority::Low ? SCHED_IDLE : SCHED_OTHER, &priority);<br>
+#endif<br>
----------------<br>
I noticed that when I compile this with gcc 5.4.0, I get a compilation error about SCHED_IDLE not being defined.<br>
Indeed, if I look in sched.h used with gcc 5.4.0, these are the SCHED_* definitions:<br></blockquote><div>Sorry for the breakage here!</div><div><br></div><div>sched.h comes from glibc, rather than GCC.</div><div>SCHED_IDLE was added in glibc 2.12, which is considerably older than any supported compiler (2010, vs 2013 for gcc 4.8 and 2016 for gcc 5.4).</div><div><br></div><div>I don't think there's a documented policy on libc versions... what does this system look like? (e.g. glibc version, distribution?)</div><div><br></div><div>(It seems like it would be OK to #ifdef SCHED_IDLE here and do nothing the libc is just too old, but it may mask other problems we'd want to know about).</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
```<br>
/* Scheduling algorithms.  */<br>
#define SCHED_OTHER     0<br>
#define SCHED_FIFO      1<br>
#define SCHED_RR        2<br>
#ifdef __USE_GNU<br>
# define SCHED_BATCH    3<br>
#endif<br>
```<br>
I suppose SCHED_IDLE was added in some later version...<br>
<br>
On<br>
 <a href="https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library" rel="noreferrer" target="_blank">https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library</a><br>
it says that gcc 4.8 should work, but it doesn't now then?<br>
<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D53651" rel="noreferrer" target="_blank">https://reviews.llvm.org/D53651</a><br>
<br>
<br>
<br>
</blockquote></div></div>