Conformance test runner big endian fixes (#13443)

Add some missing endian conversions so that the conformance tests can be run on big endian platforms.

The message length value created by the conformance test runner is little endian according to the comments in the file but actually was sent in the native endianness of the host. I was able to run the java, python, ruby, php and csharp test executables and they all expect little endian length values so those tests would hang on big endian machines. Only the cpp test executable was using native endian so it has been changed to expect little endian too.

Also change the fixed32 and fixed64 functions in binary_json_conformance_test_suite.cc to send the data as little endian which fixes some failures in the python conformance tests on big endian platforms.

Closes #13443

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13443 from linux-on-ibm-z:conformance-runner-little-endian-fix 4ef79489971c9ff4eff524d75afdbe85cf5ce234
PiperOrigin-RevId: 553958649
diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc
index 2fc9424..a7d9c2e 100644
--- a/conformance/conformance_cpp.cc
+++ b/conformance/conformance_cpp.cc
@@ -46,6 +46,7 @@
 #include "absl/status/statusor.h"
 #include "conformance/conformance.pb.h"
 #include "conformance/conformance.pb.h"
+#include "google/protobuf/endian.h"
 #include "google/protobuf/test_messages_proto2.pb.h"
 #include "google/protobuf/test_messages_proto3.pb.h"
 #include "google/protobuf/test_messages_proto3.pb.h"
@@ -228,6 +229,7 @@
     // EOF means we're done.
     return true;
   }
+  in_len = internal::little_endian::ToHost(in_len);
 
   std::string serialized_input;
   serialized_input.resize(in_len);
@@ -242,9 +244,12 @@
   std::string serialized_output;
   response->SerializeToString(&serialized_output);
 
-  uint32_t out_len = static_cast<uint32_t>(serialized_output.size());
+  uint32_t out_len = internal::little_endian::FromHost(
+      static_cast<uint32_t>(serialized_output.size()));
+
   RETURN_IF_ERROR(WriteFd(STDOUT_FILENO, &out_len, sizeof(out_len)));
-  RETURN_IF_ERROR(WriteFd(STDOUT_FILENO, serialized_output.data(), out_len));
+  RETURN_IF_ERROR(WriteFd(STDOUT_FILENO, serialized_output.data(),
+                          serialized_output.size()));
 
   if (verbose_) {
     ABSL_LOG(INFO) << "conformance-cpp: request=" << request.ShortDebugString()