Re: [PATCH 37/46] Compiler attributes, lto: disable __flatten with LTO

From: Miguel Ojeda
Date: Mon Nov 14 2022 - 12:02:51 EST


On Mon, Nov 14, 2022 at 12:45 PM Jiri Slaby (SUSE) <jirislaby@xxxxxxxxxx> wrote:
>
> +#ifndef CONFIG_LTO_GCC
> # define __flatten __attribute__((flatten))
> +#else
> +/* Causes very large memory use with gcc in LTO mode */
> +# define __flatten
> +#endif

Currently, this header avoids attributes that depend on configuration
options on purpose (see the comment at the top), so it would be best
to move it elsewhere, e.g. `compiler_types.h`.

Though I feel bad about having to move this attribute out since it is
just that config option compared to other more involved bits in
`compiler_types.h`... :(

Cheers,
Miguel