Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@zanderso
Copy link
Member

@zanderso zanderso commented May 12, 2022

Rolls the buildroot to pick up a compensating change for new warnings: flutter/buildroot@8a1cf15, flutter/buildroot@9f99fc0

And combines the three rolls:
#33278
#33279
#33280

@zanderso
Copy link
Member Author

It looks like -fembed-bitcode-marker is leading to some issues with the new toolchain in the ios_debug build, from https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8814350562663012177/+/u/build_ios_debug/stdout?format=raw

ld64.lld: warning: Option `-bitcode_process_mode' is undocumented. Should lld implement it?
ld64.lld: error: cannot open marker: No such file or directory
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

The link is successful when I remove the -fembed-bitcode-marker flag. @dnfield @jmagman is that flag necessary, or is it an optimization?

@dnfield
Copy link
Contributor

dnfield commented May 12, 2022

It's expected to be used for debug builds - it basically says to add a section that syas "here's where the bitcode would go".

This seems like a regression in clang to me...

@dnfield
Copy link
Contributor

dnfield commented May 12, 2022

https://reviews.llvm.org/D29066 - forwarding this argument has been around for a while

@ilovepi
Copy link

ilovepi commented May 12, 2022

I don't think lld supports the -bitcode_process_mode flag yet. There is even a fixme for it in Clang's Darwin driver. You may have to fall back to ld64 on OSX until that is implemented if you require this feature.

https://github.com/llvm/llvm-project/blob/c2fb9c29b4076da8f68a27df2bee4a2f3c81c830/clang/lib/Driver/ToolChains/Darwin.cpp#L369

@jmagman
Copy link
Member

jmagman commented May 12, 2022

The link is successful when I remove the -fembed-bitcode-marker flag. @dnfield @jmagman is that flag necessary, or is it an optimization?

It's necessary, without it projects with bitcode on (like most add-to-app projects) will get an error when they link on frameworks without the marker, even in debug mode.

Tested linking a bitcode app on a framework with and without -fembed-bitcode-marker. Without:

Ld /Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Products/Debug-iphoneos/TestMarker.app/TestMarker normal (in target 'TestMarker' from project 'TestMarker')
    cd /Users/m/Projects/TestMarker
    /Users/m/Applications/Xcode-13-3-1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios15.4 -isysroot /Users/m/Applications/Xcode-13-3-1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -L/Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Products/Debug-iphoneos -F/Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Products/Debug-iphoneos -filelist /Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Intermediates.noindex/TestMarker.build/Debug-iphoneos/TestMarker.build/Objects-normal/arm64/TestMarker.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Intermediates.noindex/TestMarker.build/Debug-iphoneos/TestMarker.build/Objects-normal/arm64/TestMarker_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework TestFW -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Intermediates.noindex/TestMarker.build/Debug-iphoneos/TestMarker.build/Objects-normal/arm64/TestMarker_dependency_info.dat -o /Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Products/Debug-iphoneos/TestMarker.app/TestMarker

ld: '/Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Products/Debug-iphoneos/TestFW.framework/TestFW' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/m/Library/Developer/Xcode/DerivedData/TestMarker-dyotdkaassckftfqxmijpypbotqh/Build/Products/Debug-iphoneos/TestFW.framework/TestFW' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Shouldn't build ios_debug be using clang from Xcode's toolchain? What version is being rolled in? Always keeping an eye out for http://requiem/doc/postmortem126775.

@dnfield
Copy link
Contributor

dnfield commented May 12, 2022

ios_debug isn't using Xcode because it's not actually embedding any bitcode, and that way we can use GOMA.

@dnfield
Copy link
Contributor

dnfield commented May 12, 2022

The idea is if you're only using bitcode-marker there aren't compatibility concerns between toolchains

@dnfield
Copy link
Contributor

dnfield commented May 12, 2022

Falling back to ld64 should be fine - that would still let us use GOMA.

@jmagman
Copy link
Member

jmagman commented May 12, 2022

The idea is if you're only using bitcode-marker there aren't compatibility concerns between toolchains

That makes sense, was just checking it wasn't being used in release.

@dnfield
Copy link
Contributor

dnfield commented May 13, 2022

Woohoo we're green

@dnfield dnfield added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label May 13, 2022
@zanderso zanderso merged commit 094c83d into flutter:main May 13, 2022
@zanderso zanderso deleted the roll-clang branch May 13, 2022 00:09
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2022
zanderso added a commit that referenced this pull request May 13, 2022
zanderso added a commit that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2022
houhuayong pushed a commit to houhuayong/engine that referenced this pull request Jun 21, 2022
houhuayong pushed a commit to houhuayong/engine that referenced this pull request Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

platform-macos waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants