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
|
.\" $OpenBSD: clang-local.1,v 1.5 2017/03/12 01:21:32 jsg Exp $
.\"
.\" Copyright (c) 2016 Pascal Stumpf <pascal@stumpf.co>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\"
.Dd $Mdocdate: March 12 2017 $
.Dt CLANG-LOCAL 1
.Os
.Sh NAME
.Nm clang-local
.Nd OpenBSD-specific behavior of LLVM/clang
.Sh DESCRIPTION
On
.Ox ,
the LLVM/clang compiler exhibits the following characteristics:
.Bl -dash
.It
.Nm clang
comes with stack protection enabled by default, equivalent to the
.Fl fstack-protector-strong
option on other systems.
The system will report any violation of the stack protector cookie along
with the function name via
.Xr syslog 3
at
.Dv LOG_CRIT
priority.
.It
.Nm clang
will generate PIE code by default, allowing the system to load the resulting
binary at a random location.
This behavior can be turned off by passing
.Fl fno-pie
to the compiler and
.Fl nopie
to the linker.
.It
The
.Fl fstrict-aliasing
option is turned off by default unless
.Fl Ofast
has been selected.
.It
The
.Fl pg
flag is an alias of
.Fl p .
.It
.Nm clang
does not warn for passing pointer arguments or assignment with
different signedness outside of
.Fl pedantic .
This can be
re-enabled with the
.Fl Wpointer-sign
flag.
.It
Color diagnostic messages are disabled by default and can be re-enabled with
.Fl fdiagnostics-color .
.El
.Sh SEE ALSO
.Xr clang 1
|