aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/openbsd.h
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2001-07-13 18:12:22 +0000
committerMarc Espie <espie@gcc.gnu.org>2001-07-13 18:12:22 +0000
commitf1cf4606f967d6cd202d2157e43a25ab4af2bb00 (patch)
tree85a550762d0c195f69d066c9199eb145b33ed9ab /gcc/config/openbsd.h
parent998d20d22a7632ac162773c0561bc8cd6f269f26 (diff)
downloadgcc-f1cf4606f967d6cd202d2157e43a25ab4af2bb00.zip
gcc-f1cf4606f967d6cd202d2157e43a25ab4af2bb00.tar.gz
gcc-f1cf4606f967d6cd202d2157e43a25ab4af2bb00.tar.bz2
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
Diffstat (limited to 'gcc/config/openbsd.h')
-rw-r--r--gcc/config/openbsd.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
index 87b3a60..ff1c1ad 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