From 819039a5ad6044467ddad96e656f430198fe1c20 Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Tue, 13 Aug 2024 21:23:11 +0100 Subject: configure: Fix arch detection for GDB_HAS_MTE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GDB_HAS_MTE must only be set if GDB supports the aarch64 arch, so the test if "aarch64" string is present must be against GDB-related '$gdb_arches' variable and not against '$arch' variable. Signed-off-by: Gustavo Romero Message-Id: <20240804161850.2646299-2-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-4-alex.bennee@linaro.org> --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 019fcbd0ef..a3aa257fd3 100755 --- a/configure +++ b/configure @@ -1673,7 +1673,7 @@ for target in $target_list; do echo "GDB=$gdb_bin" >> $config_target_mak fi - if test "${arch}" = "aarch64" && version_ge ${gdb_version##* } 15.0; then + if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge ${gdb_version##* } 15.0; then echo "GDB_HAS_MTE=y" >> $config_target_mak fi -- cgit 1.4.1 From 34a4ef1c5cc79bf924938b8cbd5f92146a23a7cb Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Tue, 13 Aug 2024 21:23:12 +0100 Subject: configure: Avoid use of param. expansion when using gdb_version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $gdb_version is now used in more than one conditional case and its usage in such cases may increase in the future. Therefore, avoid using shell parameter expansion when using it by setting gdb_version to its final form. Signed-off-by: Gustavo Romero Message-Id: <20240804161850.2646299-3-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-5-alex.bennee@linaro.org> --- configure | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'configure') diff --git a/configure b/configure index a3aa257fd3..97de85d710 100755 --- a/configure +++ b/configure @@ -1103,8 +1103,10 @@ fi # gdb test if test -n "$gdb_bin"; then - gdb_version=$($gdb_bin --version | head -n 1) - if version_ge ${gdb_version##* } 9.1; then + gdb_version_string=$($gdb_bin --version | head -n 1) + # Extract last field in the version string + gdb_version=${gdb_version_string##* } + if version_ge $gdb_version 9.1; then gdb_arches=$($python "$source_path/scripts/probe-gdb-support.py" $gdb_bin) else gdb_bin="" @@ -1673,7 +1675,7 @@ for target in $target_list; do echo "GDB=$gdb_bin" >> $config_target_mak fi - if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge ${gdb_version##* } 15.0; then + if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 15.0; then echo "GDB_HAS_MTE=y" >> $config_target_mak fi -- cgit 1.4.1 From 5f9ad35e044b9b295fa2ff1315c83c5f3faa3357 Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Tue, 13 Aug 2024 21:23:13 +0100 Subject: configure: Fix GDB version detection for GDB_HAS_MTE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test gdbstub/test-mte.py requires a GDB version that supports the qIsAddressTagged packet. According to GDB NEWS [0], this packet was first made available in the GDB 15.1 release, not in 15.0, so this commit fixes it in configure. [0] https://www.sourceware.org/gdb/news/ Signed-off-by: Gustavo Romero Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2477 Message-Id: <20240804161850.2646299-4-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-6-alex.bennee@linaro.org> --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 97de85d710..d08b71f14b 100755 --- a/configure +++ b/configure @@ -1675,7 +1675,7 @@ for target in $target_list; do echo "GDB=$gdb_bin" >> $config_target_mak fi - if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 15.0; then + if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 15.1; then echo "GDB_HAS_MTE=y" >> $config_target_mak fi -- cgit 1.4.1