From 5a0f5739f7604011e646ddbd8ce02ac03f6f57b8 Mon Sep 17 00:00:00 2001 From: Randolf J <34705014+jun-sheaf@users.noreply.github.com> Date: Thu, 23 Jun 2022 06:15:53 +0200 Subject: [PATCH] Fix `RANLIB` for `configure_make` (#928) --- foreign_cc/private/make_env_vars.bzl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/foreign_cc/private/make_env_vars.bzl b/foreign_cc/private/make_env_vars.bzl index 4c0b328e..0bb227b4 100644 --- a/foreign_cc/private/make_env_vars.bzl +++ b/foreign_cc/private/make_env_vars.bzl @@ -14,6 +14,10 @@ def get_make_env_vars( vars = _get_make_variables(workspace_name, tools, flags, user_vars) deps_flags = _define_deps_flags(deps, inputs) + # For cross-compilation. + if "RANLIB" not in vars.keys(): + vars["RANLIB"] = [":"] + if "LDFLAGS" in vars.keys(): vars["LDFLAGS"] = vars["LDFLAGS"] + deps_flags.libs else: @@ -73,6 +77,8 @@ def _define_deps_flags(deps, inputs): # See https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html _MAKE_FLAGS = { "ARFLAGS": "cxx_linker_static", + # AR_FLAGS is sometimes used + "AR_FLAGS": "cxx_linker_static", "ASFLAGS": "assemble", "CFLAGS": "cc", "CXXFLAGS": "cxx",