Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /guard:cf flavor of bootstrapper #1523

Merged

Conversation

MichalStrehovsky
Copy link
Member

No description provided.

@MichalStrehovsky MichalStrehovsky added the area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation label Sep 7, 2021
@MichalStrehovsky
Copy link
Member Author

I also spent a bit time thinking how to do System.IO.Compression.Native (also with respect to #106).

Seems like S.I.C.lib with /guard:cf is almost what we need for the single-file host (the only other difference is LTCG - not sure if it's giving us anything for this lib though).

I see two options:

  • Build two versions of S.I.C.Native static lib: one with CFG, the other without. Disable LTCG. Single-file host will use the one with CFG. Maybe we should name the one without CFG as .NoGuardCF for CoreCLR's benefit. (i.e. the invert the suffix logic I introduced for NativeAOT bits).
  • Build three versions S.I.C.Native static libs: for single file host, and NativeAOT GuardCF/NoGuard.

In either case, we should probably switch to the plan that single file host is on and build the shims as part of coreclr partition build (i.e. the STATIC_LIBS_ONLY plan) so that we can control what flavors of libs build.

What do you think?

@MichalStrehovsky
Copy link
Member Author

Putting the shims on the STATIC_LIBS_ONLY plan will also help with some other aspects of the tech debt since we don't want to rely on the libraries build to produce and keep these libraries for us (it requires twisting the framework packaging in a way it's not meant to work - #140). STATIC_LIBS_ONLY plan lets us treat these libraries same as Bootstrapper or Runtime when it comes to packaging.

@jkotas
Copy link
Member

jkotas commented Sep 7, 2021

the only other difference is LTCG - not sure if it's giving us anything for this lib though

The compiler and linker have to match with LTCG. We have disabled LTCG to make things work when the compiler in the build lab and linker at the end user machine are not exactly the same. If we were to enable LTCG, we would need to figure out how to download the exact right version of the linker.

@MichalStrehovsky
Copy link
Member Author

I meant whether LTCG is giving any benefit in the CoreCLR config and whether we need an extra lib flavor just to have one with LTCG for CoreCLR (it's the difference between the "build 3 libs" and "build 2 libs" above is whether we can get away without LTCG for all products)

@jkotas
Copy link
Member

jkotas commented Sep 7, 2021

I suspect that LTCG (and the whole program optimization that comes with it) is going to benefit CoreCLR config in some cases.

@MichalStrehovsky MichalStrehovsky merged commit 67927bd into dotnet:feature/NativeAOT Sep 8, 2021
@MichalStrehovsky MichalStrehovsky deleted the bootstrapguard branch September 8, 2021 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants