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

Build the import lib with _ENFORCE_ONLY_CORE_HEADERS #3621

Merged
merged 4 commits into from
Apr 7, 2023

Conversation

StephanTLavavej
Copy link
Member

Related to (and inspired by) #2141.

This will need some MSVC-internal changes, but the impact is surprisingly small.

  • In stl/CMakeLists.txt, we need to define _ENFORCE_ONLY_CORE_HEADERS when building the msvcp${D_SUFFIX}_implib_objects.
    • We don't want to modify the other place that the IMPLIB_SOURCES are mentioned - libcpmt${FLAVOR_SUFFIX} is the static lib.
  • nothrow.cpp was including <new>, a non-core header, but it can just include <vcruntime_new.h> which is where nothrow_t is actually defined.
    • We can keep _STD_BEGIN/_STD_END if we include <yvals_core.h>.
    • I'm dropping the useless // define nothrow comment.
  • locale0.cpp and <xfacet> are too difficult to untangle at this time. I'm just exempting them from this enforcement.

@StephanTLavavej StephanTLavavej added the build Related to the build system label Apr 4, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner April 4, 2023 08:24
@github-actions github-actions bot added this to Initial Review in Code Reviews Apr 4, 2023
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in Code Reviews Apr 4, 2023
@strega-nil-ms strega-nil-ms moved this from Final Review to Ready To Merge in Code Reviews Apr 5, 2023
@StephanTLavavej StephanTLavavej self-assigned this Apr 7, 2023
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Copy link
Member Author

I've resolved a trivial adjacent-add conflict in stl/src/locale0.cpp by taking #2141's comment before this PR's #undef.

@StephanTLavavej StephanTLavavej merged commit 10f0c3a into microsoft:main Apr 7, 2023
Code Reviews automation moved this from Ready To Merge to Done Apr 7, 2023
@StephanTLavavej StephanTLavavej deleted the core-import-lib branch April 7, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the build system
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants