zf8848 / protobuf

Automatically exported from code.google.com/p/protobuf
Other
0 stars 0 forks source link

Cannot compile Google Protocol Buffers on z/OS #290

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Build Google Protocol Buffers on a z/OS system as follows:

_CXX_CXXSUFFIX=cpp ./configure --prefix=/tmp/gpb_64

_CXX_OPTIONS="-Wc,LP64 -Wl,LP64 -Wc,TARGET(zOSV1R11) -Wc,LANGLVL(EXTENDED) 
-D_OPEN_THREADS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_OPEN_SYS 
-D_ISOC99_SOURCE" make -j20 clean all

What is the expected output? What do you see instead?

I expect the build to pass successfully so I can run the install phase. Instead 
I see the following output from a unit test:

libtool: link: c++ -DNDEBUG -o protoc main.o  ./.libs/libprotobuf.a 
./.libs/libprotoc.a /MVK3/tmp/sstone/protobuf-2.4.1/src/.libs/libprotobuf.a
oldpwd=`pwd` && ( cd . && $oldpwd/protoc -I. --cpp_out=$oldpwd 
google/protobuf/unittest.proto google/protobuf/unittest_empty.proto 
google/protobuf/unittest_import.proto google/protobuf/unittest_mset.proto 
google/protobuf/unittest_optimize_for.proto 
google/protobuf/unittest_embed_optimize_for.proto 
google/protobuf/unittest_custom_options.proto 
google/protobuf/unittest_lite.proto google/protobuf/unittest_import_lite.proto 
google/protobuf/unittest_lite_imports_nonlite.proto 
google/protobuf/unittest_no_generic_services.proto 
google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto )
libprotobuf ERROR ./google/protobuf/descriptor_database.cc:314] Invalid file 
descriptor data passed to EncodedDescriptorDatabase::Add().
libprotobuf FATAL ./google/protobuf/descriptor.cc:862] CHECK failed: 
generated_database_->Add(encoded_file_descriptor, size): 
CEE5207E The signal SIGABRT was received.
make[2]: *** [unittest_proto_middleman] Error 131
make[2]: Leaving directory `/MVK3/tmp/sstone/protobuf-2.4.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/MVK3/tmp/sstone/protobuf-2.4.1'
make: *** [all] Error 2

What version of the product are you using? On what operating system?

I am using Google Protocol Buffers 2.4.1. I also tried 2.4.0a and 2.1.0. The 
system is running z/OS V1R11 with the XL C/C++ V1R11 compilers.

Please provide any additional information below.

I suspect the issue may be caused by an expectation that some of the data 
*somewhere* will be in ASCII, but it is actually in EBCDIC because of the 
operating system. I have managed to get this working on AIX (POWER), RHEL (x86, 
390) and Windows (x86) systems without any issues.

Original issue reported on code.google.com by simonsto...@gmail.com on 11 May 2011 at 4:43

GoogleCodeExporter commented 9 years ago
Could you please send a patch for this? 

Original comment by liujisi@google.com on 13 May 2011 at 7:14

GoogleCodeExporter commented 9 years ago
Hi,

I don't have a patch file -- and my sources are about 1 year old
anyways -- I just added that  #pragma to every C and H file.

Original comment by ury.se...@gmail.com on 13 May 2011 at 9:38

GoogleCodeExporter commented 9 years ago
I managed to get this working without editing the source files - I specified 
-Wc,ASCII as a compiler option. Note that this means any generated GPB code 
must also be built with -Wc,ASCII. 

Original comment by simonsto...@gmail.com on 5 Jul 2011 at 2:04