RISC-V: Support ELF attribute for gas and readelf.
[deliverable/binutils-gdb.git] / gas / configure.ac
index 2fe9f78608cef8dde605fa5c7fb939bb2dd81d35..105d708253a68e327a9a0bc5e2acd009deefb02e 100644 (file)
@@ -125,6 +125,16 @@ AC_ARG_ENABLE(x86-used-note,
   no)   ac_default_generate_x86_used_note=0 ;;
 esac])dnl
 
+# Decide if the RISC-V ELF assembler should default to generating attribute.
+ac_default_generate_riscv_attr=unset
+# Provide a configuration option to override the default.
+AC_ARG_ENABLE(default-riscv-attribute,
+             AS_HELP_STRING([--enable-default-riscv-attribute],
+             [generate RISC-V arch attribute by default]),
+[case "${enableval}" in
+  yes)  ac_default_generate_riscv_attr=1 ;;
+  no)   ac_default_generate_riscv_attr=0 ;;
+esac])dnl
 
 using_cgen=no
 
@@ -663,6 +673,21 @@ AC_DEFINE_UNQUOTED(DEFAULT_X86_USED_NOTE,
   [Define to 1 if you want to generate GNU x86 used ISA and feature
    properties by default.])
 
+if test ${ac_default_generate_riscv_attr} = unset; then
+    case ${target_os} in
+      elf)
+       ac_default_generate_riscv_attr=1
+       ;;
+      *)
+       ac_default_generate_riscv_attr=0
+       ;;
+  esac
+fi
+
+AC_DEFINE_UNQUOTED(DEFAULT_RISCV_ATTR,
+  $ac_default_generate_riscv_attr,
+  [Define to 1 if you want to generate RISC-V arch attribute by default.])
+
 if test x$ac_default_compressed_debug_sections = xyes ; then
   AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
 fi
This page took 0.024955 seconds and 4 git commands to generate.