riscv: fix cross compiler

Message ID 1842f47d-a6e7-8a9e-3ec7-82c7f7d33f57@suse.cz
State Accepted
Headers
Series riscv: fix cross compiler |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Martin Liška Oct. 25, 2022, 5:01 a.m. UTC
  More riscv_get_valid_option_values out of

Fixes:
riscv/riscv-common.cc:1748:40: error: ‘riscv_get_valid_option_values’ was not declared in this scope

Now I get:

./xgcc -B. --completion=-mcp
-mcpu=sifive-e20
-mcpu=sifive-e21
-mcpu=sifive-e24
-mcpu=sifive-e31
-mcpu=sifive-e34
-mcpu=sifive-e76
-mcpu=sifive-s21
-mcpu=sifive-s51
-mcpu=sifive-s54
-mcpu=sifive-s76
-mcpu=sifive-u54
-mcpu=sifive-u74

./xgcc -B. --completion=-mtune
-mtune=rocket
-mtune=sifive-3-series
-mtune=sifive-5-series
-mtune=sifive-7-series
-mtune=thead-c906
-mtune=size
-mtune=sifive-e20
-mtune=sifive-e21
-mtune=sifive-e24
-mtune=sifive-e31
-mtune=sifive-e34
-mtune=sifive-e76
-mtune=sifive-s21
-mtune=sifive-s51
-mtune=sifive-s54
-mtune=sifive-s76
-mtune=sifive-u54
-mtune=sifive-u74

Ready for master?

Thanks,
Martin

gcc/ChangeLog:

	* common/config/riscv/riscv-common.cc
	  (riscv_get_valid_option_values): Get out of ifdef.
---
 gcc/common/config/riscv/riscv-common.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Martin Liška Oct. 25, 2022, 5:02 a.m. UTC | #1
On 10/25/22 07:01, Martin Liška wrote:
> |More riscv_get_valid_option_values out of|

* Move
  
Kito Cheng Oct. 25, 2022, 5:10 a.m. UTC | #2
Ok, thanks for the fix!

Martin Liška <mliska@suse.cz> 於 2022年10月25日 週二 13:02 寫道:

> On 10/25/22 07:01, Martin Liška wrote:
> > |More riscv_get_valid_option_values out of|
>
> * Move
>
  

Patch

diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index 697bfe435c8..dead3802f83 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -1691,6 +1691,10 @@  riscv_compute_multilib (
     return xstrdup (multilib_infos[best_match_multi_lib].path.c_str ());
 }
 
+#undef TARGET_COMPUTE_MULTILIB
+#define TARGET_COMPUTE_MULTILIB riscv_compute_multilib
+#endif
+
 vec<const char *>
 riscv_get_valid_option_values (int option_code,
 			       const char *prefix ATTRIBUTE_UNUSED)
@@ -1726,10 +1730,6 @@  riscv_get_valid_option_values (int option_code,
   return v;
 }
 
-#undef TARGET_COMPUTE_MULTILIB
-#define TARGET_COMPUTE_MULTILIB riscv_compute_multilib
-#endif
-
 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
 static const struct default_options riscv_option_optimization_table[] =
   {