glib-compile-resources: ensure alignment is at least sizeof(void *)

This triggered a warning from the CHERI compiler since the struct contains
a `void *` but `__attribute__((aligned(8))` reduced alignment to less than
the `void *` alignment (which is 16 for Arm Morello).

Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
This commit is contained in:
Alex Richardson 2022-12-14 23:55:20 +00:00
parent f7d2a58be6
commit 9abbf2eec2

View File

@ -1196,7 +1196,7 @@ main (int argc, char **argv)
"#include <gio/gio.h>\n"
"\n"
"#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))\n"
"# define SECTION __attribute__ ((section (\".gresource.%s\"), aligned (8)))\n"
"# define SECTION __attribute__ ((section (\".gresource.%s\"), aligned (sizeof(void *) > 8 ? sizeof(void *) : 8)))\n"
"#else\n"
"# define SECTION\n"
"#endif\n"