[PATCH] D53651: [clangd] Use thread pool for background indexing.

Mikael Holmén via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 7 02:21:59 PST 2018


Hi,

On 11/7/18 11:03 AM, Sam McCall wrote:
> On Wed, Nov 7, 2018 at 10:32 AM Mikael Holmén via Phabricator 
> <reviews at reviews.llvm.org <mailto:reviews at reviews.llvm.org>> wrote:
> 
>     uabelho added a comment.
> 
>     Hi,
> 
>     I've got a post-review comment about the use of SCHED_IDLE vs the
>     needed gcc version.
> 
> 
> 
>     ================
>     Comment at: clang-tools-extra/trunk/clangd/Threading.cpp:110
>     +      T.native_handle(),
>     +      Priority == ThreadPriority::Low ? SCHED_IDLE : SCHED_OTHER,
>     &priority);
>     +#endif
>     ----------------
>     I noticed that when I compile this with gcc 5.4.0, I get a
>     compilation error about SCHED_IDLE not being defined.
>     Indeed, if I look in sched.h used with gcc 5.4.0, these are the
>     SCHED_* definitions:
> 
> Sorry for the breakage here!
> 
> sched.h comes from glibc, rather than GCC.
> 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).
> 
> I don't think there's a documented policy on libc versions... what does 
> this system look like? (e.g. glibc version, distribution?)

Ok, we're apparently using glibc 2.11.3. A bit too old then :/

We're cross-compiling llvm using rather old gcc and glibc versions so 
that it will work on a number of different machines with different OS 
versions that our users have.

/Mikael

> 
> (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).
> 
>     ```
>     /* Scheduling algorithms.  */
>     #define SCHED_OTHER     0
>     #define SCHED_FIFO      1
>     #define SCHED_RR        2
>     #ifdef __USE_GNU
>     # define SCHED_BATCH    3
>     #endif
>     ```
>     I suppose SCHED_IDLE was added in some later version...
> 
>     On
>     https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library
>     it says that gcc 4.8 should work, but it doesn't now then?
> 
> 
> 
>     Repository:
>        rL LLVM
> 
>     https://reviews.llvm.org/D53651
> 
> 
> 



More information about the cfe-commits mailing list