Re: include/linux/compiler_types.h:397:45: error: call to '__compiletime_assert_810' declared with attribute error: BUILD_BUG_ON failed: skb_ext_total_length() > 255

From: Arnd Bergmann
Date: Mon Dec 18 2023 - 07:04:21 EST


On Mon, Dec 18, 2023, at 11:11, Thomas Weißschuh wrote:
> On 2023-12-18 10:12:03+0000, Arnd Bergmann wrote:
>> On Sun, Dec 17, 2023, at 17:13, Thomas Weißschuh wrote:

>>
>> The -fno-tree-loop-im option would likely stop the loop from getting
>> unrolled, which is how the skb_ext_total_length() return code is no
>> longer constant.
>>
>> Does manually unrolling this loop avoid the problem?
>
> That also works.
>
> The offending commit was a change from a manually unrolled loop to the
> current code.

Ah, I missed that.

I also see that I added -fno-tree-loop-im back in 2016 as a workaround
for gcc-4.9 and higher, but I don't know if it's still required
with modern compilers and I'm currently unable to do large scale
testing of this until maybe early January. My guess would be that it's
still needed.

If you want to fix it sooner and not revert your earlier patch,
I would suggest changing the BUILD_BUG_ON to only evaluate the
length argument if CONFIG_GCOV_PROFILE_ALL is disabled. It's not great
but if we ever exceed the limit for real it would still be caught
in normal defconfig and allmodconfig builds since they disable
the option.

Arnd