aboutsummaryrefslogtreecommitdiff
path: root/ld/configure.ac
diff options
context:
space:
mode:
authorRomain Geissler <romain.geissler@gmail.com>2017-08-08 07:25:39 +0930
committerAlan Modra <amodra@gmail.com>2017-08-08 07:25:39 +0930
commit2760f24c4942853eac7b921e4b8843d57a602654 (patch)
tree032df5cd9ee9386bd44239b733038f23f4388733 /ld/configure.ac
parent8f5e83fb735af978b99ea6e22574560bf667d1d6 (diff)
downloadgdb-2760f24c4942853eac7b921e4b8843d57a602654.zip
gdb-2760f24c4942853eac7b921e4b8843d57a602654.tar.gz
gdb-2760f24c4942853eac7b921e4b8843d57a602654.tar.bz2
Add configure flag to enable gnu hash style by default.
ld/ * configure.ac: Add --enable-default-hash-style option. * ldmain.c (main): Set link_info.emit_hash to DEFAULT_EMIT_SYSV_HASH. Set link_info.emit_gnu_hash to DEFAULT_EMIT_GNU_HASH. * configure: Regenerate. * config.in: Regenerate. gold/ * configure.ac: Add --enable-default-hash-style option. * options.h (hash_style): Use DEFAULT_HASH_STYLE as default value. * configure: Regenerate. * config.in: Regenerate.
Diffstat (limited to 'ld/configure.ac')
-rw-r--r--ld/configure.ac34
1 files changed, 34 insertions, 0 deletions
diff --git a/ld/configure.ac b/ld/configure.ac
index ffe8018..99d127b 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -177,6 +177,32 @@ AC_ARG_ENABLE(relro,
no) ac_default_ld_z_relro=0 ;;
esac])dnl
+# Decide which "--hash-style" to use by default
+# Provide a configure time option to override our default.
+AC_ARG_ENABLE([default-hash-style],
+AS_HELP_STRING([--enable-default-hash-style={sysv,gnu,both}],
+ [use this default hash style]),
+[case "${enable_default_hash_style}" in
+ sysv | gnu | both) ;;
+ *) AC_MSG_ERROR([bad value ${enable_default_hash_style} for enable-default-hash-style option]) ;;
+esac],
+[case "${target}" in
+ # Enable gnu hash only on GNU targets, but not mips
+ mips*-*-*) enable_default_hash_style=sysv ;;
+ *-*-gnu* | *-*-linux* | *-*-nacl*) enable_default_hash_style=both ;;
+ *) enable_default_hash_style=sysv ;;
+esac])
+
+case "${enable_default_hash_style}" in
+ sysv | both) ac_default_emit_sysv_hash=1 ;;
+ *) ac_default_emit_sysv_hash=0 ;;
+esac
+
+case "${enable_default_hash_style}" in
+ gnu | both) ac_default_emit_gnu_hash=1 ;;
+ *) ac_default_emit_gnu_hash=0 ;;
+esac
+
AM_BINUTILS_WARNINGS
AM_LC_MESSAGES
@@ -408,6 +434,14 @@ AC_DEFINE_UNQUOTED(DEFAULT_LD_Z_RELRO,
$ac_default_ld_z_relro,
[Define to 1 if you want to enable -z relro in ELF linker by default.])
+AC_DEFINE_UNQUOTED([DEFAULT_EMIT_SYSV_HASH],
+ [$ac_default_emit_sysv_hash],
+ [Define to 1 if you want to emit sysv hash in the ELF linker by default.])
+
+AC_DEFINE_UNQUOTED([DEFAULT_EMIT_GNU_HASH],
+ [$ac_default_emit_gnu_hash],
+ [Define to 1 if you want to emit gnu hash in the ELF linker by default.])
+
AC_SUBST(elf_list_options)
AC_SUBST(elf_shlib_list_options)
AC_SUBST(elf_plt_unwind_list_options)