aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog8
-rw-r--r--gold/config.in3
-rwxr-xr-xgold/configure27
-rw-r--r--gold/configure.ac20
-rw-r--r--gold/options.h2
5 files changed, 59 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 950be70..813b27f 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,11 @@
+2017-08-08 Romain Geissler <romain.geissler@gmail.com>
+ Alan Modra <amodra@gmail.com>
+
+ * configure.ac: Add --enable-default-hash-style option.
+ * options.h (hash_style): Use DEFAULT_HASH_STYLE as default value.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
2017-08-03 James Clarke <jrtc27@jrtc27.com>
* options.h (General_options): Set a non-NULL second help string
diff --git a/gold/config.in b/gold/config.in
index d9f7b76..5855fca 100644
--- a/gold/config.in
+++ b/gold/config.in
@@ -10,6 +10,9 @@
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
+/* Set the default --hash-style value */
+#undef DEFAULT_HASH_STYLE
+
/* Define to 1 if you want to enable -z relro in ELF linker by default. */
#undef DEFAULT_LD_Z_RELRO
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=
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=
diff --git a/gold/options.h b/gold/options.h
index 6b45f64..970e76f 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -925,7 +925,7 @@ class General_options
N_("Min fraction of empty buckets in dynamic hash"),
N_("FRACTION"));
- DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "sysv",
+ DEFINE_enum(hash_style, options::TWO_DASHES, '\0', DEFAULT_HASH_STYLE,
N_("Dynamic hash style"), N_("[sysv,gnu,both]"),
{"sysv", "gnu", "both"});