From 2760f24c4942853eac7b921e4b8843d57a602654 Mon Sep 17 00:00:00 2001 From: Romain Geissler Date: Tue, 8 Aug 2017 07:25:39 +0930 Subject: 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. --- gold/configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gold/configure.ac') diff --git a/gold/configure.ac b/gold/configure.ac index cbe3380..d7fa1f8 100644 --- a/gold/configure.ac +++ b/gold/configure.ac @@ -161,6 +161,26 @@ if test -n "$enable_targets"; then done fi +# 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]) + +AC_DEFINE_UNQUOTED([DEFAULT_HASH_STYLE], + ["${enable_default_hash_style}"], + [Set the default --hash-style value]) + # See which specific instantiations we need. targetobjs= all_targets= -- cgit v1.1