xref: /openbsd-src/share/man/man1/clang-local.1 (revision ae3cb403620ab940fbaabb3055fac045a63d56b7)
1.\" $OpenBSD: clang-local.1,v 1.11 2017/10/05 15:13:43 jmc Exp $
2.\"
3.\" Copyright (c) 2016 Pascal Stumpf <pascal@stumpf.co>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.\"
18.Dd $Mdocdate: October 5 2017 $
19.Dt CLANG-LOCAL 1
20.Os
21.Sh NAME
22.Nm clang-local
23.Nd OpenBSD-specific behavior of LLVM/clang
24.Sh DESCRIPTION
25On
26.Ox ,
27the LLVM/clang compiler exhibits the following characteristics:
28.Bl -dash
29.It
30.Nm clang
31does not search under
32.Pa /usr/local
33for include files or libraries:
34as a system compiler, it only searches the system paths by default.
35.It
36.Nm clang
37comes with stack protection enabled by default, equivalent to the
38.Fl fstack-protector-strong
39option on other systems.
40The system will report any violation of the stack protector cookie along
41with the function name via
42.Xr syslog 3
43at
44.Dv LOG_CRIT
45priority.
46.It
47.Nm clang
48will generate PIE code by default, allowing the system to load the resulting
49binary at a random location.
50This behavior can be turned off by passing
51.Fl fno-pie
52to the compiler and
53.Fl nopie
54to the linker.
55.It
56The
57.Fl fstrict-aliasing
58option is turned off by default unless
59.Fl Ofast
60has been selected.
61.It
62.Nm clang
63does not store its version string in objects.
64There is no option to control this.
65.It
66The
67.Fl pg
68flag is an alias of
69.Fl p .
70.It
71.Nm clang
72does not warn for passing pointer arguments or assignment with
73different signedness outside of
74.Fl pedantic .
75This can be
76re-enabled with the
77.Fl Wpointer-sign
78flag.
79.It
80The warning option
81.Fl Waddress-of-packed-member
82is disabled by default.
83.It
84Color diagnostic messages are disabled by default and can be re-enabled with
85.Fl fdiagnostics-color .
86.It
87The
88.Fl fwrapv
89option to treat signed integer overflows as defined is enabled by default to
90prevent dangerous optimizations which could remove security critical overflow
91checks.
92.It
93The
94.Xr malloc 3 ,
95.Xr calloc 3 ,
96.Xr realloc 3 ,
97.Xr strdup 3 ,
98.Xr strndup 3 ,
99.Xr valloc 3
100and
101.Xr free 3
102builtins are disabled to prevent undesirable optimizations of calls to
103these functions.
104.El
105.Sh SEE ALSO
106.Xr clang 1
107