forked from rpwoodbu/mosh-chrome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCROSSTOOL
177 lines (150 loc) · 6.48 KB
/
CROSSTOOL
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# This file is largely cargo-culted from:
# https://github.com/bazelbuild/bazel.git
# bazel/tools/cpp/CROSSTOOL
# commit 6b6ff76945c80fb8b11b71d402b5146c85b86859
major_version: "pnacl"
minor_version: ""
default_target_cpu: "pnacl"
default_toolchain {
cpu: "pnacl"
toolchain_identifier: "clang_pnacl"
}
# Based heavily on the "local_linux" toolchain from the file mentioned at the
# top.
toolchain {
abi_version: "pnacl"
abi_libc_version: "pnacl"
builtin_sysroot: ""
compiler: "clang"
host_system_name: "local"
needsPic: true
supports_gold_linker: false
supports_incremental_linker: false
supports_fission: false
supports_interface_shared_objects: false
supports_normalizing_ar: false
supports_start_end_lib: false
supports_thin_archives: false
target_libc: "pnacl"
target_cpu: "pnacl"
target_system_name: "pnacl"
toolchain_identifier: "clang_pnacl"
tool_path { name: "ar" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-ar" }
tool_path { name: "compat-ld" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-ld" }
#tool_path { name: "cpp" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-cpp" }
tool_path { name: "cpp" path: "/bin/false" }
#tool_path { name: "dwp" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-dwp" }
tool_path { name: "gcc" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-clang" }
cxx_flag: "-std=gnu++11"
linker_flag: "-lc++"
linker_flag: "-Bexternal/nacl_sdk/toolchain/linux_pnacl/bin"
# The compiler in the NaCl SDK doesn't support the flags necessary to do
# strict dependency enforcement (i.e., -no-canonical-prefixes and
# -fno-canonical-system-headers). So effectively disable the feature in this
# manner:
cxx_builtin_include_directory: "/"
# For reference, here's a path that we would ordinarily want to include:
#cxx_builtin_include_directory: "external/nacl_sdk/toolchain/linux_pnacl/lib"
#tool_path { name: "gcov" path: "/usr/bin/gcov" }
tool_path { name: "gcov" path: "/bin/false" }
# C(++) compiles invoke the compiler (as that is the one knowing where
# to find libraries), but we provide LD so other rules can invoke the linker.
tool_path { name: "ld" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-ld" }
tool_path { name: "nm" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-nm" }
#tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
#objcopy_embed_flag: "-I"
#objcopy_embed_flag: "binary"
#tool_path { name: "objdump" path: "/usr/bin/objdump" }
tool_path { name: "objdump" path: "/bin/false" }
tool_path { name: "strip" path: "external/nacl_sdk/toolchain/linux_pnacl/bin/pnacl-strip" }
# Anticipated future default. (But NaCl SDK doesn't support them.)
#unfiltered_cxx_flag: "-no-canonical-prefixes"
#unfiltered_cxx_flag: "-fno-canonical-system-headers"
# Make C++ compilation deterministic. Use linkstamping instead of these
# compiler symbols.
unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
# The toolchain's includes.
compiler_flag: "-isystem"
compiler_flag: "external/nacl_sdk/include/pnacl"
# Security hardening on by default.
# Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
# We need to undef it before redefining it as some distributions now have
# it enabled by default.
compiler_flag: "-U_FORTIFY_SOURCE"
compiler_flag: "-D_FORTIFY_SOURCE=1"
compiler_flag: "-fstack-protector"
#linker_flag: "-Wl,-z,relro,-z,now"
# Enable coloring even if there's no attached terminal. Bazel removes the
# escape sequences if --nocolor is specified. This isn't supported by gcc
# on Ubuntu 14.04.
# compiler_flag: "-fcolor-diagnostics"
# All warnings are enabled.
compiler_flag: "-Wall"
# All warnings are errors.
compiler_flag: "-Werror"
# Would be nice to enable this warning, but then protobufs won't build.
#compiler_flag: "-Wunused-parameter"
# But disable some that are problematic.
#compiler_flag: "-Wno-free-nonheap-object" # has false positives
# Keep stack frames for debugging, even in opt mode.
compiler_flag: "-fno-omit-frame-pointer"
# Anticipated future default.
#linker_flag: "-no-canonical-prefixes"
# Have gcc return the exit code from ld.
#linker_flag: "-pass-exit-codes"
# Stamp the binary with a unique identifier.
# Gold linker only? Can we enable this by default?
# linker_flag: "-Wl,--warn-execstack"
# linker_flag: "-Wl,--detect-odr-violations"
# Mosh for Chrome overrides many low-level calls. If the compiler elides
# those calls, they can't be overridden.
compiler_flag: "-fno-builtin"
compilation_mode_flags {
mode: DBG
# Enable debug symbols.
compiler_flag: "-g"
}
compilation_mode_flags {
mode: FASTBUILD
# See description for this flag in OPT mode.
# TODO: Remove this once exceptions are fully supported by PNaCl.
# NB: Remove this in OPT mode as well.
linker_flag: "--pnacl-exceptions=sjlj"
}
compilation_mode_flags {
mode: OPT
# No debug symbols.
# Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
# even generally? However, that can't happen here, as it requires special
# handling in Bazel.
compiler_flag: "-g0"
# Conservative choice for -O
# -O3 can increase binary size and even slow down the resulting binaries.
# Profile first and / or use FDO if you need better performance than this.
compiler_flag: "-O2"
# Also enable link-time optimizations.
linker_flag: "-O2"
# Disable assertions
# TODO: For some reason, this flag causes the ssh password prompt not to
# show, and sometimes ssh login will crash! How strange.
#compiler_flag: "-DNDEBUG"
# Exceptions are not supported well by PNaCl. Use set-jump/long-jump (not
# very efficient, but works).
#
# We don't do this in debug mode, as it seems to upset the debugger to the
# point of being useless. Exceptions will therefore abort() in debug
# builds, unfortunately.
#
# TODO: Remove this once exceptions are fully supported by PNaCl.
# NB: Remove this in FASTBUILD mode as well.
linker_flag: "--pnacl-exceptions=sjlj"
# Removal of unused code and data at link time (can this increase binary size in some cases?).
compiler_flag: "-ffunction-sections"
compiler_flag: "-fdata-sections"
linker_flag: "-Wl,--gc-sections"
}
linking_mode_flags { mode: FULLY_STATIC }
}