Skip to content

Flutter engine host release build fails on macos  #57207

Closed
@jwoelke

Description

@jwoelke

When I try to build the flutter engine host in release mode on macos, then this fails.
(no issues to build ios release build)

./flutter/tools/gn --runtime-mode=release
ninja -C out/host_release

On a macbook pro 2018 i7 with 16Gb mem, it at one points runs out of memory.
The last few hundred build steps (of 4000+) fail. The build then just freezes
e.g. at
LINK ./shell_benchmarks
or
LINK ./flutter_tester
or
SOLINK libFlutterMacOS.dylib libFlutterMacOS.dylib.TOC
....
It freezes not always on the same step!

I can build the host debug version without any issues
The same build on MacBook Pro i9 with 32Gb mem succeeds.

Are there any minimum memory requirements to build the macos host release?


Will compiling the app against an ios release build and using the host debug build result in the same build as using the host release build?


Next to the issue above with is not based on latest from master, the current master (12th of may) also fails but also creates different compilation errors:

_ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '__gxx_personality_v0' for architecture x86_64

What can i to do resolve these?


ninja: Entering directory `out/host_release'
[3915/4426] LINK ./fml_benchmarks
FAILED: fml_benchmarks
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./fml_benchmarks -Wl,-filelist,./fml_benchmarks.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[3921/4426] LINK ./fml_unittests
FAILED: fml_unittests
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./fml_unittests -Wl,-filelist,./fml_unittests.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[3922/4426] LINK ./common_cpp_core_unittests
FAILED: common_cpp_core_unittests
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./common_cpp_core_unittests -Wl,-filelist,./common_cpp_core_unittests.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[3923/4426] LINK ./client_wrapper_glfw_unittests
FAILED: client_wrapper_glfw_unittests
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./client_wrapper_glfw_unittests -Wl,-filelist,./client_wrapper_glfw_unittests.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[3924/4426] LINK ./client_wrapper_unittests
FAILED: client_wrapper_unittests
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./client_wrapper_unittests -Wl,-filelist,./client_wrapper_unittests.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Activity

changed the title [-]Flutter engine release build fails on macos [/-] [+]Flutter engine host release build fails on macos [/+] on May 14, 2020
added
engineflutter/engine repository. See also e: labels.
c: crashStack traces logged to the console
on May 14, 2020
jwoelke

jwoelke commented on May 14, 2020

@jwoelke
Author

Screenshot 2020-05-14 at 14 01 21

jason-simmons

jason-simmons commented on May 15, 2020

@jason-simmons
Member

Try disabling link-time optimization by passing the --no-lto flag to flutter/tools/gn

jwoelke

jwoelke commented on May 15, 2020

@jwoelke
Author

This seems to solve both issues
(./flutter/tools/gn --no-lto --runtime-mode=release)

Since this applies to the build tools, could this in any way affect optimisation for the generated flutter app (AOT/release build)?

gaaclarke

gaaclarke commented on Jun 12, 2020

@gaaclarke
Member

@jwoelke Yes, it affects optimization. Your builds were working correctly it just takes a LONG time to link with link-time-optimization. Walk away and have a coffee.

js2702

js2702 commented on Nov 7, 2020

@js2702

Hello! I'm seeing the same issue when building the engine. I'm on MacOS 10.15.7 with Xcode 12.1. I'm trying to build the engine on 1d12d82d9cb54876f58044aa52198d53ec841c3d.

ninja: Entering directory `out/host_release'
[4741/5757] LINK ./font-subset
FAILED: font-subset
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./font-subset -Wl,-filelist,./font-subset.rsp  -framework Foundation -framework CoreGraphics -framework CoreText
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[4751/5757] LINK ./fml_benchmarks
FAILED: fml_benchmarks
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./fml_benchmarks -Wl,-filelist,./fml_benchmarks.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[4752/5757] LINK ./fml_unittests
FAILED: fml_unittests
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./fml_unittests -Wl,-filelist,./fml_unittests.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[4754/5757] LINK ./common_cpp_core_unittests
FAILED: common_cpp_core_unittests
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./common_cpp_core_unittests -Wl,-filelist,./common_cpp_core_unittests.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[4755/5757] LINK ./client_wrapper_glfw_unittests
FAILED: client_wrapper_glfw_unittests
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./client_wrapper_glfw_unittests -Wl,-filelist,./client_wrapper_glfw_unittests.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[4756/5757] LINK ./client_wrapper_unittests_legacy_encodable_value
FAILED: client_wrapper_unittests_legacy_encodable_value
../../buildtools/mac-x64/clang/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.11.0 -flto -arch x86_64 -nostdlib++ -stdlib=libc++ -Wl,-dead_strip -Wl,-search_paths_first -L. -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie  -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./client_wrapper_unittests_legacy_encodable_value -Wl,-filelist,./client_wrapper_unittests_legacy_encodable_value.rsp  -framework Foundation -ldl -lpthread
ld: reference to bitcode symbol '___gxx_personality_v0' which LTO has not compiled in '___gxx_personality_v0' for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[4758/5757] LINK ./gen_snapshot_product
ninja: build stopped: subcommand failed.

Does the --no-lto affect performance of the generated flutter app or only affects the build time?

AlBlanc

AlBlanc commented on Apr 23, 2021

@AlBlanc

I am having the same issue using the master branch and the --no-lto flag

eggfly

eggfly commented on Jul 18, 2021

@eggfly
Member

I am having the same issue using the master branch and the --no-lto flag

+1 me too

github-actions

github-actions commented on Aug 1, 2021

@github-actions

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

locked as resolved and limited conversation to collaborators on Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleengineflutter/engine repository. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @eggfly@js2702@jwoelke@AlBlanc@jason-simmons

        Issue actions

          Flutter engine host release build fails on macos · Issue #57207 · flutter/flutter