Hi, thanks for the reply - we've got a simple buildroot mk file down to:
################################################################################
#
# grpc
#
################################################################################
GRPC_CUSTOM_VERSION = v1.12.0
GRPC_CUSTOM_SITE_METHOD = git
GRPC_CUSTOM_LICENSE = BSD-3-Clause
GRPC_CUSTOM_LICENSE_FILES = LICENSE
GRPC_CUSTOM_DEPENDENCIES = gflags gtest c-ares openssl protobuf zlib
GRPC_CUSTOM_INSTALL_STAGING = YES
GRPC_CUSTOM_MAKE_ENV = \
$(TARGET_MAKE_ENV) \
CC="$(TARGET_CC)" \
CXX="$(TARGET_CXX)" \
LD="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
STRIP="$(TARGET_STRIP)"
GRPC_CUSTOM_MAKE_OPTS = \
PROTOC="$(HOST_DIR)/usr/bin/protoc"
GRPC_CUSTOM_INSTALL_TARGET_OPTS = \
prefix="$(TARGET_DIR)/usr"
GRPC_CUSTOM_INSTALL_STAGING_OPTS = \
prefix="$(STAGING_DIR)/usr"
define GRPC_CUSTOM_BUILD_CMDS
$(GRPC_CUSTOM_MAKE_ENV) $(MAKE) $(GRPC_CUSTOM_MAKE_OPTS) -C $(@D) \
static
endef
define GRPC_CUSTOM_INSTALL_STAGING_CMDS
$(GRPC_CUSTOM_MAKE_ENV) $(MAKE) $(GRPC_CUSTOM_INSTALL_STAGING_OPTS) -C $(@D) \
install-headers install-static_c install-static_cxx
endef
define GRPC_CUSTOM_INSTALL_TARGET_CMDS
$(GRPC_CUSTOM_MAKE_ENV) $(MAKE) $(GRPC_CUSTOM_INSTALL_TARGET_OPTS) -C $(@D) \
install-static_c install-static_cxx
endef
$(eval $(generic-package))
My understanding is that this should be calling make static against grpc's root Makefile with the env setup. The target compiling seems to go fine:
/piksi_buildroot/buildroot/output/host/bin/arm-linux-g++ -I/piksi_buildroot/buildroot/output/host/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/include -pthread -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -I/piksi_buildroot/buildroot/output/host/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/include -Ithird_party/address_sorting/include -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I/piksi_buildroot/buildroot/output/build/grpc_custom-v1.12.0/gens -DPB_FIELD_16BIT -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -I/piksi_buildroot/buildroot/output/host/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/include -I/piksi_buildroot/buildroot/output/host/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/include -std=c++11 -MMD -MF /piksi_buildroot/buildroot/output/build/grpc_custom-v1.12.0/objs/opt/src/cpp/common/auth_property_iterator.dep -c -o /piksi_buildroot/buildroot/output/build/grpc_custom-v1.12.0/objs/opt/src/cpp/common/auth_property_iterator.o src/cpp/common/auth_property_iterator.cc
But then we end up running into issues once we move to host compiling around the plugins
[HOSTCXX] Compiling src/compiler/cpp_plugin.cc
[HOSTCXX] Compiling src/compiler/node_plugin.cc
[HOSTCXX] Compiling src/compiler/csharp_plugin.cc
[HOSTCXX] Compiling src/compiler/objective_c_plugin.cc
[HOSTCXX] Compiling src/compiler/php_plugin.cc
[HOSTCXX] Compiling src/compiler/python_plugin.cc
[HOSTCXX] Compiling src/compiler/ruby_plugin.cc
[HOSTLD] Linking /piksi_buildroot/buildroot/output/build/grpc_custom-v1.12.0/bins/opt/grpc_cpp_plugin
And have tried any number of settings get them to work. For instance, with the above configuration we error on host linking: