From c6092243c9d5320aad5a6f0d03c7d80658bd6c2e Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Mon, 31 Jan 2011 13:52:42 +0000 Subject: [PATCH] configure.ac (gcc_cv_ld_static_option): Define. gcc: * configure.ac (gcc_cv_ld_static_option): Define. (gcc_cv_ld_dynamic_option): Define. (gcc_cv_ld_static_dynamic): Tru64 UNIX support -noso/-so_archive instead. (HAVE_LD_STATIC_DYNAMIC): Update message. (LD_STATIC_OPTION): Define. (LD_DYNAMIC_OPTION): Define. * configure: Regenerate. * config.in: Regenerate. * gcc.c (init_spec) [USE_LIBUNWIND_EXCEPTIONS && HAVE_LD_STATIC_DYNAMIC]: Use them. gcc/cp: * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. gcc/fortran: * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. gcc/go: * gospec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. From-SVN: r169435 --- gcc/ChangeLog | 14 ++++++++++++++ gcc/config.in | 24 +++++++++++++++++++----- gcc/configure | 18 ++++++++++++++++++ gcc/configure.ac | 14 +++++++++++++- gcc/cp/ChangeLog | 5 +++++ gcc/cp/g++spec.c | 6 +++--- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/gfortranspec.c | 4 ++-- gcc/gcc.c | 3 ++- gcc/go/ChangeLog | 5 +++++ gcc/go/gospec.c | 6 +++--- 11 files changed, 89 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b054ad275689..272dc421a211 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2011-01-31 Rainer Orth + + * configure.ac (gcc_cv_ld_static_option): Define. + (gcc_cv_ld_dynamic_option): Define. + (gcc_cv_ld_static_dynamic): Tru64 UNIX support -noso/-so_archive + instead. + (HAVE_LD_STATIC_DYNAMIC): Update message. + (LD_STATIC_OPTION): Define. + (LD_DYNAMIC_OPTION): Define. + * configure: Regenerate. + * config.in: Regenerate. + * gcc.c (init_spec) [USE_LIBUNWIND_EXCEPTIONS && + HAVE_LD_STATIC_DYNAMIC]: Use them. + 2011-01-31 Nick Clifton * config/rx/rx.c (rx_get_stack_layout): Only save call clobbered diff --git a/gcc/config.in b/gcc/config.in index 9df41a1635cf..f3b0eee31260 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1142,10 +1142,6 @@ #undef HAVE_LDFCN_H #endif -/* Define if your linker supports plugin. */ -#ifndef USED_FOR_TARGET -#undef HAVE_LTO_PLUGIN -#endif /* Define if your linker supports --as-needed and --no-as-needed options. */ #ifndef USED_FOR_TARGET @@ -1213,7 +1209,7 @@ #endif -/* Define if your linker supports -Bstatic/-Bdynamic option. */ +/* Define if your linker supports -Bstatic/-Bdynamic or equivalent options. */ #ifndef USED_FOR_TARGET #undef HAVE_LD_STATIC_DYNAMIC #endif @@ -1249,6 +1245,12 @@ #endif +/* Define if your linker supports plugin. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LTO_PLUGIN +#endif + + /* Define to 1 if you have the header file. */ #ifndef USED_FOR_TARGET #undef HAVE_MALLOC_H @@ -1544,6 +1546,18 @@ #endif +/* Define to the linker option to enable use of shared objects. */ +#ifndef USED_FOR_TARGET +#undef LD_DYNAMIC_OPTION +#endif + + +/* Define to the linker option to disable use of shared objects. */ +#ifndef USED_FOR_TARGET +#undef LD_STATIC_OPTION +#endif + + /* Define to the linker flags to use for -pthread. */ #ifndef USED_FOR_TARGET #undef LIB_THREAD_LDFLAGS_SPEC diff --git a/gcc/configure b/gcc/configure index 6bde5f9e487e..85af3e59403b 100755 --- a/gcc/configure +++ b/gcc/configure @@ -23051,6 +23051,8 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker -Bstatic/-Bdynamic option" >&5 $as_echo_n "checking linker -Bstatic/-Bdynamic option... " >&6; } gcc_cv_ld_static_dynamic=no +gcc_cv_ld_static_option='-Bstatic' +gcc_cv_ld_dynamic_option='-Bdynamic' if test $in_tree_ld = yes ; 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; then gcc_cv_ld_static_dynamic=yes @@ -23062,6 +23064,12 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_static_dynamic=yes else case "$target" in + # Tru64 UNIX support -noso/-so_archive instead of -Bstatic/-Bdynamic. + alpha*-dec-osf*) + gcc_cv_ld_static_dynamic=yes + gcc_cv_ld_static_option="-noso" + gcc_cv_ld_dynamic_option="-so_archive" + ;; # IRIX 6 ld supports -Bstatic/-Bdynamic. mips-sgi-irix6*) gcc_cv_ld_static_dynamic=yes @@ -23077,6 +23085,16 @@ if test x"$gcc_cv_ld_static_dynamic" = xyes; then $as_echo "#define HAVE_LD_STATIC_DYNAMIC 1" >>confdefs.h + +cat >>confdefs.h <<_ACEOF +#define LD_STATIC_OPTION "$gcc_cv_ld_static_option" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LD_DYNAMIC_OPTION "$gcc_cv_ld_dynamic_option" +_ACEOF + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_static_dynamic" >&5 $as_echo "$gcc_cv_ld_static_dynamic" >&6; } diff --git a/gcc/configure.ac b/gcc/configure.ac index 60d4f3173fef..6a90014d5fed 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3112,6 +3112,8 @@ fi AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option) gcc_cv_ld_static_dynamic=no +gcc_cv_ld_static_option='-Bstatic' +gcc_cv_ld_dynamic_option='-Bdynamic' if test $in_tree_ld = yes ; 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; then gcc_cv_ld_static_dynamic=yes @@ -3123,6 +3125,12 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_static_dynamic=yes else case "$target" in + # Tru64 UNIX support -noso/-so_archive instead of -Bstatic/-Bdynamic. + alpha*-dec-osf*) + gcc_cv_ld_static_dynamic=yes + gcc_cv_ld_static_option="-noso" + gcc_cv_ld_dynamic_option="-so_archive" + ;; # IRIX 6 ld supports -Bstatic/-Bdynamic. mips-sgi-irix6*) gcc_cv_ld_static_dynamic=yes @@ -3136,7 +3144,11 @@ elif test x$gcc_cv_ld != x; then fi if test x"$gcc_cv_ld_static_dynamic" = xyes; then AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1, -[Define if your linker supports -Bstatic/-Bdynamic option.]) +[Define if your linker supports -Bstatic/-Bdynamic or equivalent options.]) + AC_DEFINE_UNQUOTED(LD_STATIC_OPTION, "$gcc_cv_ld_static_option", +[Define to the linker option to disable use of shared objects.]) + AC_DEFINE_UNQUOTED(LD_DYNAMIC_OPTION, "$gcc_cv_ld_dynamic_option", +[Define to the linker option to enable use of shared objects.]) fi AC_MSG_RESULT($gcc_cv_ld_static_dynamic) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b38ed5fa10d7..48bc1db9b0c1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-31 Rainer Orth + + * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use + LD_STATIC_OPTION, LD_DYNAMIC_OPTION. + 2011-01-29 Dodji Seketeli PR c++/47311 diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 9ebf6bc2eae8..3a9faa9c1e91 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -1,6 +1,6 @@ /* Specific flags and argument handling of the C++ front end. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -316,7 +316,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, #ifdef HAVE_LD_STATIC_DYNAMIC if (library > 1 && !static_link) { - generate_option (OPT_Wl_, "-Bstatic", 1, CL_DRIVER, + generate_option (OPT_Wl_, LD_STATIC_OPTION, 1, CL_DRIVER, &new_decoded_options[j]); j++; } @@ -337,7 +337,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, #ifdef HAVE_LD_STATIC_DYNAMIC if (library > 1 && !static_link) { - generate_option (OPT_Wl_, "-Bdynamic", 1, CL_DRIVER, + generate_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1, CL_DRIVER, &new_decoded_options[j]); j++; } diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ecdf2defe16d..f787a974c22c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2011-01-31 Rainer Orth + + * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use + LD_STATIC_OPTION, LD_DYNAMIC_OPTION. + 2011-01-31 Tobias Burnus PR fortran/47042 diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c index a9bc71454199..2d732fdd45b1 100644 --- a/gcc/fortran/gfortranspec.c +++ b/gcc/fortran/gfortranspec.c @@ -192,12 +192,12 @@ add_arg_libgfortran (bool force_static ATTRIBUTE_UNUSED) { #ifdef HAVE_LD_STATIC_DYNAMIC if (force_static) - append_option (OPT_Wl_, "-Bstatic", 1); + append_option (OPT_Wl_, LD_STATIC_OPTION, 1); #endif append_option (OPT_l, FORTRAN_LIBRARY, 1); #ifdef HAVE_LD_STATIC_DYNAMIC if (force_static) - append_option (OPT_Wl_, "-Bdynamic", 1); + append_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1); #endif } diff --git a/gcc/gcc.c b/gcc/gcc.c index ea3403b5ca96..1736b091fb11 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1375,7 +1375,8 @@ init_spec (void) "-lgcc_eh" #ifdef USE_LIBUNWIND_EXCEPTIONS # ifdef HAVE_LD_STATIC_DYNAMIC - " %{!static:-Bstatic} -lunwind %{!static:-Bdynamic}" + " %{!static:" LD_STATIC_OPTION "} -lunwind" + " %{!static:" LD_DYNAMIC_OPTION "}" # else " -lunwind" # endif diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 7c1f272a0731..ff6958abfccc 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,8 @@ +2011-01-31 Rainer Orth + + * gospec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use + LD_STATIC_OPTION, LD_DYNAMIC_OPTION. + 2011-01-21 Ian Lance Taylor * go-lang.c (go_langhook_init): Omit float_type_size when calling diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c index 7d21ace46be3..55a3bcd5bb7f 100644 --- a/gcc/go/gospec.c +++ b/gcc/go/gospec.c @@ -1,5 +1,5 @@ /* gospec.c -- Specific flags and argument handling of the gcc Go front end. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -301,7 +301,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, #ifdef HAVE_LD_STATIC_DYNAMIC if (library > 1 && !static_link) { - generate_option (OPT_Wl_, "-Bstatic", 1, CL_DRIVER, + generate_option (OPT_Wl_, LD_STATIC_OPTION, 1, CL_DRIVER, &new_decoded_options[j]); j++; } @@ -315,7 +315,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, #ifdef HAVE_LD_STATIC_DYNAMIC if (library > 1 && !static_link) { - generate_option (OPT_Wl_, "-Bdynamic", 1, CL_DRIVER, + generate_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1, CL_DRIVER, &new_decoded_options[j]); j++; } -- 2.43.5