RFC: PATCH: Try to link in GMP, PPL and CLOOG statically

Richard Guenther richard.guenther@gmail.com
Thu Apr 2 09:22:00 GMT 2009


On Thu, Apr 2, 2009 at 3:05 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> Linking GMP, PPL and CLOOG dynamically has some issues if they aren't
> provided by system.  This patch will try to link in GMP, PPL and CLOOG
> statically. Is this a good idea?

Unconditionally?  No.

Richard.

> Thanks.
>
>
> H.J.
> ---
> 2009-04-01  H.J. Lu  <hongjiu.lu@intel.com>
>
>        * Makefile.in (GMPLIBS): Use @BSTATIC@ and @BDYNAMIC@.
>        (PPLLIBS): Likewise.
>        (CLOOGLIBS): Likewise.
>
>        * configure.ac: Support -Bstatic/-Bdynamic for linker version > 2.
>        Substitute BSTATIC and BDYNAMIC.
>        * configure: Regenerated.
>
> --- gcc/Makefile.in.static      2009-03-31 16:22:20.000000000 -0700
> +++ gcc/Makefile.in     2009-04-01 17:58:46.000000000 -0700
> @@ -274,15 +274,15 @@ ZLIB = @zlibdir@ -lz
>  ZLIBINC = @zlibinc@
>
>  # How to find GMP
> -GMPLIBS = @GMPLIBS@
> +GMPLIBS = @BSTATIC@ @GMPLIBS@ @BDYNAMIC@
>  GMPINC = @GMPINC@
>
>  # How to find PPL
> -PPLLIBS = @PPLLIBS@
> +PPLLIBS = @BSTATIC@ @PPLLIBS@ @BDYNAMIC@
>  PPLINC = @PPLINC@
>
>  # How to find CLOOG
> -CLOOGLIBS = @CLOOGLIBS@
> +CLOOGLIBS = @BSTATIC@ @CLOOGLIBS@ @BDYNAMIC@
>  CLOOGINC = @CLOOGINC@
>
>  CPPLIB = ../libcpp/libcpp.a
> --- gcc/configure.ac.static     2009-04-01 10:56:41.000000000 -0700
> +++ gcc/configure.ac    2009-04-01 17:56:26.000000000 -0700
> @@ -2756,7 +2756,8 @@ fi
>  AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option)
>  gcc_cv_ld_static_dynamic=no
>  if test $in_tree_ld = yes ; then
> -  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then
> +  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
> +     && test $in_tree_ld_is_elf = yes; then
>     gcc_cv_ld_static_dynamic=yes
>   fi
>  elif test x$gcc_cv_ld != x; then
> @@ -2767,10 +2768,14 @@ elif test x$gcc_cv_ld != x; then
>        fi
>  fi
>  if test x"$gcc_cv_ld_static_dynamic" = xyes; then
> +       BSTATIC="-Wl,-Bstatic"
> +       BDYNAMIC="-Wl,-Bdynamic"
>        AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1,
>  [Define if your linker supports -Bstatic/-Bdynamic option.])
>  fi
>  AC_MSG_RESULT($gcc_cv_ld_static_dynamic)
> +AC_SUBST(BSTATIC)
> +AC_SUBST(BDYNAMIC)
>
>  if test x"$demangler_in_ld" = xyes; then
>   AC_MSG_CHECKING(linker --demangle support)
>



More information about the Gcc-patches mailing list