From 5e242ae4ac0a092482bf391155d2ddfcdccc034a Mon Sep 17 00:00:00 2001 From: meissner Date: Wed, 5 Jun 1996 20:37:49 +0000 Subject: [PATCH] Turn off ELF shared libs for now by default; Add linker OS switch; more Solaris work git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12167 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/rs6000/eabile.h | 5 +++ gcc/config/rs6000/eabilesim.h | 3 ++ gcc/config/rs6000/eabisim.h | 3 ++ gcc/config/rs6000/linux.h | 3 ++ gcc/config/rs6000/rs6000.h | 2 +- gcc/config/rs6000/sol2.h | 23 ++-------- gcc/config/rs6000/sysv4.h | 98 ++++++++++++++++++++++++++++++++++++------- gcc/config/rs6000/sysv4le.h | 5 +++ 8 files changed, 106 insertions(+), 36 deletions(-) diff --git a/gcc/config/rs6000/eabile.h b/gcc/config/rs6000/eabile.h index 5b8e70dccd9..43175de2275 100644 --- a/gcc/config/rs6000/eabile.h +++ b/gcc/config/rs6000/eabile.h @@ -28,6 +28,11 @@ Boston, MA 02111-1307, USA. */ #undef CPP_ENDIAN_DEFAULT_SPEC #define CPP_ENDIAN_DEFAULT_SPEC "-D_LITTLE_ENDIAN -Amachine(littleendian)" +#undef LINK_TARGET_SPEC +#define LINK_TARGET_SPEC "\ +%{mbig: -oformat elf32-powerpc } %{mbig-endian: -oformat elf32-powerpc } \ +%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-linux: -oformat elf32-powerpc}}}}}" + /* Define this macro as a C expression for the initializer of an array of string to tell the driver program which options are defaults for this target and thus do not need to be handled diff --git a/gcc/config/rs6000/eabilesim.h b/gcc/config/rs6000/eabilesim.h index d826435145d..7ced05c7cb2 100644 --- a/gcc/config/rs6000/eabilesim.h +++ b/gcc/config/rs6000/eabilesim.h @@ -41,3 +41,6 @@ Boston, MA 02111-1307, USA. */ #undef LINK_START_DEFAULT_SPEC #define LINK_START_DEFAULT_SPEC "%(link_start_sim)" + +#undef LINK_OS_DEFAULT_SPEC +#define LINK_OS_DEFAULT_SPEC "%(link_start_sim)" diff --git a/gcc/config/rs6000/eabisim.h b/gcc/config/rs6000/eabisim.h index 6a82244973f..0fc590bd6f2 100644 --- a/gcc/config/rs6000/eabisim.h +++ b/gcc/config/rs6000/eabisim.h @@ -41,3 +41,6 @@ Boston, MA 02111-1307, USA. */ #undef LINK_START_DEFAULT_SPEC #define LINK_START_DEFAULT_SPEC "%(link_start_sim)" + +#undef LINK_OS_DEFAULT_SPEC +#define LINK_OS_DEFAULT_SPEC "%(link_os_sim)" diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h index 79a115ded4b..95388004802 100644 --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -41,5 +41,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef LINK_START_DEFAULT_SPEC #define LINK_START_DEFAULT_SPEC "%(link_start_linux)" +#undef LINK_OS_DEFAULT_SPEC +#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" + #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC Linux)"); diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index ca083b7122a..2cea3e73ec7 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -131,7 +131,7 @@ Boston, MA 02111-1307, USA. */ %{mcpu=860: -mppc}" #ifndef ASM_DEFAULT_SPEC -#define ASM_DEFAULT_SPEC "-mpwr" +#define ASM_DEFAULT_SPEC "" #endif /* This macro defines names of additional specifications to put in the specs diff --git a/gcc/config/rs6000/sol2.h b/gcc/config/rs6000/sol2.h index 8f88c0b2ce4..ac64a7b105a 100644 --- a/gcc/config/rs6000/sol2.h +++ b/gcc/config/rs6000/sol2.h @@ -28,26 +28,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef ASM_CPU_SPEC #define ASM_CPU_SPEC "%{fpic:-K PIC} %{fPIC:-K PIC} -le -s" -/* This should be the same as in svr4.h, except with -R added. */ -#undef LINK_SPEC -#define LINK_SPEC \ - "%{h*} %{v:-V} %{G*} \ - %{b} %{Wl,*:%*} \ - %{static:-dn -Bstatic} \ - %{shared:-G -dy -z text %{!h*:%{o*:-h %*}}} \ - %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \ - %{G:-G} \ - %{YP,*} \ - %{R*} %{!static:%{!R*:%{L*:-R %*}}} \ - %{compat-bsd: \ - %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ - %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \ - -R /usr/ucblib} \ - %{!compat-bsd: \ - %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ - %{!p:-Y P,/usr/ccs/lib:/usr/lib}}} \ - %{Qy:} %{!Qn:-Qy}" - #undef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_POWERPC | \ MASK_NEW_MNEMONICS | \ @@ -69,6 +49,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_solaris)" +#undef LINK_OS_DEFAULT_SPEC +#define LINK_OS_DEFAULT_SPEC "%(link_os_solaris)" + /* Don't turn -B into -L if the argument specifies a relative file name. */ #undef RELATIVE_PREFIX_NOT_LINKDIR diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 23eaac5b86f..36d3c189405 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -97,6 +97,7 @@ extern enum rs6000_sdata_type rs6000_sdata; { "mvme", 0 }, \ { "emb", 0 }, \ { "solaris-cclib", 0 }, \ + { "shlib", 0 }, \ { "newlib", 0 }, /* Default ABI to use */ @@ -937,8 +938,15 @@ do { \ #undef LINK_PATH_SPEC #ifndef CROSS_COMPILE #define LINK_PATH_SPEC "\ -%{!nostdlib: %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ -%{!p:-Y P,/usr/ccs/lib:/usr/lib}}}" +%{!R*:%{L*:-R %*}}} \ +%{!nostdlib: %{!YP,*: \ + %{compat-bsd: \ + %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ + %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \ + %{!R*: %{!L*: -R /usr/ucblib}} \ + %{!compat-bsd: \ + %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ + %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}" #else #define LINK_PATH_SPEC "" @@ -961,21 +969,57 @@ do { \ #undef LINK_SPEC #define LINK_SPEC "\ %{h*} %{v:-V} %{G*} \ -%{b} %{Wl,*:%*} \ +%{Wl,*:%*} %{YP,*} %{R*} \ +%{Qy:} %{!Qn:-Qy} \ +%(link_shlib) \ +%{!Ttext*: %(link_start) } \ +%(link_target) \ +%(link_os)" + +/* For now, turn off shared libraries by default. */ +#ifndef SHARED_LIB_SUPPORT +#define NO_SHARED_LIB_SUPPORT +#endif + +#undef LINK_SHLIB_SPEC +#ifndef NO_SHARED_LIB_SUPPORT +/* Shared libaries are default. */ +#define LINK_SHLIB_SPEC "\ +%{!static: %(link_path) %{!R*:%{L*:-R %*}}} \ +%{mshlib: } \ %{static:-dn -Bstatic} \ %{shared:-G -dy -z text %{!h*:%{o*:-h %*}}} \ -%{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \ -%{G:-G} \ -%{YP,*} \ -%(link_path) \ -%{!Ttext*: %(link_start) } \ -%{Qy:} %{!Qn:-Qy} \ +%{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}}" + +#else +/* Shared libraries are not default. */ +#define LINK_SHLIB_SPEC "\ +%{mshlib: %(link_path)} \ +%{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \ +%{static: } \ +%{shared:-G -dy -z text %{!h*:%{o*:-h %*}} %(link_path) } \ +%{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}} %(link_path) }" +#endif + +/* Override the default target of the linker. */ +#undef LINK_TARGET_SPEC +#define LINK_TARGET_SPEC "\ %{mlittle: -oformat elf32-powerpcle } %{mlittle-endian: -oformat elf32-powerpcle } \ -%{mbig: -oformat elf32-powerpc } %{mbig-endian: -oformat elf32-powerpc } \ -%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ - %{mcall-solaris: -oformat elf32-powerpcle} \ - %{mcall-linux: -oformat elf32-powerpc} }}}}" +%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-solaris: -oformat elf32-powerpcle}}}}}" + +/* Any specific OS flags */ +#ifndef LINK_OS_SPEC +#define LINK_OS_SPEC "\ +%{mmvme: %(link_os_mvme) } \ +%{msim: %(link_os_sim) } \ +%{mcall-linux: %(link_os_linux) } \ +%{mcall-solaris: %(link_os_solaris) } \ +%{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}" +#endif +#ifndef LINK_OS_DEFAULT_SPEC +#define LINK_OS_DEFAULT_SPEC "" +#endif #undef CPP_SYSV_SPEC #define CPP_SYSV_SPEC \ @@ -1071,6 +1115,10 @@ do { \ #define LINK_START_MVME_SPEC "" #endif +#ifndef LINK_OS_MVME_SPEC +#define LINK_OS_MVME_SPEC "" +#endif + #ifndef CPP_OS_MVME_SPEC #define CPP_OS_MVME_SPEC "" #endif @@ -1092,6 +1140,10 @@ do { \ #define LINK_START_SIM_SPEC "-Ttext 0x10000074" #endif +#ifndef LINK_OS_SIM_SPEC +#define LINK_OS_SIM_SPEC "" +#endif + #ifndef CPP_OS_SIM_SPEC #define CPP_OS_SIM_SPEC "" #endif @@ -1115,6 +1167,10 @@ scrti.o%s" #define LINK_START_LINUX_SPEC "-Ttext 0x400074" #endif +#ifndef LINK_OS_LINUX_SPEC +#define LINK_OS_LINUX_SPEC "" +#endif + #ifndef CPP_OS_LINUX_SPEC #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \ %{!ansi: -Dunix -Dlinux } \ @@ -1170,6 +1226,10 @@ scrti.o%s" #endif #endif +#ifndef LINK_OS_SOLARIS_SPEC +#define LINK_OS_SOLARIS_SPEC "" +#endif + #ifndef CPP_OS_SOLARIS_SPEC #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__ -D__SVR4__ \ %{!ansi: -Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__ } \ @@ -1194,18 +1254,26 @@ scrti.o%s" { "endfile_linux", ENDFILE_LINUX_SPEC }, \ { "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \ { "endfile_default", ENDFILE_DEFAULT_SPEC }, \ + { "link_path", LINK_PATH_SPEC }, \ + { "link_shlib", LINK_SHLIB_SPEC }, \ + { "link_target", LINK_TARGET_SPEC }, \ { "link_start", LINK_START_SPEC }, \ { "link_start_mvme", LINK_START_MVME_SPEC }, \ { "link_start_sim", LINK_START_SIM_SPEC }, \ { "link_start_linux", LINK_START_LINUX_SPEC }, \ { "link_start_solaris", LINK_START_SOLARIS_SPEC }, \ { "link_start_default", LINK_START_DEFAULT_SPEC }, \ + { "link_os", LINK_OS_SPEC }, \ + { "link_os_mvme", LINK_OS_MVME_SPEC }, \ + { "link_os_sim", LINK_OS_SIM_SPEC }, \ + { "link_os_linux", LINK_OS_LINUX_SPEC }, \ + { "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \ + { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ { "cpp_os_sim", CPP_OS_SIM_SPEC }, \ { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ { "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \ - { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \ - { "link_path", LINK_PATH_SPEC }, + { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, /* Define this macro as a C expression for the initializer of an array of string to tell the driver program which options are diff --git a/gcc/config/rs6000/sysv4le.h b/gcc/config/rs6000/sysv4le.h index 941ab7b0d3e..5e7a67900dc 100644 --- a/gcc/config/rs6000/sysv4le.h +++ b/gcc/config/rs6000/sysv4le.h @@ -28,6 +28,11 @@ Boston, MA 02111-1307, USA. */ #undef CPP_ENDIAN_DEFAULT_SPEC #define CPP_ENDIAN_DEFAULT_SPEC "-D_LITTLE_ENDIAN -Amachine(littleendian)" +#undef LINK_TARGET_SPEC +#define LINK_TARGET_SPEC "\ +%{mbig: -oformat elf32-powerpc } %{mbig-endian: -oformat elf32-powerpc } \ +%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-linux: -oformat elf32-powerpc}}}}}" + /* Define this macro as a C expression for the initializer of an array of string to tell the driver program which options are defaults for this target and thus do not need to be handled -- 2.11.0