Compile native code with -ffunction-sections#79322
Conversation
We specify `/Gy` on Windows, but don't do this on non-Windows. This looks like an omission. For NativeAOT, doing this saves ~140 kB in size on a Hello World.
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
|
Need to suppress this for tvOS. |
|
runtime/eng/native/configurecompiler.cmake Lines 163 to 165 in e0b86fc |
eng/native/configurecompiler.cmake
Outdated
|
|
||
| # Separate functions so linker can remove them. But not on Apple mobile platforms because | ||
| # -ffunction-sections is not supported with -fembed-bitcode. | ||
| if (NOT CLR_CMAKE_HOST_TVOS AND NOT CLR_CMAKE_HOST_IOS) |
There was a problem hiding this comment.
I believe this should work for iOS, and only tvOS needs be disabled
There was a problem hiding this comment.
Saw the failed iOS leg and assumed it's the same problem. But iOS maybe failed for unrelated reasons then. I'll put it back:
.packages/microsoft.dotnet.helix.sdk/8.0.0-beta.22579.2/tools/Microsoft.DotNet.Helix.Sdk.MultiQueue.targets(90,5): error : (NETCORE_ENGINEERING_TELEMETRY=Test) Work item System.Runtime.Tests in job 5143df8d-e525-435f-9a37-d062df01b8cb has failed.
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure Issue DetailsWe specify Cc @dotnet/ilc-contrib
|
| # Separate functions so linker can remove them. But not on tvOS because | ||
| # -ffunction-sections is not supported with -fembed-bitcode. | ||
| if (NOT CLR_CMAKE_HOST_TVOS) | ||
| add_compile_options(-ffunction-sections) | ||
| endif() |
There was a problem hiding this comment.
Is tvOS still compiled with bitcode? I thought Apple basically deprecated that across the board.
https://developer.apple.com/documentation/Xcode-Release-Notes/xcode-14-release-notes:
Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.
Xcode no longer builds bitcode by default and generates a warning message if a project explicitly enables bitcode: “Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode.” The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store. Debug symbols can only be downloaded from App Store Connect / TestFlight for existing bitcode submissions and are no longer available for submissions made with Xcode 14. (86118779)
There was a problem hiding this comment.
CI is using v13:
Running 'CC="/Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"..
There was a problem hiding this comment.
I don't think it necessarily matters what CI uses. The change is that App Store doesn't require it anymore for new submissions.
We specify
/Gyon Windows, but don't do this on non-Windows. This looks like an omission. For NativeAOT, doing this saves ~140 kB in size on a Hello World.Cc @dotnet/ilc-contrib