Closed ParkMyCar closed 1 month ago
Nevermind I'm just a Bazel noob! I was able to override the ARFLAGS
via configure_options
, e.g.
configure_make(
// ...
configure_options = CONFIGURE_OPTIONS + select({
"@platforms//os:macos": ["ARFLAGS=r"],
"//conditions:default": [],
}),
// ...
)
Note: Initially I tried overriding the ARFLAGS
via the env
field but that didn't work, it was setting them via configure_options
that did the trick.
Hey folks! I'm trying to build
openssl 3.3.1
using Bazel withconfigure_make
fromrules_foreign_cc
andllvm_toolchain
. The default archiver on darwin/macOS islibtool
but I wanted to usellvm-ar
to try avoiding an undefined symbol issue like the one referenced here. It seems liketoolchains_llvm
unconditionally sets the-static
flag inarchive_flags
on darwin, which is not a supported flag forllvm-ar
, makingllvm-ar
unusable?I set the llvm-ar to be the archiver via the
AR
environment variable, e.g.The problem is
llvm_toolchain
seems to always include the-static
flag in archive_flags but-static
is not an argumentllvm-ar
recognizes. This leads to an error like:Indeed if we enable verbose errors we can see the invocation of
llvm-ar
includes the-static
flag:FWIW the build rule works fine on Linux distributions, it only fails on macOS