summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorespie <espie@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-13 18:12:22 +0000
committerespie <espie@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-13 18:12:22 +0000
commitc7be79ca013cc10b9abb223f426ab6c3db1d0b33 (patch)
tree85a550762d0c195f69d066c9199eb145b33ed9ab
parentc584b99b3a2cf2486f216f1a435b0e691f33a07d (diff)
downloadgcc-c7be79ca013cc10b9abb223f426ab6c3db1d0b33.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43988 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config.gcc8
-rw-r--r--gcc/config/i386/openbsd.h6
-rw-r--r--gcc/config/i386/t-openbsd6
-rw-r--r--gcc/config/m68k/t-openbsd5
-rw-r--r--gcc/config/openbsd.h11
-rw-r--r--gcc/config/sparc/openbsd.h3
-rw-r--r--gcc/config/sparc/t-openbsd5
-rw-r--r--gcc/config/t-libgcc-pic2
9 files changed, 54 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5143add5c67..7c5ec9c4b2e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+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>
Revert Jan Hubicka's patch of Fri Jul 13 14:46:21 CEST 2001.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index b5d01dcb695..932b00dbb12 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -286,7 +286,7 @@ case $machine in
;;
*-*-openbsd*)
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
if test x$enable_threads = xyes; then
thread_file='posix'
@@ -1058,6 +1058,8 @@ i[34567]86-*-netbsd*)
use_collect2=yes
;;
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...
use_collect2=yes
;;
@@ -1859,6 +1861,8 @@ m68k*-*-netbsd*)
use_collect2=yes
;;
m68k*-*-openbsd*)
+ # needed to unconfuse gdb
+ tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
float_format=m68k
# we need collect2 until our bug is fixed...
use_collect2=yes
@@ -2830,6 +2834,8 @@ sparc-*-netbsd*)
use_collect2=yes
;;
sparc-*-openbsd*)
+ # needed to unconfuse gdb
+ tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
diff --git a/gcc/config/i386/openbsd.h b/gcc/config/i386/openbsd.h
index 18b20e9915d..47057750537 100644
--- a/gcc/config/i386/openbsd.h
+++ b/gcc/config/i386/openbsd.h
@@ -111,6 +111,8 @@ Boston, MA 02111-1307, USA. */
configuration files... */
#define DWARF2_UNWIND_INFO 0
+#undef ASM_PREFERRED_EH_DATA_FORMAT
+
/* Assembler format: alignment output. */
/* A C statement to output to the stdio stream FILE an assembler
@@ -130,3 +132,7 @@ Boston, MA 02111-1307, USA. */
#endif
/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
+
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START ";#"
+
diff --git a/gcc/config/i386/t-openbsd b/gcc/config/i386/t-openbsd
new file mode 100644
index 00000000000..18304634000
--- /dev/null
+++ b/gcc/config/i386/t-openbsd
@@ -0,0 +1,6 @@
+# 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
diff --git a/gcc/config/m68k/t-openbsd b/gcc/config/m68k/t-openbsd
new file mode 100644
index 00000000000..24f9a43b000
--- /dev/null
+++ b/gcc/config/m68k/t-openbsd
@@ -0,0 +1,5 @@
+# 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
diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
index 87b3a60567f..ff1c1ad540b 100644
--- a/gcc/config/openbsd.h
+++ b/gcc/config/openbsd.h
@@ -78,12 +78,16 @@ Boston, MA 02111-1307, USA. */
since all code must be compiled with -pthread to work.
This two-stage defines makes it easy to pick that for targets that
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}"
+#endif
/* LIB_SPEC appropriate for OpenBSD. Select the appropriate libc,
depending on profiling and threads. Basically,
-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
@@ -103,6 +107,7 @@ Boston, MA 02111-1307, USA. */
pic code. */
#undef ASM_SPEC
#define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K} %|"
+
#else
/* Since we use gas, stdin -> - is a good idea, but we don't want to
override native specs just for that. */
@@ -116,10 +121,10 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#ifdef OBSD_NO_DYNAMIC_LIBRARIES
#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
#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
#undef LIB_SPEC
diff --git a/gcc/config/sparc/openbsd.h b/gcc/config/sparc/openbsd.h
index c5dc4431726..ba97ac7b9de 100644
--- a/gcc/config/sparc/openbsd.h
+++ b/gcc/config/sparc/openbsd.h
@@ -64,5 +64,6 @@ Boston, MA 02111-1307, USA. */
configuration files... */
#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 */
diff --git a/gcc/config/sparc/t-openbsd b/gcc/config/sparc/t-openbsd
new file mode 100644
index 00000000000..898a24e079d
--- /dev/null
+++ b/gcc/config/sparc/t-openbsd
@@ -0,0 +1,5 @@
+# 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
diff --git a/gcc/config/t-libgcc-pic b/gcc/config/t-libgcc-pic
new file mode 100644
index 00000000000..ff935fe1e05
--- /dev/null
+++ b/gcc/config/t-libgcc-pic
@@ -0,0 +1,2 @@
+# Compile libgcc2.a with pic.
+TARGET_LIBGCC2_CFLAGS = -fPIC