Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 117103
Collapse All | Expand All

(-)gcc-3.4.4.orig/gcc/config/i386/openbsdelf.h (+135 lines)
Line 0 Link Here
1
2
/* Configuration for an OpenBSD i386 target.
3
   
4
   Copyright (C) 1999 Free Software Foundation, Inc.
5
6
This file is part of GNU CC.
7
8
GNU CC is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2, or (at your option)
11
any later version.
12
13
GNU CC is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with GNU CC; see the file COPYING.  If not, write to
20
the Free Software Foundation, 59 Temple Place - Suite 330,
21
Boston, MA 02111-1307, USA.  */
22
23
/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
24
   libraries compiled with the native cc, so undef it. */
25
#undef NO_DOLLAR_IN_LABEL
26
27
/* Override the default comment-starter of "/".  */
28
#undef ASM_COMMENT_START
29
#define ASM_COMMENT_START "#"
30
31
32
/* This goes away when the math-emulator is fixed */
33
#undef TARGET_DEFAULT
34
#define TARGET_DEFAULT \
35
  (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
36
37
/* Run-time target specifications */
38
39
#define TARGET_OS_CPP_BUILTINS()		\
40
  do						\
41
    {						\
42
    	OPENBSD_OS_CPP_BUILTINS_ELF();		\
43
    }						\
44
  while (0)
45
46
/* As an elf system, we need crtbegin/crtend stuff.  */
47
#undef STARTFILE_SPEC
48
#define STARTFILE_SPEC "\
49
	%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
50
	crtbegin%O%s} %{shared:crtbeginS%O%s}"
51
#undef ENDFILE_SPEC
52
#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
53
54
/* Layout of source language data types.  */
55
56
/* This must agree with <machine/ansi.h> */
57
#undef SIZE_TYPE
58
#define SIZE_TYPE "unsigned int"
59
60
#undef PTRDIFF_TYPE
61
#define PTRDIFF_TYPE "int"
62
63
#undef WCHAR_TYPE
64
#define WCHAR_TYPE "int"
65
66
#undef WCHAR_TYPE_SIZE
67
#define WCHAR_TYPE_SIZE BITS_PER_WORD
68
69
/* Assembler format: overall framework.  */
70
71
#undef ASM_APP_ON
72
#define ASM_APP_ON "#APP\n"
73
74
#undef ASM_APP_OFF
75
#define ASM_APP_OFF "#NO_APP\n"
76
77
#undef SET_ASM_OP
78
#define SET_ASM_OP	"\t.set\t"
79
80
/* The following macros were originally stolen from i386v4.h.
81
   These have to be defined to get PIC code correct.  */
82
83
/* Assembler format: dispatch tables.  */
84
85
/* Assembler format: sections.  */
86
87
/* Stack & calling: aggregate returns.  */
88
89
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
90
   we want to retain compatibility with older gcc versions.  */
91
#define DEFAULT_PCC_STRUCT_RETURN 0
92
93
/* Assembler format: alignment output.  */
94
95
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
96
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
97
  if ((LOG) != 0) {\
98
    if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
99
    else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
100
  }
101
#endif
102
103
/* Stack & calling: profiling.  */
104
105
/* OpenBSD's profiler recovers all information from the stack pointer.
106
   The icky part is not here, but in machine/profile.h.  */
107
#undef FUNCTION_PROFILER
108
#define FUNCTION_PROFILER(FILE, LABELNO)  \
109
  fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
110
111
/* Assembler format: exception region output.  */
112
113
/* our configuration still doesn't handle dwarf2 correctly */
114
#define DWARF2_UNWIND_INFO 0
115
116
/* Assembler format: alignment output.  */
117
118
/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
119
120
/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
121
122
#undef LINK_SPEC
123
#define LINK_SPEC \
124
  "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
125
   %{shared:-shared} %{R*} \
126
   %{static:-Bstatic} \
127
   %{!static:-Bdynamic} \
128
   %{assert*} \
129
   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
130
131
#define OBSD_HAS_CORRECT_SPECS
132
133
/* pick up defines for mprotect (used in TRANSFER_FROM_TRANPOLINE) */
134
#include <sys/types.h>
135
#include <sys/mman.h>
(-)gcc-3.4.4.orig/gcc/config/openbsd.h (-9 / +37 lines)
Lines 52-66 Link Here
52
52
53
#ifdef OPENBSD_NATIVE
53
#ifdef OPENBSD_NATIVE
54
54
55
#undef GCC_INCLUDE_DIR
56
#define GCC_INCLUDE_DIR "/usr/include"
57
58
/* The compiler is configured with ONLY the gcc/g++ standard headers.  */
55
/* The compiler is configured with ONLY the gcc/g++ standard headers.  */
59
#undef INCLUDE_DEFAULTS
56
#undef INCLUDE_DEFAULTS
60
#define INCLUDE_DEFAULTS			\
57
#define INCLUDE_DEFAULTS			\
61
  {						\
58
  {						\
62
    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },	\
59
    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },	\
63
    { GCC_INCLUDE_DIR, "GCC", 0, 0 },		\
60
    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 }, \
61
    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 }, \
62
    { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 }, \
64
    { 0, 0, 0, 0 }				\
63
    { 0, 0, 0, 0 }				\
65
  }
64
  }
66
65
Lines 72-80 Link Here
72
71
73
72
74
/* Controlling the compilation driver.  */
73
/* Controlling the compilation driver.  */
74
/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets.  */
75
#define OPENBSD_OS_CPP_BUILTINS_COMMON()	\
76
  do						\
