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

Sam McCall via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 02:31:13 PST 2018


I'll send a patch shortly to unbreak this.

Is emitting a warning a problem for you? (i.e. do you build with -Werror)
I'd like to do something like #ifdef SCHED_IDLE ... #else #warning "old
libc?" #endif
That way if this isn't actually working we'll break in linux configurations
covered by -Werror bots, we'll notice.

On Wed, Nov 7, 2018 at 11:22 AM Mikael Holmén <mikael.holmen at ericsson.com>
wrote:

> 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
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181107/29bcbd9a/attachment.html>


More information about the llvm-commits mailing list