Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit a6c64da

Browse files
authored
Port to 3.1 - Fix bad configure tests (#28106)
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
1 parent 47c5d7b commit a6c64da

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/pal/src/configure.cmake

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

1033-
set(CMAKE_REQUIRED_FLAGS "-c -Werror=implicit-function-declaration")
1034-
10351033
check_c_source_compiles("
10361034
#include <libunwind.h>
10371035
#include <ucontext.h>
@@ -1043,29 +1041,9 @@ int main(int argc, char **argv)
10431041
return 0;
10441042
}" UNWIND_CONTEXT_IS_UCONTEXT_T)
10451043

1046-
check_c_source_compiles("
1047-
#include <libunwind.h>
1048-
1049-
int main(int argc, char **argv) {
1050-
unw_cursor_t cursor;
1051-
unw_save_loc_t saveLoc;
1052-
int reg = UNW_REG_IP;
1053-
unw_get_save_loc(&cursor, reg, &saveLoc);
1054-
1055-
return 0;
1056-
}" HAVE_UNW_GET_SAVE_LOC)
1057-
1058-
check_c_source_compiles("
1059-
#include <libunwind.h>
1060-
1061-
int main(int argc, char **argv) {
1062-
unw_addr_space_t as;
1063-
unw_get_accessors(as);
1064-
1065-
return 0;
1066-
}" HAVE_UNW_GET_ACCESSORS)
1044+
check_symbol_exists(unw_get_save_loc libunwind.h HAVE_UNW_GET_SAVE_LOC)
1045+
check_symbol_exists(unw_get_accessors libunwind.h HAVE_UNW_GET_ACCESSORS)
10671046

1068-
set(CMAKE_REQUIRED_FLAGS)
10691047
if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
10701048
list(REMOVE_AT CMAKE_REQUIRED_INCLUDES 0 1)
10711049
endif()

0 commit comments

Comments
 (0)