Skip to content

linux: limit YYLTYPE kernel modification

Markus Mayer via buildroot buildroot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1linux: limit YYLTYPE kernel modificationlinux/linux.mk+3 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Buildroot] [PATCH 0/1] linux: limit YYLTYPE kernel modification

Hi,

It took me a while to find out why our kernel builds were suddenly failing with the 2022.02-rcX sources. Oddly, building DTC for the host would error out like so:

dtc-parser.y: In function `print_error':
dtc-parser.y:478:17: error: `yylloc' undeclared (first use in this function);
did you mean `yyalloc'?
dtc-parser.y:478:17: note: each undeclared identifier is reported only once
for each function it appears in
dtc-lexer.lex.c: In function `yylex':
dtc-lexer.l:46:18: error: `yylloc' undeclared (first use in this function);
did you mean `yyalloc'?
dtc-lexer.lex.c:845:2: note: in expansion of macro YY_USER_ACTION' dtc-lexer.lex.c:939:1: note: in expansion of macro YY_RULE_SETUP' dtc-lexer.l:46:18: note: each undeclared identifier is reported only once
for each function it appears in
dtc-lexer.lex.c:845:2: note: in expansion of macro YY_USER_ACTION' dtc-lexer.lex.c:939:1: note: in expansion of macro YY_RULE_SETUP'

The kernel build that's failing is Linux 4.1 with GCC 6.3. Yes, I know. Old kernel, old toolchain. Still, this used to work, and now it doesn't. (We have newer toolchains and newer kernels, too. They seem fine.)

Eventually, I tracked it down to this change:

https://git.buildroot.net/buildroot/commit/?id=9b41b54be077

I think there are two issues with it. It claims to be for GCC 10+, but it is applied at all times. I believe it should be conditional upon BR2_TOOLCHAIN_GCC_AT_LEAST_10 if the intention is to fix up the sources for GCC 10 and newer.

Secondly, this code works its magic completely silently and quietly. There is no indication that anything is being done to the kernel sources. That makes it really, *REALLY* challenging to figure out what's going on when things go sideways.

I think an informational message to the user is absolutely crucial. At least that way it'll show up in the build logs if one searches for "YYLTYPE". That'll give the users a hint where the sources are being touched. Modifying source code like this should not happen quietly.

Regards,
-Markus

Markus Mayer (1):
linux: limit YYLTYPE kernel modification

 linux/linux.mk | 3 +++
 1 file changed, 3 insertions(+)
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot