Trouble cross-compilling gRPC for an older platform

68 views
Skip to first unread message

embedde...@gmail.com

unread,
Mar 22, 2018, 12:54:47 PM3/22/18
to grpc.io
Hi all,  

I am looking for some help in cross-compiling gRPC for an ARM7 using Buildroot-2014 and an older codesourcery toolchain with gcc-4.3.3.  I intend to use gRPC++ and Google's Cloud Speech API to add voice-to-text support to my board.  Because my compiler does not support c++11, I am only interested in using gRPC versions 1.0.0 and lower (https://github.com/grpc/grpc/issues/10036).  I was able to build protobuf-2.5.0 but ran into difficulties building with higher versions.  The gRPC buildroot config and makefile came from here

During the build phase, I am getting the following error:

>>> grpc release-0_11_0 Building

[MAKE]    Generating cache.mk
[C]       Compiling src/core/support/alloc.c
[C]       Compiling src/core/support/cmdline.c
[C]       Compiling src/core/support/cpu_iphone.c
[C]       Compiling src/core/support/cpu_posix.c
[C]       Compiling src/core/support/cpu_linux.c
[C]       Compiling src/core/support/cpu_windows.c
[C]       Compiling src/core/support/env_linux.c   
cc1: warnings being treated as errors
cc1: error: include location "/usr/local/include" is unsafe for cross-compilation

First, what is the correct method to disable Werror?  I've tried adding -Wno-implicit-fallthrough to my CFLAGS and also GRPC_CONF_OPT = --disable-Werror but the issue remains.

Best I can tell, buildroot should isolate the target files from the host.  So where is this coming from?  I've tried removing references to /usr/local/include from the top level Makefile and templates/Makefile.template with no change.  Has anyone run into similar build issues before? 

I would like to stick with buildroot as my method of cross-compiling, but if anyone has alternative suggestions I am all ears. 

Thanks for the help!
Message has been deleted

embedde...@gmail.com

unread,
Mar 27, 2018, 5:28:15 PM3/27/18
to grpc.io
Looks like my update was deleted...weird.




I moved past the error by changing lines in buildroot;s grpc.mk:
define GRPC_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(GRPC_MAKE_OPT) -C $(@D) static shared
endef

I was able to work past the next build error, ‘EPOLL_CLOEXEC’ undeclared, using the information documented in this issue.

I am currently having trouble with this error message

"The target you are trying to run requires protobuf 3.0.0+"
"Your system doesn't have it, and neither does the third_party directory."

Up to this point I was under the assumption that I could continue running with protobuf 2.5.0.  After a few workarounds, I can cross-compile protobuf version 3.0.0.  However, I continue to get the same build error message for gRPC.  I think this is because the makefile isn't using the correct  protoc and/or the target protobuf.  I've been reading through this mailing list which talks about some revisions to the gRPC buildroot package that was forked from gfiber.  Regretfully it does not look like the fixes were published.

Anyone with buildroot knowledge able to provide some guidance? 

Nicolas Noble

unread,
Apr 4, 2018, 3:41:51 PM4/4/18
to grpc.io
You can't build all of gRPC without protobuf 3.0. The specifics are that you can use gRPC directly without protobuf, or with an older version of protobuf, but you won't be able to use all the C++ coating we have to use protobuf, you'll have to provide something else yourself, which isn't trivial at all.
Reply all
Reply to author
Forward
0 new messages