Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/coreclr/pal/src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#cmakedefine01 HAVE_SCHED_SETAFFINITY
#cmakedefine HAVE_UNW_GET_SAVE_LOC
#cmakedefine HAVE_UNW_GET_ACCESSORS
#cmakedefine HAVE_UNW_AARCH64_X19
#cmakedefine01 HAVE_XSWDEV
#cmakedefine01 HAVE_XSW_USAGE
#cmakedefine01 HAVE_PUBLIC_XSTATE_STRUCT
Expand Down
9 changes: 9 additions & 0 deletions src/coreclr/pal/src/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,15 @@ int main(int argc, char **argv)
check_symbol_exists(unw_get_save_loc libunwind.h HAVE_UNW_GET_SAVE_LOC)
check_symbol_exists(unw_get_accessors libunwind.h HAVE_UNW_GET_ACCESSORS)

check_cxx_source_compiles("
#include <libunwind.h>

int main(int argc, char **argv)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to not to use compilation check, as it would require adding this HAVE_UNW_AARCH64_X19 to tryrun.cmake. We should use check_symbol_exists instead (I hope it will work for this symbol on both mac and Linux) which cmake can perform against target frame headers even in cross build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I tried, but check_symbol_exists did not work for some reason. I concluded it does not work for enum elements, but perhaps I just used it incorrectly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I basically just did:
check_symbol_exists(UNW_AARCH64_X19 libunwind.h HAVE_UNW_AARCH64_X19)

similar to the other checks above, but maybe this is not the way for enums?

check_cxx_source_compiles works though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I guess this is the reason:

CheckSymbolExists
Provides a macro to check if a symbol exists as a function, variable, or macro in C

Actually, I was wrong, the check_cxx_source_compiles is actually still performed dynamically in cross build, the one that is not is the CheckCXXSourceRuns. So this is ok.

{
int flag = (int)UNW_AARCH64_X19;
return 0;
}" HAVE_UNW_AARCH64_X19)

if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
list(REMOVE_AT CMAKE_REQUIRED_INCLUDES 0 1)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/src/exception/seh-unwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Module Name:

#endif // HOST_UNIX

#if defined(TARGET_OSX) && defined(HOST_ARM64)
#if defined(TARGET_OSX) && defined(HOST_ARM64) && !defined(HAVE_UNW_AARCH64_X19)
// MacOS uses ARM64 instead of AARCH64 to describe these registers
// Create aliases to reuse more code
enum
Expand Down