summaryrefslogtreecommitdiff
path: root/gnu/egcs/gcc/gcc-local.1
blob: cfb37e69abee9c7bd501fd11bf209ff7781dabe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.\" $OpenBSD: gcc-local.1,v 1.10 2003/06/04 17:59:01 espie Exp $
.\"
.\" Copyright (c) 2002 Marc Espie
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd December 1, 2002
.Dt GCC-LOCAL 1
.Os
.Sh NAME
.Nm gcc-local
.Nd local modifications to gcc
.Sh DESCRIPTION
The
.Nm gcc
software comes with specific modifications for
.Ox .
.Bl -dash
.It
.Nm gcc
does not search under 
.Pa /usr/local
for include files nor for libraries:
as a system compiler, it only searches the system paths by default.
.It
On
.Ox ,
the 
.Fl pthread
option should be used to link threaded code, isolating the program from
operating system details.
.It
On most architectures,
trampoline code marks the smallest possible area around the trampoline stub 
executable using 
.Xr mprotect 2 ,
since the stack area is by default non-executable.
.It
The 
.Fl O2
option does not include 
.Fl fstrict-aliasing ,
as this option causes issues on some legacy code.
.Fl fstrict-aliasing
is very unsafe with code that plays tricks with casts, bypassing the 
already weak type system of C.
.It
The option
.Fl fno-builtin-<function>
was backported from 
.Nm gcc
version 3,
yielding greater control over what functions
.Nm gcc
inlines.
.It
.Nm gcc
recognizes the extra format attribute syslog, to better match
the definition of 
.Xr syslog 3 ,
and silence erroneous warnings when used with
.Fl pedantic .
.It
.Nm gcc
recognizes the extra attribute nonnull, which can be used to mark
arguments that can't be 
.Dv NULL .
On the other hand, the printf format attribute does not imply nonnull
for the format.
This allows for correct format checking on the
.Xr err 3
function family.
.It
.Nm gcc
recognizes the extra attribute sentinel, which can be used to mark varargs
function that need a
.Dv NULL
pointer to mark argument termination, like
.Xr execl 3 .
This exposes latent bugs for 64 bit architectures,
where a terminating 0 will expand to a 32 bit int, and not a full-fledged
64 bits pointer.
.It
On some
.Ox
platforms, 
.Nm gcc
still uses 
.Xr setjmp 3 /
.Xr longjmp 3 -
style exceptions, and so needs extra fixes beyond the pure 2.95.3 release.
.It
On some
platforms (mostly a.out),
.Nm gcc
uses a linker wrapper to write stubs that call global constructors and
destructors.
On
.Ox
those calls can be traced using
.Fl Wl,-trace-ctors-dtors ,
using
.Xr syslog_r 3 .
.It
On i386, the optimizer features an extra peephole which reduces the function
prologues enough to allow for the ramdisk to fit on one floppy.
.It
On
.Ox ,
.Nm gcc
comes with the
.Dq propolice
stack protection extension, which is enabled by default.
This extension reorders local variable declarations and adds stack consistency
checks at run time, in order to detect stack overflows, and will attempt to
report the problem in the system logs, and abort the faulting process.
It can be turned off using the
.Fl fno-stack-protector
commandline option.
Note that the stack protector relies on some support code in libc.
Stand-alone programs not linked against libc must either provide their own
support bits, or use the
.Fl fno-stack-protector
option.
.El
.Sh SEE ALSO
.Xr gcc 1 
.Pp
.Pa http://www.trl.ibm.com/projects/security/ssp