diff --git a/linux/linux.mk b/linux/linux.mk index db0c311adf..490f87ee66 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -266,6 +266,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