On Sun, Aug 27, 2023, at 19:30, Bart Van Assche wrote: > Although it is not clear to me why, this patch fixes the following build > error for big endian 32-bit ARM systems: > > include/linux/build_bug.h:78:41: error: static assertion failed: > "sizeof(struct utp_upiu_header) == 12" > > Cc: Arnd Bergmann <arnd@xxxxxxxx> > Reported-by: kernel test robot <lkp@xxxxxxxxx> > Closes: > https://lore.kernel.org/oe-kbuild-all/202308251634.tuRn4OVv-lkp@xxxxxxxxx/ > Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx> The fix makes sense, but I think the description is wrong: The weird struct padding on Arm randconfig builds happens with CONFIG_AEABI disabled (implying the old OABI), regardless of CONFIG_CPU_BIG_ENDIAN. > - union { > - __u8 tm_function; > - __u8 query_function; > - }; > + __u8 tm_or_query_function; > __u8 response; The problem on OABI is that any struct or union is word aligned. I would assume that marking the union as __packed also addresses the problem here, but I have not tested that and your patch seems fine. There are bugs like this in many places of the kernel where the struct alignment actually matters but is broken on OABI, but the machines that used to run OABI kernels in the past also run a very small set of drivers in practice. On my own build test setup, I have made CONFIG_AEABI dependent on !CONFIG_COMILE_TEST, which prevents me from running into this problem (and others) on randconfig builds. Maybe I should try again to send that upstream. Arnd