Giter Club home page Giter Club logo

Comments (13)

Rot127 avatar Rot127 commented on June 2, 2024 1

Please close the issue if the macro work around works for you.

from capstone.

grahamwoodward avatar grahamwoodward commented on June 2, 2024

The installed version of libbpf is (I think) v1.3...the GitHub repo for libbpf still has the struct bpf_insn; but at line 334

https://github.com/libbpf/libbpf/blob/6d3595d215b014d3eddb88038d686e1c20781534/src/libbpf.h#L334

from capstone.

grahamwoodward avatar grahamwoodward commented on June 2, 2024

@Rot127 sorry to tag you direct, just wondering if you had any thoughts on this?

from capstone.

Rot127 avatar Rot127 commented on June 2, 2024

There seems to be something off with the includes. Can you try to cherry-prick this commit: Rot127@7d746b5

from capstone.

Rot127 avatar Rot127 commented on June 2, 2024

Also possibly related: #2307

from capstone.

Rot127 avatar Rot127 commented on June 2, 2024

Just saw you use make. Please use cmake. The Makefile method is considered deprecated. Also, please share a minimal example for me to test.

from capstone.

Rot127 avatar Rot127 commented on June 2, 2024

@grahamwoodward
Regarding #2307 (comment), yes, please try Rot127@7d746b5. But it likely doesn't work.

Your problem comes likely from including headers in an order which creates the conflict.

If you have one file where the CS header and the libbpf header are included in the same file (or indirectly through other headers), you would need to change this.

Please write the result in this issue, not the PR.

Regarding #2307 (comment)

This is not an option for us, unfortunately. You can do it of course locally, but we can not change the name that easily.

from capstone.

grahamwoodward avatar grahamwoodward commented on June 2, 2024

hmm so how do we fix it? The perf tool I'm working on might be made public with a dependency on Capstone and BPF so this will need fixing somehow

from capstone.

grahamwoodward avatar grahamwoodward commented on June 2, 2024

Also

Regarding #2307 (comment)

This is not an option for us, unfortunately. You can do it of course locally, but we can not change the name that easily.

why can't this be done? Because of people using Capstone would need to update their code to accommodate the enum name change?

from capstone.

Rot127 avatar Rot127 commented on June 2, 2024

why can't this be done? Because of people using Capstone would need to update their code to accommodate the enum name change?

Yes, we would need to change the names for all the archs in the API. So we are consistent with naming. This in turn would force everyone to fix their code with the new names. And Capstone tries to be as stable as possible between versions.

hmm so how do we fix it?

As far as I can see, you will need to do something like this. So you can add the cs_ prefix with the macro when you need it.

from capstone.

grahamwoodward avatar grahamwoodward commented on June 2, 2024

why can't this be done? Because of people using Capstone would need to update their code to accommodate the enum name change?

Yes, we would need to change the names for all the archs in the API. So we are consistent with naming. This in turn would force everyone to fix their code with the new names. And Capstone tries to be as stable as possible between versions.

It's only the "bpf arch" that needs the change, i.e in include/capstone/bpf.h

hmm so how do we fix it?

As far as I can see, you will need to do something like this. So you can add the cs_ prefix with the macro when you need it.

I'm not convinced this works...but going to play with it to see whether I can use this trick

from capstone.

grahamwoodward avatar grahamwoodward commented on June 2, 2024

I'm not convinced this works...but going to play with it to see whether I can use this trick

hhmm this might be working actually...

+   8 #include <capstone/capstone.h>
+   9 #define bpf_insn cs_bpf_insn
+  10   #include <linux/bpf.h>
+  11   #include <bpf/libbpf.h>
+  12 #undef cs_bpf_insn
   13

from capstone.

grahamwoodward avatar grahamwoodward commented on June 2, 2024

Closing as no fix planned. Workaround available as per #2316 (comment)

from capstone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.