Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy: /lib64/libm.so.6: version `GLIBC_2.27' not found #10019

Closed
amurzeau opened this issue Oct 15, 2022 · 5 comments
Closed

clang-tidy: /lib64/libm.so.6: version `GLIBC_2.27' not found #10019

amurzeau opened this issue Oct 15, 2022 · 5 comments
Assignees
Labels
bug Feature: Code Analysis Related to integration with clang-tidy, cppcheck, cl.exe /analyze, etc. fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@amurzeau
Copy link

Environment

  • OS and version: Windows 10 (but in remote mode to Red Hat 7)
  • VS Code: 1.70.2
  • C/C++ extension: 1.12.4
  • OS and version of remote machine (if applicable): Red Hat 7

Bug Summary and Steps to Reproduce

Bug Summary:

The cpptools extensions show errors about clang-tidy which can't be run on Red Hat 7 as it requires GLIBC_2.27 for the function log2f.
This makes clang-tidy not usable.

The exact error is:

<extension path>/LLVM/bin/clang-tidy: /lib64/libm.so.6: version `GLIBC_2.27` not found (required by <extension path>/LLVM/bin/clang-tidy)

Steps to reproduce:

  1. Run the extension on a Red Hat 7 (or Centos 7) machine
  2. Open a C/C++ project with this setting enabled: C_Cpp.codeAnalysis.clangTidy.enabled
  3. Show the output Log (Remote Serer)
  4. See the above error: clang-tidy: /lib64/libm.so.6: version GLIBC_2.27 not found

Other Extensions

No response

Additional Information

Running objdump -T on clang-tidy shows which function is the issue:

[...]
0000000000000000      DF *UND*	0000000000000000 (GLIBC_2.27) log2f
[...]
@H-G-Hristov
Copy link

H-G-Hristov commented Oct 16, 2022

Does clang-tidy support remote scenarios?
What about setting the path to an external clang-tidy on the remote machine?

@amurzeau
Copy link
Author

amurzeau commented Oct 16, 2022

Yes it works fine when clang-tidy can run on the remote machine (with a new enough glibc).
I can find the LLVM/bin/clang-tidy process in ps on the remote machine. The clang-tidy issues are reported as expected.

This type of issue already appeared in the past on cpptools executable, see here: #8192

As a comparison, here is a working clang-tidy on a Debian Unstable remote, issues are detected and displayed:
clang-tidy-working

And here, using a Centos 7 remote, there is no issues detected and the error appear in the C/C++ output (requires "Information" log level):

clang-tidy-centos-failure

@sean-mcmanus sean-mcmanus self-assigned this Oct 19, 2022
@sean-mcmanus
Copy link
Collaborator

The workaround would be to set C_Cpp.codeAnalysis.clangTidy.path to a clang-tidy that works on your OS with a lower glibc requirement.

@sean-mcmanus sean-mcmanus added Language Service Feature: Code Analysis Related to integration with clang-tidy, cppcheck, cl.exe /analyze, etc. bug investigate: repro This issue's repro steps needs to be investigated/confirmed labels Oct 19, 2022
@sean-mcmanus sean-mcmanus added this to the 1.13 milestone Oct 20, 2022
@sean-mcmanus sean-mcmanus modified the milestones: 1.13, 1.13.3 Oct 20, 2022
@sean-mcmanus sean-mcmanus removed the investigate: repro This issue's repro steps needs to be investigated/confirmed label Oct 20, 2022
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 21, 2022
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Oct 21, 2022

FYI, this will be fixed in our pending 1.13.3 release next week (also with clang-tidy 15.0.3).

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Oct 26, 2022

The fix is available with 1.13.3 (pre-release) for Linux x64 or arm64 (or Alpine): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.3

However, Linux arm 32-bit still builds with shared libraries because otherwise it was crashing. We could open another issue track that if someone is hitting an issue with that.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Code Analysis Related to integration with clang-tidy, cppcheck, cl.exe /analyze, etc. fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

3 participants