-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Xtensa Support #2380
base: next
Are you sure you want to change the base?
Xtensa Support #2380
Conversation
@@ -12,7 +12,7 @@ class GetOperandRegImm(Patch): | |||
Patch OPERAND.getReg() | |||
to MCOperand_getReg(OPERAND) | |||
Same for isImm() | |||
Same for getImm()|getExpr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far I excluded support for expressions from Capstone. Because they were used for symbols, which is out of scope for Capstone. Is this different in Xtensa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep in mind the LITBASE
mechanic Xtensa has.
No other disassembler seems to support it. So it would be nice if CS gives at least an option to take care of it.
See: https://youtu.be/QMO2vMBcx7Y?feature=shared&t=808
@imbillow what LLVM version you have used as a base for this PR? Mainstream LLVM 18? Or a fork from developers working on the Xtensa patches? |
I'm using the auto-sync branch of llvm-capstone, I think it's llvm-18, I'm not sure.
|
It is LLVM 18. Please quickly diff the |
I feel tortured every time I look at your huge PR on chrome because it crashes the browser. |
You can try using |
Currently compiling with the ninja generator on macos gives an error
libyaml is also installed.
|
Ouh yeah, sorry. There are a few thousand test files in there. Probably should be separated before merging.
Weird. Guess I didn't understand the diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21577ba42..3b376b18b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -887,7 +887,9 @@ endif()
if(CAPSTONE_BUILD_CSTEST)
include(ExternalProject)
- find_library(libyaml yaml REQUIRED)
+ find_library(libyaml
+ NAMES libyaml yaml
+ REQUIRED)
ExternalProject_Add(cmocka_ext
PREFIX extern
URL "https://cmocka.org/files/1.1/cmocka-1.1.7.tar.xz" |
That would work but there are new problems.
I'm considering whether it's feasible to use rust for cstest. |
I really did not want to make the building steps more complex. Especially because there is not much time. And if we start using Rust, it would mean we might as well implement proper bindings for it. But the release is set to September.
We can also live with global variables, although it hurts. diff --git a/suite/cstest/src/cstest.c b/suite/cstest/src/cstest.c
index a8793fc62..6c25f5db9 100644
--- a/suite/cstest/src/cstest.c
+++ b/suite/cstest/src/cstest.c
@@ -9,15 +9,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <threads.h>
#include <time.h>
// Pointer to the file list table
// Must be a thread local, because we cannot pass arguments to `nftw`.
// So the found test files can only be saved, very annoyingly,
// to a global/thread-local mutable variables.
-thread_local char ***test_files = NULL;
-thread_local uint32_t file_count = 0;
+char ***test_files = NULL;
+uint32_t file_count = 0;
static void help(const char *self)
{ |
Your checklist for this pull request
Detailed description
...
Test plan
...
Closing issues
...