mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-18 01:54:05 +00:00
update onnx.patch to apply wasm build break fix (#17104)
### Description This PR fixes build break for WebAssembly introduced in6986981482(435ad2b1d8). This change updates onnx.patch in onnxruntime repo. the corresponding PR in onnx repo is: https://github.com/onnx/onnx/pull/5495. It may takes a while for the next onnx version bump.
This commit is contained in:
parent
6697635b91
commit
5704e71b89
1 changed files with 15 additions and 2 deletions
|
|
@ -38,7 +38,7 @@ index 0aab3e26..0f859267 100644
|
|||
@@ -47,10 +47,28 @@
|
||||
#define ONNX_API ONNX_IMPORT
|
||||
#endif
|
||||
|
||||
|
||||
+#if defined(__GNUC__)
|
||||
+#pragma GCC diagnostic push
|
||||
+
|
||||
|
|
@ -58,9 +58,22 @@ index 0aab3e26..0f859267 100644
|
|||
#else
|
||||
#include "onnx/onnx.pb.h"
|
||||
#endif
|
||||
|
||||
|
||||
+#if defined(__GNUC__)
|
||||
+#pragma GCC diagnostic pop
|
||||
+#endif
|
||||
+
|
||||
#endif // ! ONNX_ONNX_PB_H
|
||||
diff --git a/onnx/checker.cc b/onnx/checker.cc
|
||||
index 8fdaf037..1beb1b88 100644
|
||||
--- a/onnx/checker.cc
|
||||
+++ b/onnx/checker.cc
|
||||
@@ -190,7 +190,7 @@ void check_tensor(const TensorProto& tensor, const CheckerContext& ctx) {
|
||||
}
|
||||
std::string data_path = path_join(ctx.get_model_dir(), relative_path);
|
||||
// use stat64 to check whether the file exists
|
||||
-#ifdef __APPLE__
|
||||
+#if defined(__APPLE__) || defined(__wasm__)
|
||||
struct stat buffer; // APPLE does not have stat64
|
||||
if (stat((data_path).c_str(), &buffer) != 0) {
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in a new issue