genode/repos/base-hw
Piotr Tworek 4ae78639f5 base-hw: Fix invalid structure alignments.
According to C++11 reference:

  "If the strictest (largest) alignas on a declaration is weaker than
   the alignment it would have without any alignas specifiers (that is,
   weaker than its natural alignment or weaker than alignas on another
   declaration of the same object or type), the program is ill-formed:"

https://en.cppreference.com/w/cpp/language/alignas

The code requests 4 byte alignment for Genode::Arm_cpu::Context.
The Context structure inherits Genode::Arm_cpu::Fpu_context which
has minimum alignment requirement of 8 bytes, due to uint64_t d0_d31
member. This makes the 4 byte value in Context's alignas specifier
invalid (smaller than allowed minimum).

Similar situation takes place in Arm_64 case. The claimed minimum
alignment of Context is 8 bytes, but the fpu_state member imposes 16
bytes alignment (explicitly specified in Fpu_state declaration).

In both cases the code builds fine with GCC 8.3.0, but fails with
clang which claims that "requested alignment is less than minimum
alignment of X for type", where X is 8 on ARM and 16 on AArch64.

Ref: https://eel.is/c++draft/dcl.align#5

Issue #4421
2022-02-15 10:23:58 +01:00
..
board hw: remove rpi1/3 board support 2022-01-19 12:38:12 +01:00
etc base: remove SPEC variables of boards (fix #3971) 2021-01-25 13:58:09 +01:00
include base-hw: improve comments in kernel/interface.h 2022-02-15 10:10:02 +01:00
lib/mk hw: remove rpi1/3 board support 2022-01-19 12:38:12 +01:00
recipes depot: update recipe hashes 2022-01-19 12:38:13 +01:00
run base-hw: fix run scripts 2020-02-20 12:11:21 +01:00
src base-hw: Fix invalid structure alignments. 2022-02-15 10:23:58 +01:00