Lagom: Work around gcc codegen bug

Without this, GenerateUnicodeData crashes when run during the build.
With this, `serenity.sh run` brings up a running SerenityOS.
Since GenerateUnicodeData doesn't take a lot of time to run, just
disable optimizations to work around the problem for now.

Works around #15449.
This commit is contained in:
Nico Weber 2022-10-02 19:15:04 -04:00 committed by Linus Groh
parent e0a6ed4bc0
commit ffbf5596cd
Notes: sideshowbarker 2024-07-17 06:23:53 +09:00

View file

@ -198,6 +198,11 @@ static CodePointRange parse_code_point_range(StringView list)
return code_point_range;
}
// gcc-11, gcc-12 have a codegen bug on (at least) intel macOS 10.15, see #15449.
#if defined(__GNUC__) && !defined(__clang__) && defined(AK_OS_MACOS)
# pragma GCC push_options
# pragma GCC optimize("O0")
#endif
static ErrorOr<void> parse_special_casing(Core::Stream::BufferedFile& file, UnicodeData& unicode_data)
{
Array<u8, 1024> buffer;
@ -644,6 +649,9 @@ static ErrorOr<void> parse_unicode_data(Core::Stream::BufferedFile& file, Unicod
return {};
}
#if defined(__GNUC__) && !defined(__clang__) && defined(AK_OS_MACOS)
# pragma GCC pop_options
#endif
static ErrorOr<void> generate_unicode_data_header(Core::Stream::BufferedFile& file, UnicodeData& unicode_data)
{