Commit f1cf4606 by Marc Espie Committed by Marc Espie

config.gcc (*-*-openbsd*): Add fragment to compile libgcc correctly for shared configurations.

2001-07-13  Marc Espie  <espie@cvs.openbsd.org>

	* config.gcc (*-*-openbsd*):  Add fragment to compile libgcc
	correctly for shared configurations.
	* config/t-libgcc-pic:  New.
	* config/{i386,m68k,sparc}/t-openbsd:  New.
	* config/openbsd.h:  Include cpu_spec in cpp_spec where needed.
	Support -shared.  Support debugging libraries with -g.
	* config/i386/openbsd.h:  Correct ASM_COMMENT_START.  Ensure dwarf2
	frame information does not emit pointer diffs.
	* config/sparc/openbsd.h:  Ensure dwarf2 frame information does not
	emit pointer diffs.

From-SVN: r43988
parent 998d20d2
2001-07-13 Marc Espie <espie@cvs.openbsd.org>
* config.gcc (*-*-openbsd*): Add fragment to compile libgcc
correctly for shared configurations.
* config/t-libgcc-pic: New.
* config/{i386,m68k,sparc}/t-openbsd: New.
* config/openbsd.h: Include cpu_spec in cpp_spec where needed.
Support -shared. Support debugging libraries with -g.
* config/i386/openbsd.h: Correct ASM_COMMENT_START. Ensure dwarf2
frame information does not emit pointer diffs.
* config/sparc/openbsd.h: Ensure dwarf2 frame information does not
emit pointer diffs.
2001-07-13 Geoffrey Keating <geoffk@redhat.com> 2001-07-13 Geoffrey Keating <geoffk@redhat.com>
Revert Jan Hubicka's patch of Fri Jul 13 14:46:21 CEST 2001. Revert Jan Hubicka's patch of Fri Jul 13 14:46:21 CEST 2001.
......
...@@ -286,7 +286,7 @@ case $machine in ...@@ -286,7 +286,7 @@ case $machine in
;; ;;
*-*-openbsd*) *-*-openbsd*)
tm_file=${cpu_type}/openbsd.h tm_file=${cpu_type}/openbsd.h
tmake_file="t-libc-ok t-openbsd" tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
xm_defines=POSIX xm_defines=POSIX
if test x$enable_threads = xyes; then if test x$enable_threads = xyes; then
thread_file='posix' thread_file='posix'
...@@ -1058,6 +1058,8 @@ i[34567]86-*-netbsd*) ...@@ -1058,6 +1058,8 @@ i[34567]86-*-netbsd*)
use_collect2=yes use_collect2=yes
;; ;;
i[34567]86-*-openbsd*) i[34567]86-*-openbsd*)
# needed to unconfuse gdb
tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
# we need collect2 until our bug is fixed... # we need collect2 until our bug is fixed...
use_collect2=yes use_collect2=yes
;; ;;
...@@ -1859,6 +1861,8 @@ m68k*-*-netbsd*) ...@@ -1859,6 +1861,8 @@ m68k*-*-netbsd*)
use_collect2=yes use_collect2=yes
;; ;;
m68k*-*-openbsd*) m68k*-*-openbsd*)
# needed to unconfuse gdb
tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
float_format=m68k float_format=m68k
# we need collect2 until our bug is fixed... # we need collect2 until our bug is fixed...
use_collect2=yes use_collect2=yes
...@@ -2830,6 +2834,8 @@ sparc-*-netbsd*) ...@@ -2830,6 +2834,8 @@ sparc-*-netbsd*)
use_collect2=yes use_collect2=yes
;; ;;
sparc-*-openbsd*) sparc-*-openbsd*)
# needed to unconfuse gdb
tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
# we need collect2 until our bug is fixed... # we need collect2 until our bug is fixed...
use_collect2=yes use_collect2=yes
;; ;;
......
...@@ -111,6 +111,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -111,6 +111,8 @@ Boston, MA 02111-1307, USA. */
configuration files... */ configuration files... */
#define DWARF2_UNWIND_INFO 0 #define DWARF2_UNWIND_INFO 0
#undef ASM_PREFERRED_EH_DATA_FORMAT
/* Assembler format: alignment output. */ /* Assembler format: alignment output. */
/* A C statement to output to the stdio stream FILE an assembler /* A C statement to output to the stdio stream FILE an assembler
...@@ -130,3 +132,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -130,3 +132,7 @@ Boston, MA 02111-1307, USA. */
#endif #endif
/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */ /* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
#undef ASM_COMMENT_START
#define ASM_COMMENT_START ";#"
# gdb gets confused if pic code is linked with non pic
# We cope by building variants of libgcc.
MULTILIB_OPTIONS = fpic
MULTILIB_MATCHES=fpic=fPIC
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
# gdb gets confused if pic code is linked with non pic
# We cope by building all variants of libgcc.
MULTILIB_OPTIONS = fpic/fPIC
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
...@@ -78,12 +78,16 @@ Boston, MA 02111-1307, USA. */ ...@@ -78,12 +78,16 @@ Boston, MA 02111-1307, USA. */
since all code must be compiled with -pthread to work. since all code must be compiled with -pthread to work.
This two-stage defines makes it easy to pick that for targets that This two-stage defines makes it easy to pick that for targets that
have subspecs. */ have subspecs. */
#ifdef CPP_CPU_SPEC
#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#else
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" #define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#endif
/* LIB_SPEC appropriate for OpenBSD. Select the appropriate libc, /* LIB_SPEC appropriate for OpenBSD. Select the appropriate libc,
depending on profiling and threads. Basically, depending on profiling and threads. Basically,
-lc(_r)?(_p)?, select _r for threads, and _p for p or pg. */ -lc(_r)?(_p)?, select _r for threads, and _p for p or pg. */
#define OBSD_LIB_SPEC "-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}" #define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
#ifndef OBSD_HAS_CORRECT_SPECS #ifndef OBSD_HAS_CORRECT_SPECS
...@@ -103,6 +107,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -103,6 +107,7 @@ Boston, MA 02111-1307, USA. */
pic code. */ pic code. */
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K} %|" #define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K} %|"
#else #else
/* Since we use gas, stdin -> - is a good idea, but we don't want to /* Since we use gas, stdin -> - is a good idea, but we don't want to
override native specs just for that. */ override native specs just for that. */
...@@ -116,10 +121,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -116,10 +121,10 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC #undef LINK_SPEC
#ifdef OBSD_NO_DYNAMIC_LIBRARIES #ifdef OBSD_NO_DYNAMIC_LIBRARIES
#define LINK_SPEC \ #define LINK_SPEC \
"%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}" "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}"
#else #else
#define LINK_SPEC \ #define LINK_SPEC \
"%{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}" "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
#endif #endif
#undef LIB_SPEC #undef LIB_SPEC
......
...@@ -64,5 +64,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -64,5 +64,6 @@ Boston, MA 02111-1307, USA. */
configuration files... */ configuration files... */
#define DWARF2_UNWIND_INFO 0 #define DWARF2_UNWIND_INFO 0
/* Default sparc.h does already define ASM_OUTPUT_MI_THUNK */ #undef ASM_PREFERRED_EH_DATA_FORMAT
/* Default sparc.h does already define ASM_OUTPUT_MI_THUNK */
# The native linker doesn't handle linking -fpic code with -fPIC code. Ugh.
# We cope by building both variants of libgcc.
MULTILIB_OPTIONS = fpic/fPIC
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
# Compile libgcc2.a with pic.
TARGET_LIBGCC2_CFLAGS = -fPIC
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment