kidok / protobuf

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

Patch for /trunk/src/google/protobuf/stubs/once.cc #637

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Specify the right type of once to fix this compilation failure:
http://autobuild.buildroot.net/results/cf1/cf147b9188d6787a6a1a6072bf9bc6f7ddf5e
5ae/build-end.log

Original issue reported on code.google.com by per...@carrosses.com on 9 May 2014 at 8:20

Attachments:

GoogleCodeExporter commented 9 years ago
Here is the full patch.

Original comment by per...@carrosses.com on 9 May 2014 at 8:34

Attachments:

GoogleCodeExporter commented 9 years ago
I have investigated a bit deeper.

It's failing on MIPS64 n64 because protobuf doesn't detect MIPS64 
architectures, so it thinks that is on a 32-bit architecture. The problem is 
that intptr_t on MIPS64 n64 is a 64-bit pointer. So, in the file 
src/google/protobuf/stubs/atomicops.h we have this line:

typedef intptr_t AtomicWord;

So, in MIPS64 n64 the AtomicWord type is 64-bit because intptr_t is 64-bit too. 
But, due that the MIPS64 architectures are not detected by protobuf, the 
"64-bit atomic operations" are not defined, so when the code tries to call, for 
instance, Acquire_Load(), it's actually calling the one for 32-bit instead of 
the one for 64-bit.

Original comment by per...@carrosses.com on 9 May 2014 at 12:59

GoogleCodeExporter commented 9 years ago
fixed by

https://codereview.appspot.com/130740043/
https://code.google.com/p/protobuf/source/detail?r=571

Original comment by jie...@google.com on 21 Aug 2014 at 11:46