plugins on meson build (#10716)

* asm: use path macros whenever possible
* meson.build: sync asm and bin plugins with Makefile
* shlr/meson.build: apply capstone patches
This commit is contained in:
Riccardo Schirone 2018-07-13 18:19:56 +02:00 committed by GitHub
parent 8159e7c322
commit 02f9ddefd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 8 deletions

View File

@ -309,7 +309,7 @@ R_API int r_asm_use(RAsm *a, const char *name) {
r_list_foreach (a->plugins, iter, h) {
if (!strcmp (h->name, name) && h->arch) {
if (!a->cur || (a->cur && strcmp (a->cur->arch, h->arch))) {
char *file = r_str_newf ("%s/%s/%s/%s.sdb", r_sys_prefix (NULL), "share/radare2/last", "opcodes", h->arch);
char *file = r_str_newf ("%s/%s.sdb", r_str_r2_prefix (R2_SDB_OPCODES), h->arch);
r_asm_set_cpu (a, NULL);
sdb_free (a->pair);
a->pair = sdb_new (NULL, file, 0);

View File

@ -470,6 +470,7 @@ static int try_loadlib(RCore *core, const char *lib, ut64 addr) {
R_API bool r_core_file_loadlib(RCore *core, const char *lib, ut64 libaddr) {
const char *ldlibrarypath[] = {
R2_LIBDIR,
"/usr/local/lib",
"/usr/lib",
"/lib",

View File

@ -1715,7 +1715,6 @@ extern RAnalPlugin r_anal_plugin_dalvik;
extern RAnalPlugin r_anal_plugin_sh;
extern RAnalPlugin r_anal_plugin_sparc_gnu;
extern RAnalPlugin r_anal_plugin_bf;
extern RAnalPlugin r_anal_plugin_m68k;
extern RAnalPlugin r_anal_plugin_m68k_cs;
extern RAnalPlugin r_anal_plugin_z80;
extern RAnalPlugin r_anal_plugin_i8080;

View File

@ -197,7 +197,6 @@ extern RAsmPlugin r_asm_plugin_bf;
extern RAsmPlugin r_asm_plugin_java;
extern RAsmPlugin r_asm_plugin_mips_gnu;
extern RAsmPlugin r_asm_plugin_mips_cs;
extern RAsmPlugin r_asm_plugin_x86_udis;
extern RAsmPlugin r_asm_plugin_x86_as;
extern RAsmPlugin r_asm_plugin_x86_nz;
extern RAsmPlugin r_asm_plugin_x86_nasm;
@ -205,7 +204,6 @@ extern RAsmPlugin r_asm_plugin_x86_cs;
extern RAsmPlugin r_asm_plugin_arm_gnu;
extern RAsmPlugin r_asm_plugin_arm_cs;
extern RAsmPlugin r_asm_plugin_arm_as;
extern RAsmPlugin r_asm_plugin_armthumb;
extern RAsmPlugin r_asm_plugin_arm_winedbg;
extern RAsmPlugin r_asm_plugin_xap;
extern RAsmPlugin r_asm_plugin_ppc_gnu;
@ -216,7 +214,6 @@ extern RAsmPlugin r_asm_plugin_dalvik;
extern RAsmPlugin r_asm_plugin_sh;
extern RAsmPlugin r_asm_plugin_z80;
extern RAsmPlugin r_asm_plugin_i8080;
extern RAsmPlugin r_asm_plugin_m68k;
extern RAsmPlugin r_asm_plugin_m68k_cs;
extern RAsmPlugin r_asm_plugin_arc;
extern RAsmPlugin r_asm_plugin_dcpu16;
@ -257,7 +254,6 @@ extern RAsmPlugin r_asm_plugin_hexagon;
extern RAsmPlugin r_asm_plugin_hexagon_gnu;
extern RAsmPlugin r_asm_plugin_wasm;
extern RAsmPlugin r_asm_plugin_tms320c64x;
extern RAsmPlugin r_asm_plugin_evm;
#endif

View File

@ -840,7 +840,6 @@ extern RBinPlugin r_bin_plugin_mach064;
extern RBinPlugin r_bin_plugin_mdmp;
extern RBinPlugin r_bin_plugin_java;
extern RBinPlugin r_bin_plugin_dex;
extern RBinPlugin r_bin_plugin_dummy;
extern RBinPlugin r_bin_plugin_coff;
extern RBinPlugin r_bin_plugin_ningb;
extern RBinPlugin r_bin_plugin_ningba;

View File

@ -96,6 +96,7 @@ asm_plugins = [
'spc700',
'sysz',
'tms320',
'tms320c64x',
'tricore',
'v810',
'v850',
@ -104,7 +105,6 @@ asm_plugins = [
'ws',
'x86_as',
'x86_cs',
#'x86_gas',
'x86_nasm',
'x86_nz',
'xap',
@ -116,6 +116,7 @@ asm_plugins = [
bin_plugins = [
'any',
'art',
'avr',
'bf',
'bflt',
'bios',

View File

@ -12,6 +12,21 @@ if not capstone_dep.found() or not get_option('use_sys_capstone')
message('Cloning capstone')
git_cmd = 'clone -b next --depth 10 https://github.com/aquynh/capstone.git capstone'
run_command(git_exe, git_cmd.split())
patches_files = [
'capstone-calloc.patch',
'fix-m68k-oob.patch',
'fix-underflow-tms.patch',
'fix-x86-16.patch',
'sparc-crash.patch',
'sstream-null.patch'
]
message('Patching capstone with radare\'s patches')
foreach file : patches_files
patch_cmd = 'patch -p1 -d capstone -i ../capstone-patches/@0@'.format(file)
run_command(patch_cmd.split())
endforeach
endif
cs_files = [