From nobody Wed Aug 09 12:48:24 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RLVH21z1Rz4pwKW for ; Wed, 9 Aug 2023 12:48:46 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from hsmtpd-fgn.xspmail.jp (hsmtpd-fgn.xspmail.jp [210.130.137.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4RLVGz1srYz3cZq for ; Wed, 9 Aug 2023 12:48:42 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=j.email.ne.jp header.s=x01 header.b=TJCDkPNg; spf=pass (mx1.freebsd.org: domain of ota@j.email.ne.jp designates 210.130.137.10 as permitted sender) smtp.mailfrom=ota@j.email.ne.jp; dmarc=pass (policy=none) header.from=j.email.ne.jp DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1691585312; d=j.email.ne.jp; s=x01; i=ota@j.email.ne.jp; h=content-transfer-encoding:content-type:mime-version:references:in-reply-to: message-id:subject:cc:to:from:date:from; bh=sgjv+SBX9RuD1yccUmwM1CWlFKD+VG2WNy8S1hKwZI4=; b=TJCDkPNgkMA8HChSFi6CZzYywUNX5zfmza7WqYEebZCU+GS2N7LM8eUKvcPt6WqE8CXRqWPwns1oO oUnVyvEpu2xY+l0BPmGwhhizLFloVMpiG1O7jHmSs9yaW9RJqluEsbTiMfOwS7lAOT2QEncYb3g+/Q dN9doz8CJ0ECk0fQvRGxyxiW+Ehd8jLgNwj14jmFFEUAcvGTi5Dxo2C5AnyUeNmlVTwJXNA3TvVa0W 4aj5HGrtQBR+orlZgluBtliEZIAnT3c2b/hg3L3m82Jljb1ZanShglT5xxvShi+JfxbDnOPyG/s7Lt hn10+p7qzsA6I6jr4qu4Mwyo6nMRtQw== X-Country-Code: US Received: from a315-53 (unknown [38.98.216.75]) by hsmtpd-out-1.asahinet.cluster.xspmail.jp (Halon) with ESMTPA id 211d894c-d73e-46f3-a9c7-9c853ec4d640; Wed, 09 Aug 2023 21:48:31 +0900 (JST) Date: Wed, 9 Aug 2023 08:48:24 -0400 From: Yoshihiro Ota To: Warner Losh Cc: Yuri , FreeBSD Current Subject: Re: Jail compile error on CURRENT? Message-Id: <20230809084824.1d8a7c2928d469a49f719070@j.email.ne.jp> In-Reply-To: References: <20230806225055.bbccc4fc13e41f50ec524621@j.email.ne.jp> <73d081d7-5df6-9fe4-659d-edb191c94be4@aetern.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd12.2) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-2.50 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[j.email.ne.jp,none]; R_SPF_ALLOW(-0.20)[+ip4:210.130.137.0/27]; R_DKIM_ALLOW(-0.20)[j.email.ne.jp:s=x01]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:2497, ipnet:210.130.0.0/16, country:JP]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[j.email.ne.jp:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROM(0.00)[] X-Spamd-Bar: -- X-Rspamd-Queue-Id: 4RLVGz1srYz3cZq On Mon, 7 Aug 2023 21:32:03 -0600 Warner Losh wrote: > On Mon, Aug 7, 2023, 5:55 PM Yuri wrote: > > > James Gritton wrote: > > > On 2023-08-07 13:29, Dimitry Andric wrote: > > >> On 7 Aug 2023, at 04:50, Yoshihiro Ota wrote: > > >>> > > >>> Am I the only one seeing this error? > > >>> I'm on 12.4-RELEASE amd64 and building CURRENT as of now. > > >>> > > >>> jaillex.c:2228:43: error: unused parameter 'yyscanner' > > >>> [-Werror,-Wunused-parameter] > > >>> void *yyalloc (yy_size_t size , yyscan_t yyscanner) > > >>> ^ > > >>> jaillex.c:2233:58: error: unused parameter 'yyscanner' > > >>> [-Werror,-Wunused-parameter] > > >>> void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) > > >>> ^ > > >>> jaillex.c:2245:36: error: unused parameter 'yyscanner' > > >>> [-Werror,-Wunused-parameter] > > >>> void yyfree (void * ptr , yyscan_t yyscanner) > > >>> ^ > > >>> 6 errors generated. > > >>> *** [jaillex.o] Error code 1 > > >>> > > >> > > >> It seems you are not crazy. :) I can reproduce the error, and I think it > > >> might be caused by: > > >> > > >> > > https://cgit.freebsd.org/src/commit/?id=086e0149ae56641af245ce472e787c2f67d3aea5 > > >> > > >> However, as to why this does not result in an error (or even a warning) > > >> on -CURRENT, I have no clue. Maybe in the mean time flex in -CURRENT got > > >> updated... > > > > > > That is indeed the culprit. Fortunately, it builds from 13.2-RELEASE, > > > so building CURRENT from 12 can be done in two steps. I hate to be the > > > reason the update doesn't work directly, but the include capability I > > > added to jail(8) requires re-entrant lex, which apparently managed to > > > work around the error in 13. They reason it doesn't give a warning BTW > > > is these two lines that lex adds: > > > > > > struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; > > > (void)yyg; > > > > > > That makes yyscanner officially "used" even though its value is never > > > actually read. I suspect the version of lex in 12.4-RELEASE doesn't > > > have one or both of those lines. > > > > > > Perhaps you could add such lines to the offending functions yourself, > > > and continue the make. Or maybe build (and install) lex on its own > > > first; by the time you see this error, there should already be a newer > > > version of lex you could pop into place. > > > > > > There's probably something I should do to make this work better, or > > > perhaps some note I should put into UPDATING before 14.0 is released. > > > > Or there is already a recipe for bootstrapping lex in Makefile.inc1, > > though for somewhat older versions; possibly it could be updated for < 13? > > > > .if ${BOOTSTRAPPING} < 1000033 > > > > > When in doubt, adding BOOTSTRAPPING=0 can help...not sure why you'd need to > bootstrap lex though... > > Warner > Hi, thanks for many inputs. In short, 1. the toolchain lex doesn't work as is, 2. there are other errors I didn't paste originally and failing. In more details, I tried few ways to kick off lex toolchain build but still getting errors. The 2 belows are examples only 2 of my attempts while I tried few other ways to set this on. Try #1: ``` % setenv BOOTSTRAPPING 0 % make buildworld -j 4 ``` Try #2: ``` --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2305,7 +2305,7 @@ _zic= usr.sbin/zic # If you add a new bootstrap tool where we could also use the host version, # please ensure that you also add a .else case where you add the tool to the # _bootstrap_tools_links variable. -.if ${BOOTSTRAPPING} < 1000033 +.if ${BOOTSTRAPPING} < 1300033 # Note: lex needs m4 to build but m4 also depends on lex (which needs m4 to # generate any files). To fix this cyclic dependency we can build a bootstrap # version of m4 (with pre-generated files) then use that to build the real m4 ``` So, I looked at the generated file and grabbed one of function here: ``` void *yyalloc (yy_size_t size , yyscan_t yyscanner) { return (void *) malloc( size ); } ``` With above 2 and more attemps, I still kept getting the same error. So, I decided to fix my PATH (and started compiling usr.sbin/lex only) as below. This resulted picking up local lex and generated code looks a bit better. But there are few other errors as you can see below. (I had it originally but failed/missed to copy&paste sending the 1st email) ``` % find /usr/obj/usr/src/amd64.amd64/ -name lex -type f /usr/obj/usr/src/amd64.amd64/tmp/legacy/bin/lex /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/lex/lex % setenv PATH /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/lex:$PATH % cd /usr/src/usr.sbin/jail % make cc -O2 -pipe -fno-common -I. -I/usr/src/usr.sbin/jail -DINET6 -DINET -fPIE -g -gz=zlib -MD -MF.depend.jaillex.o -MTjaillex.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unus ed-const-variable -Qunused-arguments -c jaillex.c -o jaillex.o jaillex.c:845:1: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] YY_DECL ^ /usr/src/usr.sbin/jail/jaillex.l:41:36: note: expanded from macro 'YY_DECL' #define YY_DECL int yylex(YYSTYPE *yylval, yyscan_t yyscanner) ^ ./y.tab.h:19:16: note: previous declaration is here extern YYSTYPE yylval; ^ /usr/src/usr.sbin/jail/jaillex.l:159:59: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] text2lval(size_t triml, size_t trimr, int tovar, YYSTYPE *yylval, ^ ./y.tab.h:19:16: note: previous declaration is here extern YYSTYPE yylval; ^ 2 errors generated. *** Error code 1 Stop. ```