diff options
author | jdp <jdp@FreeBSD.org> | 1997-04-09 20:13:41 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1997-04-09 20:13:41 +0000 |
commit | 76800e1dac55c750d871a9d186890e37094b40ea (patch) | |
tree | 2dc9a3a07b8dddd761bef4c458bea3a88786d26d /contrib/gcc | |
parent | 04cc0074bbc8f4dfa238e9756672b5bc3fb2d9e7 (diff) | |
download | FreeBSD-src-76800e1dac55c750d871a9d186890e37094b40ea.zip FreeBSD-src-76800e1dac55c750d871a9d186890e37094b40ea.tar.gz |
Make "gcc -shared" work properly for building shared libraries. An
up-to-date version of c++rt0.o is necessary for this to work right.
Closes PR gnu/3035: gcc -shared flag is broken.
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/config/i386/freebsd.h | 11 | ||||
-rw-r--r-- | contrib/gcc/config/i386/freebsd.h.fixed | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index 264a5e0..a96eb63 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -87,17 +87,20 @@ Boston, MA 02111-1307, USA. */ #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}" /* Like the default, except no -lg, and no -p. */ -#define LIB_SPEC "%{!pg:-lc}%{pg:-lc_p}" +#define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}" #define LINK_SPEC \ "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \ - %{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*} \ - %{pg:-Bstatic} %{Z} %{R*}" + %{shared:-Bshareable} \ + %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \ + %{pg:-Bstatic} %{Z}} \ + %{assert*} %{R*}" #define LINK_LIBGCC_SPECIAL_1 1 #define STARTFILE_SPEC \ - "%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}" + "%{shared:c++rt0.o%s} \ + %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}" /* This goes away when the math emulator is fixed. */ #undef TARGET_DEFAULT diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed index 264a5e0..a96eb63 100644 --- a/contrib/gcc/config/i386/freebsd.h.fixed +++ b/contrib/gcc/config/i386/freebsd.h.fixed @@ -87,17 +87,20 @@ Boston, MA 02111-1307, USA. */ #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}" /* Like the default, except no -lg, and no -p. */ -#define LIB_SPEC "%{!pg:-lc}%{pg:-lc_p}" +#define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}" #define LINK_SPEC \ "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \ - %{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*} \ - %{pg:-Bstatic} %{Z} %{R*}" + %{shared:-Bshareable} \ + %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \ + %{pg:-Bstatic} %{Z}} \ + %{assert*} %{R*}" #define LINK_LIBGCC_SPECIAL_1 1 #define STARTFILE_SPEC \ - "%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}" + "%{shared:c++rt0.o%s} \ + %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}" /* This goes away when the math emulator is fixed. */ #undef TARGET_DEFAULT |