From ffbf5596cd8e2d0e44451034b2e508d06df4c77b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 2 Oct 2022 19:15:04 -0400 Subject: [PATCH] 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. --- .../CodeGenerators/LibUnicode/GenerateUnicodeData.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp index 15efd02dec..871b6d2769 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp @@ -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 parse_special_casing(Core::Stream::BufferedFile& file, UnicodeData& unicode_data) { Array buffer; @@ -644,6 +649,9 @@ static ErrorOr 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 generate_unicode_data_header(Core::Stream::BufferedFile& file, UnicodeData& unicode_data) {