File onnx_onnxruntime_fix.patch of Package python-onnxruntime

diff -ruN onnxruntime-1.15.1-orig/onnxruntime/core/session/onnxruntime_c_api.cc onnxruntime-1.15.1/onnxruntime/core/session/onnxruntime_c_api.cc
--- onnxruntime-1.15.1-orig/onnxruntime/core/session/onnxruntime_c_api.cc	2023-06-16 11:51:14.000000000 -0400
+++ onnxruntime-1.15.1/onnxruntime/core/session/onnxruntime_c_api.cc	2023-09-20 18:06:18.245665704 -0300
@@ -39,6 +39,8 @@
 #include "core/platform/ort_mutex.h"
 #include "core/common/string_helper.h"
 
+#include "onnx/onnxruntime_fix.h"
+
 #ifdef USE_CUDA
 #include "core/providers/cuda/cuda_provider_factory.h"
 #include "core/providers/cuda/cuda_execution_provider_info.h"
@@ -2777,6 +2779,13 @@
 }
 
 const OrtApiBase* ORT_API_CALL OrtGetApiBase(void) NO_EXCEPTION {
+  class RunONNXRuntimeFix {
+   public:
+    RunONNXRuntimeFix() {
+      onnx::ONNXRuntimeFix::disableStaticRegistration();
+    }
+  };
+  static RunONNXRuntimeFix runONNXRuntimeFix;
   return &ort_api_base;
 }
 
openSUSE Build Service is sponsored by