77
    {						\
78
      builtin_define ("__OpenBSD__");		\
79
      builtin_define ("__unix__");		\
80
      builtin_define ("__ANSI_COMPAT");		\
81
      builtin_assert ("system=unix");		\
82
      builtin_assert ("system=bsd");		\
83
      builtin_assert ("system=OpenBSD");	\
84
    }						\
85
  while (0)
86
87
/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD ELF targets.  */
88
#define OPENBSD_OS_CPP_BUILTINS_ELF()		\
89
  do						\
90
    {						\
91
      OPENBSD_OS_CPP_BUILTINS_COMMON();		\
92
      builtin_define ("__ELF__");		\
93
    }						\
94
  while (0)
95
96
/* TARGET_OS_CPP_BUILTINS() common to all LP64 OpenBSD targets.  */
97
#define OPENBSD_OS_CPP_BUILTINS_LP64()		\
98
  do						\
99
    {						\
100
      builtin_define ("_LP64");			\
101
      builtin_define ("__LP64__");		\
102
    }						\
103
  while (0)
75
104
76
/* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
105
/* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
77
   XXX the way threads are handling currently is not very satisfying,
106
   XXX the way threads are handled currently is not very satisfying,
78
   since all code must be compiled with -pthread to work. 
107
   since all code must be compiled with -pthread to work. 
79
   This two-stage defines makes it easy to pick that for targets that
108
   This two-stage defines makes it easy to pick that for targets that
80
   have subspecs.  */
109
   have subspecs.  */
Lines 84-93 Link Here
84
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
113
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
85
#endif
114
#endif
86
115
87
/* LIB_SPEC appropriate for OpenBSD.  Select the appropriate libc, 
116
/* LIB_SPEC appropriate for OpenBSD.  Include -lpthread if -pthread is
88
   depending on profiling and threads.  Basically, 
117
   specified on the command line. */
89
   -lc(_r)?(_p)?, select _r for threads, and _p for p or pg.  */
118
#define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
90
#define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
91
119
92
#ifndef OBSD_HAS_CORRECT_SPECS
120
#ifndef OBSD_HAS_CORRECT_SPECS
93
121
(-)gcc-3.4.4.orig/gcc/config/sparc/openbsd.h (-4 / +18 lines)
Lines 22-31 Link Here
22
#define TARGET_OS_CPP_BUILTINS()		\
22
#define TARGET_OS_CPP_BUILTINS()		\
23
  do						\
23
  do						\
24
    {						\
24
    {						\
25
	builtin_define ("__unix__");		\
25
      OPENBSD_OS_CPP_BUILTINS_ELF();		\
26
	builtin_define ("__OpenBSD__");		\
27
	builtin_assert ("system=unix");		\
28
	builtin_assert ("system=OpenBSD");	\
29
    }						\
26
    }						\
30
  while (0)
27
  while (0)
31
28
Lines 44-49 Link Here
44
#undef WCHAR_TYPE_SIZE
41
#undef WCHAR_TYPE_SIZE
45
#define WCHAR_TYPE_SIZE 32
42
#define WCHAR_TYPE_SIZE 32
46
43
44
#undef LINK_SPEC
45
#define LINK_SPEC \
46
  "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
47
   %{shared:-shared} %{R*} \
48
   %{static:-Bstatic} \
49
   %{!static:-Bdynamic} \
50
   %{assert*} \
51
   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
52
53
/* As an elf system, we need crtbegin/crtend stuff.  */
54
#undef STARTFILE_SPEC
55
#define STARTFILE_SPEC "\
56
	%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
57
	crtbegin%O%s} %{shared:crtbeginS%O%s}"
58
#undef ENDFILE_SPEC
59
#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
60
47
/* Specific options for DBX Output.  */
61
/* Specific options for DBX Output.  */
48
62
49
/* This is BSD, so it wants DBX format.  */
63
/* This is BSD, so it wants DBX format.  */
(-)gcc-3.4.4.orig/gcc/config.gcc (-6 / +7 lines)
Lines 971-981 Link Here
971
	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
971
	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
972
	;;
972
	;;
973
i[34567]86-*-openbsd*)
973
i[34567]86-*-openbsd*)
974
	tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
974
	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h"
975
	# needed to unconfuse gdb
975
	tm_file="${tm_file} openbsd.h i386/openbsdelf.h"
976
	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
976
	gas=yes
977
	# we need collect2 until our bug is fixed...
977
	gnu_ld=yes
978
	use_collect2=yes
978
	stabs=yes
979
	;;
979
	;;
980
i[34567]86-*-coff*)
980
i[34567]86-*-coff*)
981
	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
981
	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
Lines 2013-2019 Link Here
2013
	;;
2013
	;;
2014
sparc-*-openbsd*)
2014
sparc-*-openbsd*)
2015
	tm_defines=OBSD_OLD_GAS
2015
	tm_defines=OBSD_OLD_GAS
2016
	tm_file="sparc/sparc.h openbsd.h sparc/openbsd.h"
2016
	tm_file="sparc/sparc.h elfos.h svr4.h sparc/sysv4.h ${tm_file}"
2017
	tm_file="${tm_file} exec-stack.h"
2017
	# needed to unconfuse gdb
2018
	# needed to unconfuse gdb
2018
	tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
2019
	tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
2019
	# we need collect2 until our bug is fixed...
2020
	# we need collect2 until our bug is fixed...

Return to bug 117103