<div dir="ltr">I'll send a patch shortly to unbreak this.<div><br></div><div>Is emitting a warning a problem for you? (i.e. do you build with -Werror)</div><div>I'd like to do something like #ifdef SCHED_IDLE ... #else #warning "old libc?" #endif</div><div>That way if this isn't actually working we'll break in linux configurations covered by -Werror bots, we'll notice.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 7, 2018 at 11:22 AM Mikael Holmén <<a href="mailto:mikael.holmen@ericsson.com">mikael.holmen@ericsson.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On 11/7/18 11:03 AM, Sam McCall wrote:<br>
> On Wed, Nov 7, 2018 at 10:32 AM Mikael Holmén via Phabricator <br>
> <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a> <mailto:<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>>> wrote:<br>
> <br>
> uabelho added a comment.<br>
> <br>
> Hi,<br>
> <br>
> I've got a post-review comment about the use of SCHED_IDLE vs the<br>
> 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,<br>
> &priority);<br>
> +#endif<br>
> ----------------<br>
> I noticed that when I compile this with gcc 5.4.0, I get a<br>
> 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<br>
> SCHED_* definitions:<br>
> <br>
> Sorry for the breakage here!<br>
> <br>
> sched.h comes from glibc, rather than GCC.<br>
> SCHED_IDLE was added in glibc 2.12, which is considerably older than any <br>
> supported compiler (2010, vs 2013 for gcc 4.8 and 2016 for gcc 5.4).<br>
> <br>
> I don't think there's a documented policy on libc versions... what does <br>
> this system look like? (e.g. glibc version, distribution?)<br>
<br>
Ok, we're apparently using glibc 2.11.3. A bit too old then :/<br>
<br>
We're cross-compiling llvm using rather old gcc and glibc versions so <br>
that it will work on a number of different machines with different OS <br>
versions that our users have.<br>
<br>
/Mikael<br>
<br>
> <br>
> (It seems like it would be OK to #ifdef SCHED_IDLE here and do nothing <br>
> the libc is just too old, but it may mask other problems we'd want to <br>
> know about).<br>
> <br>
> ```<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>
<br>
</blockquote></div>