From 84317d57e8c61ff68eeaa1f2de93472fa930a6a4 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Tue, 30 Mar 2021 00:25:24 -0700 Subject: [PATCH 1/2] target/xtensa: fix meson.build rule for xtensa cores import_core.sh tries to change Makefile.objs when importing new xtensa core, but that file no longer exists. Rewrite meson.build rule to pick up all source files that match core-*.c pattern and drop commands that change Makefile.objs. Cc: qemu-stable@nongnu.org # v5.2.0 Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/import_core.sh | 3 --- target/xtensa/meson.build | 13 ++++--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/target/xtensa/import_core.sh b/target/xtensa/import_core.sh index c8626a8c02..1120a4a2a5 100755 --- a/target/xtensa/import_core.sh +++ b/target/xtensa/import_core.sh @@ -65,6 +65,3 @@ static XtensaConfig $NAME __attribute__((unused)) = { REGISTER_CORE($NAME) EOF - -grep -q core-${NAME}.o "$BASE"/Makefile.objs || \ - echo "obj-y += core-${NAME}.o" >> "$BASE"/Makefile.objs diff --git a/target/xtensa/meson.build b/target/xtensa/meson.build index dd750a977e..7c4efa6c62 100644 --- a/target/xtensa/meson.build +++ b/target/xtensa/meson.build @@ -1,14 +1,9 @@ xtensa_ss = ss.source_set() + +xtensa_cores = run_command('sh', '-c', 'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR ; ls -1 core-*.c') +xtensa_ss.add(files(xtensa_cores.stdout().strip().split('\n'))) + xtensa_ss.add(files( - 'core-dc232b.c', - 'core-dc233c.c', - 'core-de212.c', - 'core-de233_fpu.c', - 'core-dsp3400.c', - 'core-fsf.c', - 'core-sample_controller.c', - 'core-test_kc705_be.c', - 'core-test_mmuhifi_c3.c', 'cpu.c', 'exc_helper.c', 'fpu_helper.c', From 30c676134eb8f956853a55023d694062062d40d7 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 29 Mar 2021 23:59:49 -0700 Subject: [PATCH 2/2] target/xtensa: make xtensa_modules static on import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xtensa_modules variable defined in each xtensa-modules.c.inc is only used locally by the including file. Make it static. Reported-by: Yury Gribov Signed-off-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/import_core.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/target/xtensa/import_core.sh b/target/xtensa/import_core.sh index 1120a4a2a5..396b264be9 100755 --- a/target/xtensa/import_core.sh +++ b/target/xtensa/import_core.sh @@ -35,6 +35,7 @@ tar -xf "$OVERLAY" -O binutils/xtensa-modules.c | \ -e '/^#include "ansidecl.h"/d' \ -e '/^Slot_[a-zA-Z0-9_]\+_decode (const xtensa_insnbuf insn)/,/^}/s/^ return 0;$/ return XTENSA_UNDEFINED;/' \ -e 's/#include /#include "xtensa-isa.h"/' \ + -e 's/^\(xtensa_isa_internal xtensa_modules\)/static \1/' \ > "$TARGET"/xtensa-modules.c.inc cat < "${TARGET}.c"