From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by sourceware.org (Postfix) with ESMTPS id 78EAC3858CDB for ; Thu, 18 May 2023 14:52:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78EAC3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=kitware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kitware.com Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-75795493bceso118181785a.3 for ; Thu, 18 May 2023 07:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kitware.com; s=google; t=1684421555; x=1687013555; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ia8AfgLLkrLpJn+oXY/Q/HyLF+IkrMMp+oO8DMY63zE=; b=qhXwUXKcQVuPJPg6MptJ8T++MzjmZfq+PkBFhq01i1QEPpSzJ5rCVZv+zF8gaX8Sm2 wetx0nZF5A1lmar4oqTZeGNvz4nGOz8jCdbd95/vK+cLxxU3LbftvOSnG3C51iq6pLye S+6nS7ni1zpCtsKaXymrtJ+iV5DuQAAAbBNic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684421555; x=1687013555; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ia8AfgLLkrLpJn+oXY/Q/HyLF+IkrMMp+oO8DMY63zE=; b=J7gxrzjyNTOZtJ7lRCWm2N0dV/lrVzq2ZaeN7d05rA+G+LimhQgHWpJxOkNc1Qes3/ sf4iax1m1E8lvpWm2onJZrrTgxoYA/vWapN4z7gyxxicJmDbR1PmGpVN/r/f7jchpLlP bM5tL2OwknSs/HHNUuto6qnU+0/wS66Y96UMxJ+Rn1SWueOi1Dh3DIhsGgzXJtRhoyFY wSUYma1Hujqf5IEEuhJTPulplqC21UOVO5N3mvFrsXaCfq4iMFgOcXU6vhSfC3T047iP fcAhHEZQoEx+PwQ4yYd5u/yYfGO0/q8lCgfT/D/teZNaqRNPONg/t5YQB5SIUC/3g2GF ZkvA== X-Gm-Message-State: AC+VfDxHGWa8EXCqV8ZxHpOgSsO4y/bPQsDm52h5Y5bzwe9oxoHRXWM9 sYvUd79to5Uu6d1VLN7N5xz/iFvSgsr7OVZmwKaL3A== X-Google-Smtp-Source: ACHHUZ67V5HMHssQDsyWa0GLBx+8HNBTGdmiD01PKSLRBJScAh19r7M0PvQUIHl0yxPl9YQOyW5wwA== X-Received: by 2002:a05:6214:230c:b0:615:a787:6d31 with SMTP id gc12-20020a056214230c00b00615a7876d31mr5787583qvb.38.1684421554767; Thu, 18 May 2023 07:52:34 -0700 (PDT) Received: from localhost (cpe-142-105-146-128.nycap.res.rr.com. [142.105.146.128]) by smtp.gmail.com with ESMTPSA id s1-20020a05621412c100b0061a68b5a8c4sm560344qvv.134.2023.05.18.07.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 07:52:34 -0700 (PDT) Date: Thu, 18 May 2023 10:52:33 -0400 From: Ben Boeckel To: Paul Smith Cc: Eli Zaretskii , gcc@gcc.gnu.org Subject: Re: LSP based on GCC Message-ID: <20230518145233.GA3782@farprobe> References: <83a5y3xcai.fsf@gnu.org> <20230517223850.GB291350@farprobe> <1ed347e35c0c08c48b67d862a9028a5d8b69cdac.camel@mad-scientist.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1ed347e35c0c08c48b67d862a9028a5d8b69cdac.camel@mad-scientist.net> User-Agent: Mutt/2.2.9 (2022-11-12) X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, May 18, 2023 at 09:25:04 -0400, Paul Smith wrote: > On Wed, 2023-05-17 at 18:38 -0400, Ben Boeckel wrote: > > FWIW, this is only going to get worse with C++ modules. > > There's no reason it should. Of course the right answer is to tell > people to fix their build systems and if they want to use a different > compiler AND use PCH, they use the appropriate suffix for that > compiler. > > But even if you don't want to do that the fix in this case is trivial. > I even sent a patch (although since I don't know the clang code there's > no doubt that it was not done "the right way" and needed to be > massaged), they just never cared about it. > > The GCC PCH files use a special 4-byte prefix in every file; all you > have to do in clang is, if you find a .gch file open the file and read > the first 4 bytes and if it's a real GCC PCH file you ignore it and if > it's actually a Clang PCH with a malformed name you complain bitterly > and dump core.... er, I mean, you read it silently as if it had the > right name. PCH files can "be ignored" in some sense because they can be recalculated from `#include` files pretty easily. Module files, however, cannot. > One would hope that, if the GCC module files have a similar compiler- > specific format (I'm not too familiar with modules) they also use a > similar magic number at the beginning of the file. GCC module files are use ELF containers, so there's plenty of metadata to know it's not-for-Clang. But Clang will need to make its own version of these module files to know what, if anything, is provided by it by sources that import it to make any kind of useful suggestions. > But anyway this is losing the thread of Eli's hopeful request. Agreed. A GCC-based LSP will help immensely with GCC-using projects (whether it be Emacs or Vim on the other end of the LSP pipe ;) ). --Ben