When using link-type-optimization (LTO) the linker will fail with 'undefined reference' errors.
Example:
load("//rules_cc:defs.bzl", "cc_binary", "cc_library")
cc_library(
name = "hello_lib",
srcs = ["lib.cpp"],
)
cc_binary(
name = "hello_world_cpp",
srcs = ["main.cpp"],
deps = ["hello_lib"],
)
Will fail when build with:
bazel build --cxxopt=-flto=auto ...
When using link-type-optimization (LTO) the linker will fail with 'undefined reference' errors.
Example:
Will fail when build with: