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

bcc build error with LLVM 19 #5125

Open
jchecahi opened this issue Oct 25, 2024 · 1 comment
Open

bcc build error with LLVM 19 #5125

jchecahi opened this issue Oct 25, 2024 · 1 comment

Comments

@jchecahi
Copy link

Trying to build bcc with LLVM 19 fails with the following error:

/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc: In member function ‘bool ebpf::MapVisitor::VisitCallExpr(clang::CallExpr*)’:
/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc:341:27: error: ‘class llvm::StringRef’ has no member named ‘startswith’; did you mean ‘starts_with’?
  341 |         if (!A->getName().startswith("maps"))
      |                           ^~~~~~~~~~
      |                           starts_with
/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc: In member function ‘bool ebpf::ProbeVisitor::assignsExtPtr(clang::Expr*, int*)’:
/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc:393:29: error: ‘class llvm::StringRef’ has no member named ‘startswith’; did you mean ‘starts_with’?
  393 |           if (!A->getName().startswith("maps"))
      |                             ^~~~~~~~~~
      |                             starts_with
/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc: In member function ‘bool ebpf::BTypeVisitor::VisitCallExpr(clang::CallExpr*)’:
/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc:940:27: error: ‘class llvm::StringRef’ has no member named ‘startswith’; did you mean ‘starts_with’?
  940 |         if (!A->getName().startswith("maps"))
      |                           ^~~~~~~~~~
      |                           starts_with
/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc: In member function ‘bool ebpf::BTypeVisitor::VisitVarDecl(clang::VarDecl*)’:
/root/rpmbuild/BUILD/bcc-0.30.0-build/bcc-0.30.0/src/cc/frontends/clang/b_frontend_action.cc:1458:23: error: ‘class llvm::StringRef’ has no member named ‘startswith’; did you mean ‘starts_with’?
 1458 |     if (!A->getName().startswith("maps"))
      |                       ^~~~~~~~~~
      |                       starts_with

StringRef::startswith was marked for deprecation in LLVM 18 and finally removed in LLVM 19 in commit 4ec9a662. Replacing the ocurrences of startswith with starts_with fixes the build.

Reproduced in Fedora 41 with bcc-0.30.0

@hhoffstaette
Copy link
Contributor

Previously reported in #5002 and fixed in 8caf040 :)

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

No branches or pull requests

2 participants