diff options
author | 2016-04-28 14:04:11 +0000 | |
---|---|---|
committer | 2016-04-28 15:24:51 +0000 | |
commit | efebc4d1419ecfbab19dba305e8de34c9ced5351 (patch) | |
tree | 0a1ff0c1826152e49cd1d456872b4f1e902b948a | |
parent | 415d39a2a3b5cfb6207a4d6ee27844493007d2f4 (diff) |
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
-rw-r--r-- | tools/cpp/cc_configure.bzl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl index 1ad375470c..1250d2357d 100644 --- a/tools/cpp/cc_configure.bzl +++ b/tools/cpp/cc_configure.bzl @@ -178,6 +178,7 @@ def _crosstool_content(repository_ctx, cc, cpu_value, darwin): ] + _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") + ( |