diff --git a/linux/linux.mk b/linux/linux.mk index d798aea057..102b7a15d4 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -271,6 +271,13 @@ endef LINUX_POST_PATCH_HOOKS += LINUX_APPLY_LOCAL_PATCHES +# Older versions break on gcc 10+ because of redefined symbols +define LINUX_DROP_YYLLOC + $(Q)grep -Z -l -r -E '^YYLTYPE yylloc;$$' $(@D) \ + |xargs -0 -r $(SED) '/^YYLTYPE yylloc;$$/d' +endef +LINUX_POST_PATCH_HOOKS += LINUX_DROP_YYLLOC + # Older linux kernels use deprecated perl constructs in timeconst.pl # that were removed for perl 5.22+ so it breaks on newer distributions # Try a dry-run patch to see if this applies, if it does go ahead