GithubHelp home page GithubHelp logo

Error in compiling about ubpf HOT 8 CLOSED

iovisor avatar iovisor commented on July 3, 2024
Error in compiling

from ubpf.

Comments (8)

qmonnet avatar qmonnet commented on July 3, 2024

Hi Pascal,

The eBPF JIT-compiler in this repo is for x86_64 CPU architecture, which means that it is not compatible with ARM processors such as the one on your Pi.

There is little to be done I'm afraid, except writing a new JIT-compiler for ARM (there is one in the Linux kernel, but it is under GPL so it cannot be merged here).

The other thing you could do is try to compile without the JIT-compiler, and use only the interpreter for running your programs.

Best of luck!

from ubpf.

YutaroHayakawa avatar YutaroHayakawa commented on July 3, 2024

Hello,

@qmonnet 's comment is true, but the real issue is here I think.

(void *)reg[inst.dst]
(void *)reg[inst.src]

These casts are not valid on your platform I think. This cast is valid on X86-64 platforms because sizeof(void *) equals to sizeof(uint64_t). I guess on your platform, this is not the case.

#include <stdio.h>
#include <stdint.h>

int main(void) {
	printf("sizeof(void *): %zu sizeof(uint64_t): %zu\n", sizeof(void *), sizeof(uint64_t));
	return 0;
}

This program makes clear that. Please try this and show us an output.

from ubpf.

PascalHf avatar PascalHf commented on July 3, 2024

Hi,
thank you for your quick response.

Output of the program is false

from ubpf.

YutaroHayakawa avatar YutaroHayakawa commented on July 3, 2024

Sorry, I updated my comment but its ok. It seems in your platform, there is a mismatch between the sizeof(uint64_t) and sizeof(void *) and unfortunately, currently ubpf is not aware of such platform. The quick solution is removing -Werror in the Makefile. It just "works" I think. Does anyone have idea to correctly solve this?

from ubpf.

YutaroHayakawa avatar YutaroHayakawa commented on July 3, 2024

I thought for a while and now I think using uintptr_t for pointer arithmetic may work. At least int-to-pointer-cast warning doesn't appear.

from ubpf.

pchaigno avatar pchaigno commented on July 3, 2024

@PascalHf - Does @YutaroHayakawa's suggestion solve your issue?

from ubpf.

PascalHf avatar PascalHf commented on July 3, 2024

The Problem is the pointer arithmetic, like @YutaroHayakawa said. Removing -Werror does not fix the whole Problem. I removed some code to compile the programm but I did not try if it does work as it should now because I switched to another Architecture.

from ubpf.

Alan-Jowett avatar Alan-Jowett commented on July 3, 2024

@PascalHf is this still an issue? If not, I will resolve this PR.

from ubpf.

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.