Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3518221ybg; Mon, 28 Oct 2019 14:13:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5Khoqo9WI3P3M+uOVUT19KGu9xC/6NRhWcWdAd0aWEdkkyU7ku+zPmh7pbzVV45ZQqSfZ X-Received: by 2002:a05:6402:1156:: with SMTP id g22mr22232134edw.233.1572297196733; Mon, 28 Oct 2019 14:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572297196; cv=none; d=google.com; s=arc-20160816; b=KwomL/lqDkIN1PVV8QnUZp4STVjZnBHHpvhgQo7ygIF0LvRelznA1lDCd+xVhudmNO 7VPb4swgglwYX+m6wbmmTBXmvX0PS3uhdpcF7eUpgr3g1U5/htjILfTi55moO3GDNUlI hNWD2/7PEDRu+1ps+VxDuU+/OetmYUp30X/U4EeWaz7tvcxfLF/ZqQR+yUZ/6qekzmLl Fgwj/pbMznjgiPzQ24ctKvndh4A+4yju0NyHw4GwyHR39woHrhVqM4CLv75jLk2Oe9vl h2XqN2Chpx5f3foHbbwbPR6s9eAJcmwB+/UIYOUMhIbqs1JVIYCWekAP0jR7D32N9xl4 uMpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=u+kZn6IyZZfN/0mlluWthGclsf/q1ikalY90VR/nHBU=; b=UcYLIQLokikrRb1bZ8yfQxla751rITc2liTRebLVa/6I9XyG8NxZbod4rblwpa+rL3 WTLBu71zX7OSMHV3Zyu1ZP6DikJ2b8HJkzOxvEzzMlEiRoTi7O/TtG9/Fsa+YdUG/pl5 /CUiBEFPK/RiDNCwVHEY91wGsPBZu8XrJ7b8jFaJpkRSWcnZvd+s4lGkJRAquJF4IyH7 l2WBs6O6A3pNWUHwcTfBQz8tl/b9TKgdE7i9Ez0jn7yZHsy1+KCLRvhZHRnXvE8yz49f 5YojxnbOZxD2nV8y1BClAMLAZN1fItzTy2F2/JRDaOfrWyhBBBvmp29zkQER0H9sHaXt KuHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pWcB+L+0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si6954365ejk.20.2019.10.28.14.12.53; Mon, 28 Oct 2019 14:13:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pWcB+L+0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390771AbfJ1QCx (ORCPT + 99 others); Mon, 28 Oct 2019 12:02:53 -0400 Received: from mail-il1-f196.google.com ([209.85.166.196]:42595 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728864AbfJ1QCx (ORCPT ); Mon, 28 Oct 2019 12:02:53 -0400 Received: by mail-il1-f196.google.com with SMTP id o16so8627058ilq.9; Mon, 28 Oct 2019 09:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u+kZn6IyZZfN/0mlluWthGclsf/q1ikalY90VR/nHBU=; b=pWcB+L+0mUwnOrVH0ALZ95dR9onLwO5cUAyZQpQnV6hLnzSMZrkkkaJAEF4WFT/xTt nHo4+XYqDEGUkCUZMAn04Hz1fR2eXxWCPYvQ/96CDRm5APZpoSDlyTcY5qSR8olSdxBG lCVXCTjk6LYiPqyzTDXIc9x+EJwyuaZKEINk7FVKob9s+nDDEID12gZyyVTYwHJhslmX JWnGQiaREqGFl05g254TF/dQPGdRgYzHmZ7SSnK8a7PBQ7XJ3MTpvMCtWCzdmoj1udpA FxrLT3MqhuAZIlWn2sqrEbW6vqHiLWRBkovD6TJDQfPDYfIuDN6C/kG8KWfAvdbWoY2a cAmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u+kZn6IyZZfN/0mlluWthGclsf/q1ikalY90VR/nHBU=; b=g0PbtfR7VkR0olc/ye5d2k0pbky2stWwJ+ZbMGx9b/CXCfmKXE65UTwYyW3zdmO9bH /c2eB9emcCYDT2PGEDd4N+g3VcKHpDl7DLO/zb4+qiI3/IcrfMuI5mnTEUl8kY/2EO45 9JEUcmKsad4OrCkql2pyVJiOv+4fwR3ICA5L+W2kk4Nm0iowT9scg0WB+4r6/44RWSNE Gnv9Q3Og9e6LaK+b4r7UBm1tVzmvzX+LtMRK3lJFGPySY6tPZMybnaXZZRdoFvYaINHX JrO/aWiSUw+PTsZHkCOyU8SprP128zGuuIolJBOIacWklavYoxm/JUwABcJTM30Br/7q /6OQ== X-Gm-Message-State: APjAAAWOzpb22QTD5QD49dCHgTOWYq2dDi2KDE9pCGE+8WO5Cbaz7FDy nwGch5kZ2ZC8TGQE1YmzCJ5CDcsX X-Received: by 2002:a92:6f08:: with SMTP id k8mr20274149ilc.57.1572278571279; Mon, 28 Oct 2019 09:02:51 -0700 (PDT) Received: from dell.localdomain ([216.249.49.8]) by smtp.googlemail.com with ESMTPSA id 133sm1618424ila.25.2019.10.28.09.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 09:02:50 -0700 (PDT) From: Ethan Sommer Cc: Ethan Sommer , Masahiro Yamada , Michal Marek , Nathan Chancellor , Sedat Dilek , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: support byacc as alternative YACC to bison Date: Mon, 28 Oct 2019 11:56:37 -0400 Message-Id: <20191028155639.30330-1-e5ten.arch@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switches to a more portable set of flags for generating the same file names instead of the bison-specific --defines, uses the more portable -V instead of --version, and explicitly defines YYSTYPE in lex.l, which bison implicitly defines if not present but byacc does not. Signed-off-by: Ethan Sommer --- scripts/Makefile.host | 2 +- scripts/genksyms/Makefile | 2 +- scripts/genksyms/lex.l | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 4c51c95d40f4..64e98e1d4825 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -11,7 +11,7 @@ $(obj)/%.lex.c: $(src)/%.l FORCE # YACC # --------------------------------------------------------------------------- quiet_cmd_bison = YACC $(basename $@).[ch] - cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $< + cmd_bison = $(YACC) -b $(basename $(basename $@)) -d -t -l $< $(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE $(call if_changed,bison) diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index 78629f515e78..397c2dc8182b 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile @@ -15,7 +15,7 @@ genksyms-objs := genksyms.o parse.tab.o lex.lex.o ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) quiet_cmd_bison_no_warn = $(quiet_cmd_bison) - cmd_bison_no_warn = $(YACC) --version >/dev/null; \ + cmd_bison_no_warn = $(YACC) -V >/dev/null; \ $(cmd_bison) 2>/dev/null $(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l index e265c5d96861..0580c088527f 100644 --- a/scripts/genksyms/lex.l +++ b/scripts/genksyms/lex.l @@ -19,6 +19,8 @@ #include "genksyms.h" #include "parse.tab.h" +extern YYSTYPE yylval; + /* We've got a two-level lexer here. We let flex do basic tokenization and then we categorize those basic tokens in the second stage. */ #define YY_DECL static int yylex1(void) -- 2.23.0