Skip to content

Commit 62eb1b2

Browse files
Fix bad configure tests (#43031)
There was an extra -c in the CMAKE_REQUIRED_FLAGS set for testing HAVE_UNW_GET_ACCESSORS and HAVE_UNW_GET_SAVE_LOC that was breaking build of coreclr under homebrew. The option was somehow making these checks behave on ARM Linux, eveb though it is not clear to me why, as it was just causing this option to be passed to the compiler twice at different positions of the command line of the cmake tests. This change fixes it by using check_symbol_exists instead of check_c_source_compiles, since just removing the duplicite -c was resulting in the check failing on ARM / ARM64 Linux due to a missing symbol from libunwind during linking. Co-authored-by: Jan Vorlicek <[email protected]>
1 parent c47568d commit 62eb1b2

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/coreclr/src/pal/src/configure.cmake

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,8 +1049,6 @@ if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
10491049
list(INSERT CMAKE_REQUIRED_INCLUDES 0 ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include)
10501050
endif()
10511051

1052-
set(CMAKE_REQUIRED_FLAGS "-c -Werror=implicit-function-declaration")
1053-
10541052
check_c_source_compiles("
10551053
#include <libunwind.h>
10561054
#include <ucontext.h>
@@ -1062,29 +1060,9 @@ int main(int argc, char **argv)
10621060
return 0;
10631061
}" UNWIND_CONTEXT_IS_UCONTEXT_T)
10641062

1065-
check_c_source_compiles("
1066-
#include <libunwind.h>
1067-
1068-
int main(int argc, char **argv) {
1069-
unw_cursor_t cursor;
1070-
unw_save_loc_t saveLoc;
1071-
int reg = UNW_REG_IP;
1072-
unw_get_save_loc(&cursor, reg, &saveLoc);
1073-
1074-
return 0;
1075-
}" HAVE_UNW_GET_SAVE_LOC)
1076-
1077-
check_c_source_compiles("
1078-
#include <libunwind.h>
1079-
1080-
int main(int argc, char **argv) {
1081-
unw_addr_space_t as;
1082-
unw_get_accessors(as);
1083-
1084-
return 0;
1085-
}" HAVE_UNW_GET_ACCESSORS)
1063+
check_symbol_exists(unw_get_save_loc libunwind.h HAVE_UNW_GET_SAVE_LOC)
1064+
check_symbol_exists(unw_get_accessors libunwind.h HAVE_UNW_GET_ACCESSORS)
10861065

1087-
set(CMAKE_REQUIRED_FLAGS)
10881066
if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
10891067
list(REMOVE_AT CMAKE_REQUIRED_INCLUDES 0 1)
10901068
endif()

0 commit comments

Comments
 (0)