Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp282047pxu; Fri, 11 Dec 2020 02:09:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8yyLqClvK1+G0kblIdJrO1D38JM8r6JZX1oHNWCy3Y+cRBaInmg8jh9KDlsJEeFoING81 X-Received: by 2002:a17:906:3294:: with SMTP id 20mr10303311ejw.239.1607681394586; Fri, 11 Dec 2020 02:09:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607681394; cv=none; d=google.com; s=arc-20160816; b=rgXldTfbmMEW5QWYUqOyfStlgjQLQCJZL3BJA6VPVSRvfRi/vCUv528MLKJr1loipM OMGDMRVCvpEETdryVo6Nb5u5gMHTTWx/dfSjS+1lHidu/FGcyVNo+upqef0r5Fe3fWpP JDgk0sMRMHAKXgIR7iGR1sizIpxpkjfV1wCrRA4sutSPHDq8GakrSAGlICS1yR1G7i1g 1GE9k/j7dsXLZPuJcbIfHMkRVfllF6XyWSEVZV8CRW/GXaQl+8gCmLZN3yesWTYjdzrM aoHGO+uErqHLRZ6AxzK+S1nGFFtog42SU3DaBKT772T8gXz6E5GPCIb7Mxf8S+xkPHHb crbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FDWcEk/bsx49QrHA7le6QrzeyX76Cr1G90wWwfXt9og=; b=dliBB5vK2ASvOcHELOGdu+cFaOekxu72EXAUGdFbd/diLq267dpB4dm5EefFAgo6ZD p6wf96UB0CHpp4D0Wq7fAYIzEJSU42OaU+iqWiR0HtI/0DU3zJsA9IIb0V/o8Lr5yf4b PCRqxNSxKHWXRgsfYqj/2ZDZZbl9d7C4e4d5qZ1UA4SS5ZG7++ssIiuYrr7J9Vxn96n8 Ahxg7+SU7OuWv/UIF9vLsPUwu3UJtzv2U+y8/2PJkTFUWO6moYa2F6iEUMmflBDARIyt 6eR3ADxsz1nHysMWthEmn+JyGexQFSixW2GuZu8Pu6VJBfsNnZKKGesKRivEacOm4EKH XVww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eyVki26Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv1si4141691ejb.249.2020.12.11.02.09.31; Fri, 11 Dec 2020 02:09:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eyVki26Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394223AbgLJWcE (ORCPT + 99 others); Thu, 10 Dec 2020 17:32:04 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40319 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405129AbgLJW0X (ORCPT ); Thu, 10 Dec 2020 17:26:23 -0500 Received: by mail-pg1-f196.google.com with SMTP id t37so5596542pga.7 for ; Thu, 10 Dec 2020 14:26:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FDWcEk/bsx49QrHA7le6QrzeyX76Cr1G90wWwfXt9og=; b=eyVki26QxbAouCaaS+b5GUx8CLMRFIUjtoypoV1IvhDtSzOg3ca6z5EmYDGXNGdnsl U+P3N8j9mIzu2E6FUrgaBxpdccT6tWtbHCrRjZMks0d0xEp+Chmmqgi1Hxnek/CfhSSb J/g7qBme+dbBvOTXGw++vYsu1hR611rkrq7AKJAuQe39bo/lcfts5+qbjkI83D1B1OTP I+AkQfB8YDF2EkuZYN/PtM6wUI/ebdlwaa3KjJp+l64dFy3cwul8BPM8X9BMoxO+lorY c46YnKuEqYtlLlnSw4CRt/ovwT+/sQjuIuY9PLoZ/koHhXzyXUfoJqAoagvAWP5ophzp 1nrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FDWcEk/bsx49QrHA7le6QrzeyX76Cr1G90wWwfXt9og=; b=l+Nj2u59b/O1zbVAIH9xsBWRcmutxBwgBrX4gaBPGljUvgOSI7pi3Ru+ekEF5oBcOC 2k+/Flp3fcBqURrFYbGfKV2Z63XhMe5OS2JYDQHlutdx07rrMseTKBmT9T6TffRsac0U Jmm6OOOLV8DI5Gu23VZYcznXmgeNjFD9ZPY41VerbkfIzsncAmTa7E0tfwIu/mUzUlJ4 4BD/dlhmuayp1RLVLNZtulWPNeaK5xTJRbD2RvDVNyTRX5U5oZUV+6hiRRQKMstPq01v kplyQA9/Nje7XEHiRmP/+DGgSg5h4vOUCxcYSJyQjB8qoBl/ulkGd1yZUD4bt/Wkcasm kNIA== X-Gm-Message-State: AOAM5304cFUVmiLLNi7r43huOTQABKU0RjVRVR2IYAWmQzyUR4DW9fC/ Lh6265JUaCt35hoFyh0G7e2X8oSRJS3CnBjlVTyRA2FOP/Klqw== X-Received: by 2002:a63:184c:: with SMTP id 12mr1082455pgy.381.1607636935147; Thu, 10 Dec 2020 13:48:55 -0800 (PST) MIME-Version: 1.0 References: <20201201152017.3576951-1-elver@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 10 Dec 2020 13:48:43 -0800 Message-ID: Subject: Re: [PATCH] genksyms: Ignore module scoped _Static_assert() To: Marco Elver Cc: Miguel Ojeda , LKML , kasan-dev , Masahiro Yamada , Joe Perches , Greg Kroah-Hartman , Richard Henderson , Andrew Morton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 10, 2020 at 8:25 AM Marco Elver wrote: > > On Thu, 10 Dec 2020 at 14:29, Miguel Ojeda > wrote: > > On Thu, Dec 10, 2020 at 11:35 AM Marco Elver wrote: > > > > > > It looks like there's no clear MAINTAINER for this. :-/ > > > It'd still be good to fix this for 5.11. > > > > Richard seems to be the author, not sure if he picks patches (CC'd). > > > > I guess Masahiro or akpm (Cc'd) would be two options; otherwise, I > > could pick it up through compiler attributes (stretching the > > definition...). > > Thanks for the info. I did find that there's an alternative patch to > fix _Static_assert() with genksyms that was sent 3 days after mine > (it's simpler, but might miss cases). I've responded there ( > https://lkml.kernel.org/r/X9JI5KpWoo23wkRg@elver.google.com ). > > Now we have some choice. I'd argue for this patch, because it's not > doing preprocessor workarounds, but in the end I won't make that call. > :-) I was half kidding about depending on a production C parser. See internal reference pa/1432607, choice quotes: ``` ... CONFIG_MODVERSIONS uses scripts/genksyms/genksyms to create a file, Module.symvers, that is a simple mapping of CRCs of various symbols' types to the symbol names. It produces these CRCs by using the C preprocessor, then passing this into genksyms. genksyms has a lex/yacc based C parser to parse the preprocessed sources of kernel modules. It turns out that it's incomplete, copied from an upstream project that ceased development in 2013, and was slated to be removed around the 4.9 kernel release. ... Some possible solutions: * Update the kernel's version of genksyms. There's a comment that the kernel's sources were copied from "modutils." It seems that modutils' last release was v2.4.27 in 2004, and that development on it has stopped. Upstream modutils also has the same parsing bug. ... * Fix the parsing bug in genksysms. While the discussion about removing CONFIG_MODVERSIONS has started again upstream due to my bugreport, this would be the optimal solution, if I could just figure out how to rewrite the parser correctly. ... A better long term solution would be to replace genksyms's modutils/lex/yacc based incomplete and dead C parser with a libclang based one, but such work is beyond the scope of a toolchain update. For future travelers that would like to take a crack at fixing the existing parser, I found the develop/build/test/debug cycle to be: $ rm scripts/genksyms/genksyms $ make scripts/genksyms/ $ ./scripts/genksyms/genksyms -d < test_case.i $ ./scripts/genksyms/genksyms -d -d < test_case.i Best of luck on that endeavor. ``` I was planning on talking about this timebomb at plumbers, but had to cut it due to the tight time constraints we were allotted. -- Thanks, ~Nick Desaulniers