Patchwork [15/25] Specs cleanup: config/rs6000/sysv4.h SHARED_LIB_SUPPORT

login
register
mail settings
Submitter Joseph S. Myers
Date Jan. 14, 2011, 12:12 a.m.
Message ID <Pine.LNX.4.64.1101140012080.6059@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/78843/
State New
Headers show

Comments

Joseph S. Myers - Jan. 14, 2011, 12:12 a.m.
config/rs6000/sysv4.h has a conditional on SHARED_LIB_SUPPORT, which
is nowhere defined.  Removing this allows a conditional definition of
LINK_SHLIB_SPEC to be removed, which this patch does.  OK to commit?

2011-01-13  Joseph Myers  <joseph@codesourcery.com>

	* config/rs6000/sysv4.h (SHARED_LIB_SUPPORT): Remove conditional.
	(NO_SHARED_LIB_SUPPORT): Remove.
	(LINK_SHLIB_SPEC): Remove one conditional definition.
David Edelsohn - Jan. 17, 2011, 4:09 p.m.
On Thu, Jan 13, 2011 at 7:12 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> config/rs6000/sysv4.h has a conditional on SHARED_LIB_SUPPORT, which
> is nowhere defined.  Removing this allows a conditional definition of
> LINK_SHLIB_SPEC to be removed, which this patch does.  OK to commit?
>
> 2011-01-13  Joseph Myers  <joseph@codesourcery.com>
>
>        * config/rs6000/sysv4.h (SHARED_LIB_SUPPORT): Remove conditional.
>        (NO_SHARED_LIB_SUPPORT): Remove.
>        (LINK_SHLIB_SPEC): Remove one conditional definition.

Okay.

Thanks, David

P.S. Any idea where this block came from?
Joseph S. Myers - Jan. 25, 2011, 10:39 p.m.
On Mon, 17 Jan 2011, David Edelsohn wrote:

> On Thu, Jan 13, 2011 at 7:12 PM, Joseph S. Myers
> <joseph@codesourcery.com> wrote:
> > config/rs6000/sysv4.h has a conditional on SHARED_LIB_SUPPORT, which
> > is nowhere defined.  Removing this allows a conditional definition of
> > LINK_SHLIB_SPEC to be removed, which this patch does.  OK to commit?
> >
> > 2011-01-13  Joseph Myers  <joseph@codesourcery.com>
> >
> >        * config/rs6000/sysv4.h (SHARED_LIB_SUPPORT): Remove conditional.
> >        (NO_SHARED_LIB_SUPPORT): Remove.
> >        (LINK_SHLIB_SPEC): Remove one conditional definition.
> 
> Okay.
> 
> Thanks, David
> 
> P.S. Any idea where this block came from?

It appeared in 2.8, presumably from

Wed Jun  5 16:25:51 1996  Michael Meissner  <meissner@tiktok.cygnus.com>

        * rs6000.h (ASM_DEFAULT_SPEC): Default to "", not -mpwr.

        * sysv4.h (SUBTARGET_SWITCHES): Add -mshlib.
        (LINK_PATH_SPEC): Add -compat-bsd support from Solaris.
        (LINK_SPEC): Eliminate %{b} and %{G}, since they conflict with GCC
        switches.  Defer shared library support to LINK_SHLIB_SPEC.  Defer
        target selection to LINK_TARGET_SPEC.
        (LINK_SHLIB_SPEC): Provide two different versions, depending on
        whether shared libraries are default or not.  Make shared
        libraries not default until linker is fixed.
        (LINK_OS_*_SPEC): New specs for OS specific linker switches.
        (SUBTARGET_EXTRA_SPECS): Add new specs.

        * {sol2,sysv4}.h (LINK_SPEC): Move Solaris link into general link spec.

        * {sysv4,sysv4le,eabile}.h (LINK_TARGET_SPEC): Only pass -oformat
        to the linker if the user is changing the default endian format.

        * {sol2,linux,eabisim,eabilesim}.h (LINK_OS_DEFAULT_SPEC): Define
        to use the appropriate OS link spec.

which now appears to be r12167, part of a port to PowerPC Solaris.  
Support for PowerPC Solaris was removed in r47232 
<http://gcc.gnu.org/ml/gcc-patches/2001-11/msg01329.html>.

Patch

diff -rupN --exclude=.svn gcc-mainline-14/gcc/config/rs6000/sysv4.h gcc-mainline/gcc/config/rs6000/sysv4.h
--- gcc-mainline-14/gcc/config/rs6000/sysv4.h	2010-12-20 13:12:12.000000000 -0800
+++ gcc-mainline/gcc/config/rs6000/sysv4.h	2011-01-12 14:36:47.000000000 -0800
@@ -642,21 +642,6 @@  extern int fixuplabelno;
 %(link_target) \
 %(link_os)"
 
-/* For now, turn off shared libraries by default.  */
-#ifndef SHARED_LIB_SUPPORT
-#define NO_SHARED_LIB_SUPPORT
-#endif
-
-#ifndef NO_SHARED_LIB_SUPPORT
-/* Shared libraries are default.  */
-#define LINK_SHLIB_SPEC "\
-%{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
-%{mshlib: } \
-%{static:-dn -Bstatic} \
-%{shared:-G -dy -z text} \
-%{symbolic:-Bsymbolic -G -dy -z text}"
-
-#else
 /* Shared libraries are not default.  */
 #define LINK_SHLIB_SPEC "\
 %{mshlib: %(link_path) } \
@@ -664,7 +649,6 @@  extern int fixuplabelno;
 %{static: } \
 %{shared:-G -dy -z text %(link_path) } \
 %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
-#endif
 
 /* Override the default target of the linker.  */
 #define	LINK_TARGET_SPEC "\