Skip to content

Use -lm on linux as well.#3879

Open
adam-azarchs wants to merge 1 commit intogoogle:mainfrom
adam-azarchs:azarchs/linux-clang-libmath
Open

Use -lm on linux as well.#3879
adam-azarchs wants to merge 1 commit intogoogle:mainfrom
adam-azarchs:azarchs/linux-clang-libmath

Conversation

@adam-azarchs
Copy link
Copy Markdown

Not all compilers on linux add it implicitly.
It won't do any harm on those which do.

Closes #3878

Not all compilers on linux add it implicitly.
It won't do any harm on those which do.

Closes google#3878
@derekmauro derekmauro self-requested a review June 13, 2022 19:50
@derekmauro derekmauro self-assigned this Jun 13, 2022
@dangars
Copy link
Copy Markdown

dangars commented Nov 30, 2022

Hi,
There has been progress with this PR :) ?
I confirm that clang requires -lm

@adam-azarchs
Copy link
Copy Markdown
Author

This is just waiting for someone with permission to actually review and (hopefully) merge it (the test failures shown in the checks output were present on master as well at the time they ran). Our team has been using this branch for a long time now.

@dangars
Copy link
Copy Markdown

dangars commented Dec 2, 2022

Hi,

I think that Bazel 6 allows to do a selection depending on the compiler (gcc or clang), see @bazel_tools//tools/cpp:compiler

Maybe -lm can be added only for clang, but I think that this would require Bazel 6.

@adam-azarchs
Copy link
Copy Markdown
Author

Yes I think that would require bazel 6. And even after it's been released, it'll be a while before bazel 6 can be assumed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linker error compiling with clang on linux

5 participants