There's only one problem with this.  It assumes that you have a locally 
compiled and installed the protoc compiler.  Thus, before building a 
cross-compiled version, one must also build a native version.  This is an 
unnecessary dependency that should be avoided.

Instead, you should provide a mechanism to disable the generation of all tests 


From: Kenton Varda []
Sent: Thursday, May 14, 2009 3:16 PM
To: Madsen, Reid; anthonyp
Subject: Re: Cross-compile of Google Protocol Buffers fails

FYI:  This is fixed in the 2.1.0 release.  Use the --with-protoc option to 
configure to tell it to use a pre-compiled protoc executable during the build 
process, instead of using the one it just built.  This should allow 
On Mon, Feb 2, 2009 at 5:54 PM, Kenton Varda 
<<>> wrote:
Tests are not run as part of the build.  I think the actual problem is that the 
makefile is attempting to invoke protoc to generate some .pb.* files which are 
then compiled into the tests (though I think automake builds them even if you 
aren't compiling tests because it is too dumb to know).  You should be able to 
prevent this by making sure those files are already there before you run make, 
e.g. by copying the .pb.* files over from a directory where you have run a 
normal build.

I suppose we should find some trick to make this easier...

On Mon, Feb 2, 2009 at 12:37 PM, 
<<>> wrote:

The build procedures for GPB don't work when cross-compiling.  The crux of the 
matter is that the build attempts to run tests using cross-compiled binaries.  
This of course fails because the cross-compiled binaries are incompatible with 
the current host's architecture.

To support cross-compilation, tests should never be run as a part of the build, 
but should be deferred to a "make check", or "make tests" step.
Reid Madsen | Principal Engineer | Tektronix, Inc. | 469-330-4018 |<><<>>

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to