From 5dd15a1ff336fe145c3d3f25038b0cac8fe7ee1d Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 3 Aug 2022 01:15:53 +0200 Subject: [PATCH] WIP: Use abi-compatible directory for loading plugins --- Makefile | 1 + libr/include/r_userconf.h.acr | 6 +++--- libr/include/r_version.h.in | 1 + libr/main/rabin2.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bc9c1ca0dde42..9a101649391cc 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,7 @@ libr/include/r_version.h: @echo '#define R_VERSION_H 1' >> $@.tmp @echo '#define R2_VERSION_COMMIT $(R2VC)' >> $@.tmp @echo '#define R2_VERSION "$(R2_VERSION)"' >> $@.tmp + @echo '#define R2_VERSION_ABI "$(R2_VERSION_MAJOR).$(R2_VERSION_MINOR).x"' >> $@.tmp @echo '#define R2_VERSION_MAJOR $(R2_VERSION_MAJOR)' >> $@.tmp @echo '#define R2_VERSION_MINOR $(R2_VERSION_MINOR)' >> $@.tmp @echo '#define R2_VERSION_PATCH $(R2_VERSION_PATCH)' >> $@.tmp diff --git a/libr/include/r_userconf.h.acr b/libr/include/r_userconf.h.acr index 361727591429d..eb23622056c37 100644 --- a/libr/include/r_userconf.h.acr +++ b/libr/include/r_userconf.h.acr @@ -56,9 +56,9 @@ #define R2_INCDIR "@INCLUDEDIR@/libr" #define R2_DATDIR "@DATADIR@" #define R2_WWWROOT R2_DATDIR "/radare2/" R2_VERSION "/www" -#define R2_PLUGINS "lib/radare2/" R2_VERSION -#define R2_EXTRAS "lib/radare2-extras/" R2_VERSION -#define R2_BINDINGS "lib/radare2-bindings/" R2_VERSION +#define R2_PLUGINS "lib/radare2/" R2_VERSION_ABI +#define R2_EXTRAS "lib/radare2-extras/" R2_VERSION_ABI +#define R2_BINDINGS "lib/radare2-bindings/" R2_VERSION_ABI #endif #define R2_DATDIR_R2 R_JOIN_2_PATHS ("share", "radare2") #define R2_SDB R_JOIN_3_PATHS ("share", "radare2", R2_VERSION) diff --git a/libr/include/r_version.h.in b/libr/include/r_version.h.in index 7508880117e2f..dcc0efc30f748 100644 --- a/libr/include/r_version.h.in +++ b/libr/include/r_version.h.in @@ -1,6 +1,7 @@ #ifndef R_VERSION_H #define R_VERSION_H 1 #define R_MESON_VERSION "@MESON_VERSION@" +#define R2_VERSION_ABI "@R2_VERSION_MAJOR@.@R2_VERSION_MINOR@.x" #define R2_VERSION_MAJOR @R2_VERSION_MAJOR@ #define R2_VERSION_MINOR @R2_VERSION_MINOR@ #define R2_VERSION_PATCH @R2_VERSION_PATCH@ diff --git a/libr/main/rabin2.c b/libr/main/rabin2.c index dce7d07868d73..5c74a6a6f8333 100644 --- a/libr/main/rabin2.c +++ b/libr/main/rabin2.c @@ -269,7 +269,7 @@ static int rabin_dump_symbols(RBin *bin, int len) { r_hex_bin2str (buf, len, ret); printf ("%s %s\n", symbol->name, ret); } else { - eprintf ("Cannot read from buffer\n"); + R_LOG_ERROR ("Cannot read from buffer"); } free (buf); free (ret);