This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR gold/14897: gold is installed as default ld by accident
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 7 Jan 2013 11:32:37 -0800
- Subject: Re: PATCH: PR gold/14897: gold is installed as default ld by accident
- References: <20121130150235.GA7366@intel.com> <CAKOQZ8zo+8vqt4XKvHNuXBna7gw6n14_2UC7NM=9SZc5=S7L1w@mail.gmail.com>
On Mon, Jan 7, 2013 at 10:41 AM, Ian Lance Taylor <iant@google.com> wrote:
>
> I think it would be easier to understand if you wrote it more like this:
>
> AC_ARG_ENABLE(ld, [[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]])
>
> installed_linker=ld.gold
> AC_ARG_ENABLE(gold,
> [[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
> [case "${enableval}" in
> default)
> install_as_default=yes
> ;;
> yes)
> if test x${enable_ld} = xno; then
> install_as_default=yes
> fi
> ;;
> esac])
>
> I think the logic here is clearer: we set install_as_default when we
> see --enable-gold=default, or when we see --enable-gold --disable-ld.
>
There is no need for
AC_ARG_ENABLE(ld, [[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]])
since we only check
if test x${enable_ld} = xno; then
enable_ld is set to no for --disable-ld by default. Here is the
updated patch. OK for trunk?
Thanks.
--
H.J.
---
2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
Ian Lance Taylor <iant@google.com>
PR gold/14897
* configure.ac (--enable-ld): Removed.
(install_as_default): Set to yes only for --enable-gold=default
or --disable-ld.
* configure: Regenerated.
diff --git a/gold/configure.ac b/gold/configure.ac
index e49d6e8..804a474 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -68,32 +68,20 @@ dnl "install_as_default" is true if the linker to be install
ed as the
dnl default linker, ld.
dnl "installed_linker" is the installed gold linker name.
-default_ld=
-AC_ARG_ENABLE(ld,
-[[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]],
-[case "${enableval}" in
- default)
- default_ld=ld.bfd
- ;;
-esac])
-
+installed_linker=ld.gold
AC_ARG_ENABLE(gold,
[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]],
[case "${enableval}" in
- yes|default)
- if test x${default_ld} = x; then
+ default)
+ install_as_default=yes
+ ;;
+ yes)
+ if test x${enable_ld} = xno; then
install_as_default=yes
fi
- installed_linker=ld.gold
- ;;
- no)
- ;;
- *)
- AC_MSG_ERROR([invalid --enable-gold argument])
;;
esac],
-[install_as_default=no
- installed_linker=ld.gold])
+[install_as_default=no])
AC_SUBST(install_as_default)
AC_SUBST(installed_linker)