Skip to content

Commit f91d24c

Browse files
authored
[build] fix build break on arm (microsoft#25601)
### Description ~~Remove the out-of-dated patch file.~~ Remove the changes of `src/arm/windows/init.c` from the patch file. Changes of `include/cpuinfo.h` is kept.
1 parent 4a8a289 commit f91d24c

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

cmake/external/onnxruntime_external_deps.cmake

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -367,23 +367,23 @@ if (CPUINFO_SUPPORTED)
367367
set(CPUINFO_BUILD_MOCK_TESTS OFF CACHE INTERNAL "")
368368
set(CPUINFO_BUILD_BENCHMARKS OFF CACHE INTERNAL "")
369369
if (onnxruntime_target_platform STREQUAL "ARM64EC" OR onnxruntime_target_platform STREQUAL "ARM64")
370-
message(STATUS "Applying a patch for Windows ARM64/ARM64EC in cpuinfo")
371-
onnxruntime_fetchcontent_declare(
372-
pytorch_cpuinfo
373-
URL ${DEP_URL_pytorch_cpuinfo}
374-
URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo}
375-
EXCLUDE_FROM_ALL
376-
PATCH_COMMAND ${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/cpuinfo/9bb12d342fd9479679d505d93a478a6f9cd50a47.patch
377-
FIND_PACKAGE_ARGS NAMES cpuinfo
378-
)
370+
message(STATUS "Applying a patch for Windows ARM64/ARM64EC in cpuinfo")
371+
onnxruntime_fetchcontent_declare(
372+
pytorch_cpuinfo
373+
URL ${DEP_URL_pytorch_cpuinfo}
374+
URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo}
375+
EXCLUDE_FROM_ALL
376+
PATCH_COMMAND ${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/cpuinfo/patch_cpuinfo_h_for_arm64ec.patch
377+
FIND_PACKAGE_ARGS NAMES cpuinfo
378+
)
379379
else()
380-
onnxruntime_fetchcontent_declare(
381-
pytorch_cpuinfo
382-
URL ${DEP_URL_pytorch_cpuinfo}
383-
URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo}
384-
EXCLUDE_FROM_ALL
385-
FIND_PACKAGE_ARGS NAMES cpuinfo
386-
)
380+
onnxruntime_fetchcontent_declare(
381+
pytorch_cpuinfo
382+
URL ${DEP_URL_pytorch_cpuinfo}
383+
URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo}
384+
EXCLUDE_FROM_ALL
385+
FIND_PACKAGE_ARGS NAMES cpuinfo
386+
)
387387
endif()
388388
set(ONNXRUNTIME_CPUINFO_PROJ pytorch_cpuinfo)
389389
onnxruntime_fetchcontent_makeavailable(${ONNXRUNTIME_CPUINFO_PROJ})
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/include/cpuinfo.h b/include/cpuinfo.h
2-
index 6eb4b8c..4346a5a 100644
2+
index f1d35d4..9e454d2 100644
33
--- a/include/cpuinfo.h
44
+++ b/include/cpuinfo.h
55
@@ -18,7 +18,7 @@
@@ -20,16 +20,3 @@ index 6eb4b8c..4346a5a 100644
2020
#define CPUINFO_ARCH_ARM64 1
2121
#endif
2222

23-
diff --git a/src/arm/windows/init.c b/src/arm/windows/init.c
24-
index de2f6cc..c3a7835 100644
25-
--- a/src/arm/windows/init.c
26-
+++ b/src/arm/windows/init.c
27-
@@ -175,7 +175,7 @@ static struct woa_chip_info* get_system_info_from_registry(void) {
28-
if (chip_info == NULL) {
29-
/* No match was found, so print a warning and assign the unknown
30-
* case. */
31-
- cpuinfo_log_error(
32-
+ cpuinfo_log_debug(
33-
"Unknown chip model name '%ls'.\nPlease add new Windows on Arm SoC/chip support to arm/windows/init.c!",
34-
text_buffer);
35-
} else {

0 commit comments

Comments
 (0)