Re: include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct rtw8814a_efuse) == 512"

David Laight
2026-04-13T13:01:15Z

On Mon, 13 Apr 2026 11:30:25 +0200
"Arnd Bergmann" <arnd@arndb.de> wrote:

> On Mon, Apr 13, 2026, at 11:15, Geert Uytterhoeven wrote:
> > On Mon, 13 Apr 2026 at 02:48, Ping-Ke Shih <pkshih@realtek.com> wrote:
> >> > On Fri, 10 Apr 2026 at 14:15, Ping-Ke Shih <pkshih@realtek.com> wrote:
> >> > How can that make a difference?
> >> > Both rtw8814au_efuse and rtw8814ae_efuse contain just (the same number
> >> > of) bytes, so __packed on the union should not make any difference?
> >> > Moreover, rtw8814au_efuse and rtw8814ae_efuse are already tagged with
> >> > __packed, which should also not make any difference. Someone's been
> >> > sprinkling too many __packed all over the place?
> >>
> >> I have similar thought as yours, but arm-linux-gnueabi-gcc compiler seems
> >> have special treatment with union. For this case, without __packed
> >> the offset of followed field res5 will become 0xe0.
> >
> > Hmm, I can confirm the original issue, and that adding __packed does
> > have an impact (it reduces the size of rtw8814a_efuse from 522 to 520),
> > but the actual size is still wrong (should be 512).
> >
> > drivers/net/wireless/realtek/rtw88/rtw88xxa.h has a similar issue, but
> > adding __packed does not make a difference there.
> >
> > Removing the __packed from struct rtw8814au_efuse increases its size
> > from 14 to 16 bytes. Looks like that ABI pads every structure to a
> > multiple of 4 bytes?
>
> Correct, that is a unique property of the ARM "OABI" legacy ABI,
> triggered by this defconfig line:
>
> # CONFIG_AEABI is not set
>
> Nobody should be using ARM OABI any more, and I think we should
> remove it from the kernel once support for the StrongARM
> CPU gets removed (I have patches for that), as those CPUs were
> the last ones that regularly used OABI.

That would definitely save all the annoyance of the otherwise
pointless __packed.
(I've seen it crop up before, but wasn't sure which architecture it was.)
Doesn't OABI also have 32bit bool?

> Annotating the union as '__packed' is the correct fix for
> the theoretical users of OABI, and does nothing on other
> supported targets in Linux.

The other option is to ensure the specific drivers aren't ever compiled
for !CONFIG_AEABI.
Then it'll all get tidied up when you remove it.

I read that the patches to remove 486 support have been merged.
I'm sure it would have made sense to drop everything before P-Pro
so that cmov can be used.

David

>
> Arnd
>