cc_configure: add -lm to the default linker flags
Some C++ toolchain requires -lm when passing -lstdc++.
Always add it.
We should probably make that depend on what kind of
binary we actually want to build but that's beyond the
scope of cc_configure.
Fixes #1190.
--
MOS_MIGRATED_REVID=121015578
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index 1ad3754..1250d23 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -178,6 +178,7 @@
] + _cplus_include_paths(repository_ctx),
"linker_flag": [
"-lstdc++",
+ "-lm", # Some systems expect -lm in addition to -lstdc++
# Anticipated future default.
] + _add_option_if_supported(repository_ctx, cc, "-no-canonical-prefixes") +
_add_option_if_supported(repository_ctx, cc, "-Wl,-no-as-needed") + (