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 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gold/configure') diff --git a/gold/configure b/gold/configure index cb020be..90a706d 100755 --- a/gold/configure +++ b/gold/configure @@ -797,6 +797,7 @@ enable_threads enable_plugins enable_relro enable_targets +enable_default_hash_style with_lib_path enable_dependency_tracking enable_nls @@ -1447,6 +1448,8 @@ Optional Features: --enable-plugins linker plugins --enable-relro enable -z relro in ELF linker by default --enable-targets alternative target configurations + --enable-default-hash-style={sysv,gnu,both} + use this default hash style --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-nls do not use Native Language Support @@ -3410,6 +3413,30 @@ 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. +# Check whether --enable-default-hash-style was given. +if test "${enable_default_hash_style+set}" = set; then : + enableval=$enable_default_hash_style; case "${enable_default_hash_style}" in + sysv | gnu | both) ;; + *) as_fn_error "bad value ${enable_default_hash_style} for enable-default-hash-style option" "$LINENO" 5 ;; +esac +else + 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 +fi + + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_HASH_STYLE "${enable_default_hash_style}" +_ACEOF + + # See which specific instantiations we need. targetobjs= all_targets= -- cgit v1.1