Comments (8)
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.
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.
Hi,
thank you for your quick response.
Output of the program is false
from ubpf.
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.
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.
@PascalHf - Does @YutaroHayakawa's suggestion solve your issue?
from ubpf.
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.
@PascalHf is this still an issue? If not, I will resolve this PR.
from ubpf.
Related Issues (20)
- ubpf_jit_arm64.c fails under address sanitizer HOT 3
- uBPF should reject call instructions with src != 0 HOT 1
- bpf_conformance/arm64 should run with address sanitizer enabled HOT 3
- Eliminate duplicate test files between ubpf and bpf_conformance
- Should we remove string table support in the JIT? HOT 2
- Add JIT support for MIPS
- Add option to disable JIT
- ARM64 builds broken by changes in upstream repos
- cmake error when using ubpf as a submodule
- Possible division by 0 in div32 instruction implementation HOT 1
- Integer overflow in bounds_check HOT 1
- Segmentation fault caused by call instruction HOT 3
- uBPF should match GCC's assembly format
- uBPF assembler should support labels
- EBPF_OP_LSH_IMM and EBPF_OP_LSH_REG incorrectly are non-conformant
- Code analysis errors
- Code coverage check incorrectly shows as failed
- Running the tests failed HOT 2
- Handle calls to bpf local calls in aarch64 HOT 2
- Handle ELF relocations for local BPF function calls
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ubpf.