Repository navigation
[libunwind] Remove MSVC C11 stdalign.h and stdatomic.h fake headers #129246
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
Open
mdh1418
wants to merge
2
commits into
dotnet:main
Choose a base branch
from
mdh1418:libunwind-msvc-c11-atomics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/native/external/libunwind/include/remote/win/fakestdalign.h.in
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
src/native/external/libunwind/include/remote/win/fakestdatomic.h.in
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,18 @@ if(CLR_CMAKE_HOST_WIN32) | |
| # Assume we are using default MSVC compiler | ||
| add_compile_options(/permissive-) | ||
|
|
||
| # Enable C11 atomics so libunwind's <stdatomic.h> usage | ||
| # (e.g. atomic_compare_exchange_strong in Gaddress_validator.c) compiles | ||
| # against MSVC's real header instead of a generated fake. | ||
| # /std:c11 is already implied by CMAKE_C_STANDARD=11 set in libunwind/CMakeLists.txt. | ||
| # CMAKE_C_COMPILER_ID is used instead of MSVC so that clang-cl (which sets | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not support clang-cl and I expect we would need number of changes to actually support it. This can be simplified to just use |
||
| # MSVC=TRUE but does not accept /experimental:c11atomics) is excluded. | ||
| # The COMPILE_LANGUAGE:C generator expression scopes the flag to C sources | ||
| # so it is not passed to C++ compilation (e.g. remote-unwind.cpp). | ||
| if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") | ||
| add_compile_options($<$<COMPILE_LANGUAGE:C>:/experimental:c11atomics>) | ||
| endif() | ||
|
|
||
| # include paths | ||
| include_directories(${CLR_SRC_NATIVE_DIR}/external/libunwind/include/tdep) | ||
| include_directories(${CLR_SRC_NATIVE_DIR}/external/libunwind/include) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this comment states
/std:c11is implied byCMAKE_C_STANDARD=11set inlibunwind/CMakeLists.txt, but that upstream file is not part of the cross-DAC build.src/coreclr/CMakeLists.txtaddslibunwind_extrasviaadd_subdirectory(...external/libunwind_extras ...), and thislibunwind_extras/CMakeLists.txtdoes not setCMAKE_C_STANDARD. The flag works because current MSVC defaults to a C11/C17 language mode for.cfiles, not because of that setting. Consider correcting the comment so future readers don't rely on aCMAKE_C_STANDARDvalue that isn't actually in effect here.