brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | # This file gets passed to gyp with -I so that it gets included everywhere. |
| 2 | { |
| 3 | 'variables': { |
| 4 | 'AOS': '<(DEPTH)/aos', |
| 5 | # A directory with everything in it ignored from source control. |
| 6 | 'TMPDIR': '<(DEPTH)/aos/build/temp', |
| 7 | 'aos_abs': '<!(readlink -f <(DEPTH)/aos)', # for use in non-path contexts |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 8 | # The .gyp file that has targets for the various external libraries. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 9 | 'EXTERNALS': '<(AOS)/build/externals.gyp', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 10 | # The directory that gets rsynced to the target. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | 'rsync_dir': '<(PRODUCT_DIR)/outputs', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 12 | # The directory that executables that depend on <(EXTERNALS):gtest get put into. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 13 | 'test_dir': '<(PRODUCT_DIR)/tests', |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 14 | |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 15 | # Stuck into a variable (with a space on the end) to make disabling it easy. |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 16 | 'ccache': '<!(which ccache) ', |
Brian Silverman | 1294c08 | 2014-05-20 17:02:29 -0700 | [diff] [blame] | 17 | |
| 18 | 'disable_sanitizers': [ |
| 19 | # Bad alignment is just slow on x86 and traps on ARM, so we'll find |
| 20 | # it other ways, and some x86 code does it on purpose. |
| 21 | 'alignment', |
| 22 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 23 | }, |
| 24 | 'conditions': [ |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 25 | ['PLATFORM=="crio"', { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 26 | 'make_global_settings': [ |
Brian Silverman | a67ecc7 | 2013-09-28 13:53:53 -0700 | [diff] [blame] | 27 | ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'], |
| 28 | ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 29 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 30 | } |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 31 | ], ['PLATFORM=="linux-arm-gcc"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 32 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 33 | ['CC', '<(ccache)<!(which arm-linux-gnueabihf-gcc-4.7)'], |
| 34 | ['CXX', '<(ccache)<!(which arm-linux-gnueabihf-g++-4.7)'], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 35 | ], |
| 36 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 37 | ], ['PLATFORM=="linux-arm-clang"', { |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 38 | 'variables': { |
| 39 | 'arm-clang-symlinks': '<!(realpath -s <(AOS)/build/arm-clang-symlinks)', |
| 40 | 'arm-clang-sysroot': '<(arm-clang-symlinks)/sysroot', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 41 | # Flags that should be passed to all compile/link/etc commands. |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 42 | 'platflags': [ |
| 43 | '-target', 'armv7a-linux-gnueabihf', |
| 44 | '-mfloat-abi=hard', |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 45 | '--sysroot=<(arm-clang-sysroot)', |
| 46 | |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 47 | # TODO(brians): See if it will run with this enabled. |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 48 | #-mhwdiv=arm,thumb |
| 49 | ], |
| 50 | }, |
| 51 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 52 | ['CC', '<(ccache)<(arm-clang-symlinks)/bin/clang'], |
| 53 | ['CXX', '<(ccache)<(arm-clang-symlinks)/bin/clang++'], |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 54 | ], |
| 55 | 'target_defaults': { |
| 56 | 'cflags': [ |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 57 | '<@(platflags)', |
| 58 | ], |
Brian Silverman | 34d25f2 | 2014-05-01 13:30:56 -0700 | [diff] [blame] | 59 | 'cflags_cc': [ |
| 60 | '-isystem', '<(arm-clang-sysroot)/usr/include/c++/4.7.2', |
| 61 | '-isystem', '<(arm-clang-sysroot)/usr/include/c++/4.7.2/arm-linux-gnueabihf', |
| 62 | ], |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 63 | 'ldflags': [ |
| 64 | '<@(platflags)', |
| 65 | ], |
| 66 | }, |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 67 | }, |
| 68 | ], ['PLATFORM=="linux-amd64-clang"', { |
| 69 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 70 | ['CC', '<(ccache)/opt/clang-3.5/bin/clang'], |
| 71 | ['CXX', '<(ccache)/opt/clang-3.5/bin/clang++'], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 72 | ], |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 73 | }, |
| 74 | ], ['PLATFORM=="linux-amd64-gcc"', { |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 75 | 'make_global_settings': [ |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 76 | ['CC', '<(ccache)<!(which gcc-4.7)'], |
| 77 | ['CXX', '<(ccache)<!(which g++-4.7)'], |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 78 | ], |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 79 | }, |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 80 | ], ['PLATFORM=="linux-amd64-gcc_4.8"', { |
| 81 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 82 | ['CC', '<(ccache)/opt/clang-3.5/bin/gcc'], |
| 83 | ['CXX', '<(ccache)/opt/clang-3.5/bin/g++'], |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 84 | ], |
| 85 | }, |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 86 | ], ['SANITIZER!="none"', { |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 87 | 'target_defaults': { |
| 88 | 'cflags': [ |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 89 | '-fsanitize=<(SANITIZER)', |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 90 | ], |
| 91 | 'ldflags': [ |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 92 | '-fsanitize=<(SANITIZER)', |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 93 | ], |
Brian Silverman | 889f85e | 2014-09-05 11:39:09 -0400 | [diff] [blame] | 94 | 'defines': [ |
| 95 | # GCC doesn't have __has_feature, so we have to use this instead. |
| 96 | 'AOS_SANITIZER_<(SANITIZER)', |
| 97 | ], |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 98 | }, |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 99 | }, |
Brian Silverman | 1294c08 | 2014-05-20 17:02:29 -0700 | [diff] [blame] | 100 | ], ['SANITIZER!="none" and COMPILER!="gcc"', { |
| 101 | 'target_defaults': { |
| 102 | 'cflags': [ |
| 103 | '-fno-sanitize-recover', |
| 104 | '-fno-sanitize=<!(echo <(disable_sanitizers) | sed "s/ /,/g")', |
| 105 | ], |
| 106 | }, |
| 107 | }, |
Brian Silverman | 99895b9 | 2014-09-14 01:01:15 -0400 | [diff] [blame] | 108 | ], ['EXTERNALS_EXTRA=="-fPIE"', { |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 109 | 'target_defaults': { |
| 110 | 'cflags': [ |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 111 | '-fPIE', |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 112 | ], |
| 113 | 'ldflags': [ |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 114 | '-fPIE', |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 115 | ], |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 116 | 'link_settings': { |
| 117 | 'ldflags': [ |
| 118 | '-pie', |
| 119 | ], |
| 120 | }, |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 121 | }, |
| 122 | }, |
| 123 | ], ['SANITIZER=="memory"', { |
| 124 | 'target_defaults': { |
| 125 | 'cflags': [ |
| 126 | '-fsanitize-memory-track-origins', |
| 127 | ], |
| 128 | 'ldflags': [ |
| 129 | '-fsanitize-memory-track-origins', |
| 130 | ], |
| 131 | }, |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 132 | }, |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 133 | ], |
| 134 | ], |
| 135 | 'target_defaults': { |
| 136 | 'defines': [ |
| 137 | '__STDC_FORMAT_MACROS', |
Brian Silverman | 6137a50 | 2013-04-22 15:41:36 -0700 | [diff] [blame] | 138 | '__STDC_CONSTANT_MACROS', |
| 139 | '__STDC_LIMIT_MACROS', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 140 | ], |
| 141 | 'ldflags': [ |
| 142 | '-pipe', |
| 143 | ], |
| 144 | 'cflags': [ |
| 145 | '-pipe', |
| 146 | |
| 147 | '-Wall', |
| 148 | '-Wextra', |
| 149 | '-Wswitch-enum', |
| 150 | '-Wpointer-arith', |
| 151 | '-Wstrict-aliasing=2', |
| 152 | '-Wcast-qual', |
| 153 | '-Wcast-align', |
| 154 | '-Wwrite-strings', |
| 155 | '-Wtype-limits', |
| 156 | '-Wsign-compare', |
| 157 | '-Wformat=2', |
| 158 | '-Werror', |
Brian Silverman | 9ba2bc4 | 2013-03-17 14:18:33 -0700 | [diff] [blame] | 159 | |
| 160 | '-ggdb3', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 161 | ], |
| 162 | 'cflags_c': [ |
| 163 | '-std=gnu99', |
| 164 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 165 | 'include_dirs': [ |
| 166 | '<(DEPTH)', |
| 167 | ], |
Brian Silverman | d0a52dc | 2013-09-23 17:55:37 -0700 | [diff] [blame] | 168 | # These have to be here because apparently gyp evaluates target_conditions |
| 169 | # even if the target is never used. |
| 170 | 'variables': { |
| 171 | # Set this to 1 to disable rsyncing the file to the target. |
| 172 | 'no_rsync%': 0, |
Brian Silverman | 2a36ddb | 2014-04-08 17:07:28 -0700 | [diff] [blame] | 173 | # Set this to 1 if this file is a test that should not be run by |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 174 | # `build.py tests`. |
Brian Silverman | d0a52dc | 2013-09-23 17:55:37 -0700 | [diff] [blame] | 175 | 'is_special_test%': 0, |
| 176 | }, |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 177 | 'conditions': [ |
| 178 | ['DEBUG=="yes"', { |
Brian Silverman | aac705c | 2014-05-01 18:55:34 -0700 | [diff] [blame] | 179 | 'defines': [ |
| 180 | 'AOS_DEBUG=1', |
| 181 | ], |
Brian Silverman | 266811f | 2014-05-03 22:48:04 -0700 | [diff] [blame] | 182 | 'conditions': [['SANITIZER=="none"', { |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 183 | 'cflags': [ |
| 184 | '-O0', |
| 185 | ], |
| 186 | }, { |
| 187 | 'cflags': [ |
| 188 | '-O1', |
| 189 | ], |
| 190 | } |
| 191 | ]], |
| 192 | }, { # 'DEBUG=="no"' |
Brian Silverman | aac705c | 2014-05-01 18:55:34 -0700 | [diff] [blame] | 193 | 'defines': [ |
| 194 | 'AOS_DEBUG=0', |
Brian Silverman | 3b6d320 | 2014-09-14 01:01:54 -0400 | [diff] [blame^] | 195 | '_FORTIFY_SOURCE=2', |
Brian Silverman | aac705c | 2014-05-01 18:55:34 -0700 | [diff] [blame] | 196 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 197 | 'cflags': [ |
| 198 | '-O3', |
Brian Silverman | 2a36ddb | 2014-04-08 17:07:28 -0700 | [diff] [blame] | 199 | '-fomit-frame-pointer', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 200 | ], |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 201 | 'ldflags': [ |
| 202 | '-O3', |
| 203 | ], |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 204 | 'conditions': [['PLATFORM=="crio"', { |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 205 | # Copied from stuff that I think started with the supplied Makefiles. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 206 | 'cflags': [ |
| 207 | '-fstrength-reduce', |
| 208 | '-fno-builtin', |
| 209 | '-fno-strict-aliasing', |
| 210 | ], |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 211 | }], |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 212 | ['ARCHITECTURE=="arm"', { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 213 | 'cflags': [ |
Brian Silverman | c432132 | 2013-11-18 17:38:39 -0800 | [diff] [blame] | 214 | '-mcpu=cortex-a8', |
Brian Silverman | 4620361 | 2013-11-19 18:01:41 -0800 | [diff] [blame] | 215 | '-mfpu=neon', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 216 | ], |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 217 | }], |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 218 | ['ARCHITECTURE=="amd64"', { |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 219 | 'cflags': [ |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 220 | '-fstack-protector-all', |
| 221 | ], |
| 222 | }], |
| 223 | ] |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 224 | } |
| 225 | ], |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 226 | ['OS=="linux" and ARCHITECTURE=="arm" and COMPILER=="gcc" and DEBUG=="yes"', { |
Brian Silverman | 134e522 | 2014-04-27 20:10:05 -0700 | [diff] [blame] | 227 | 'cflags': [ |
| 228 | # GCC doesn't like letting us use r7 (which is also the frame |
| 229 | # pointer) to pass the syscall number to the kernel even when |
| 230 | # it's marked as clobbered. |
| 231 | # See <https://bugzilla.mozilla.org/show_bug.cgi?id=633436> for |
| 232 | # some more discussion. |
| 233 | '-fomit-frame-pointer', |
| 234 | ], |
| 235 | } |
| 236 | ], |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 237 | ['PLATFORM=="crio"', { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 238 | 'target_conditions': [ |
| 239 | ['_type=="shared_library"', { |
| 240 | 'ldflags': [ |
| 241 | '-r', |
| 242 | '-nostdlib', |
| 243 | '-Wl,-X', |
| 244 | ], |
| 245 | } |
| 246 | ], |
| 247 | ], |
| 248 | 'ldflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 249 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 250 | '-mstrict-align', |
| 251 | '-mlongcall', |
| 252 | ], |
| 253 | 'cflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 254 | # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both |
| 255 | # have MPC603e cores according to Freescale docs. |
| 256 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 257 | '-mstrict-align', |
| 258 | '-mlongcall', |
Brian Silverman | 823f324 | 2013-11-17 13:20:22 -0800 | [diff] [blame] | 259 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/', |
| 260 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/vxworks-6.3/target/h/', |
| 261 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/', |
| 262 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 263 | '-isystem', '<(WIND_BASE)/target/h', |
| 264 | '-isystem', '<(WIND_BASE)/target/h/wrn/coreip', |
| 265 | ], |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 266 | 'cflags_cc': [ |
| 267 | '-std=gnu++0x', |
| 268 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 269 | 'defines': [ |
| 270 | 'CPU=PPC603', |
| 271 | 'TOOL_FAMILY=gnu', |
| 272 | 'TOOL=gnu', |
| 273 | '_WRS_KERNEL', |
| 274 | '__PPC__', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 275 | # Prevent the vxworks system headers from being dumb and #defining min and max. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 276 | 'NOMINMAX', |
| 277 | ], |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 278 | }, { # 'PLATFORM!="crio"' |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 279 | 'target_conditions': [ |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 280 | # Default to putting outputs into rsync_dir. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 281 | ['no_rsync==0 and _type!="static_library"', { |
| 282 | 'product_dir': '<(rsync_dir)', |
| 283 | }, |
| 284 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 285 | ], |
| 286 | 'ldflags': [ |
| 287 | '-pthread', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 288 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 289 | 'cflags': [ |
| 290 | '-pthread', |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 291 | ], |
| 292 | 'cflags_cc': [ |
| 293 | '-std=gnu++11', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 294 | ], |
| 295 | 'defines': [ |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 296 | '_FILE_OFFSET_BITS=64', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 297 | ], |
| 298 | 'libraries': [ |
| 299 | '-lm', |
| 300 | '-lrt', |
| 301 | ], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 302 | 'conditions': [ |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 303 | ['COMPILER=="gcc"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 304 | 'cflags': [ |
| 305 | '-Wunused-local-typedefs', |
| 306 | ], |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 307 | 'defines': [ |
| 308 | '__has_feature(n)=0' |
| 309 | ], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 310 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 311 | ], ['COMPILER=="clang"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 312 | 'cflags': [ |
| 313 | '-fcolor-diagnostics', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 314 | '-fmessage-length=80', |
Brian Silverman | ad09fd7 | 2014-08-14 23:38:36 -0700 | [diff] [blame] | 315 | '-fmacro-backtrace-limit=0', |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 316 | ], |
| 317 | 'defines': [ |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 318 | # This tells clang's optimizer the same thing. |
Brian Silverman | bbeed50 | 2014-08-14 23:19:15 -0700 | [diff] [blame] | 319 | '__builtin_assume_aligned(p, a)=({ const typeof(p) my_p_ = (p); ((((uintptr_t)my_p_ % (a)) == 0u) ? my_p_ : (__builtin_unreachable(), (my_p_))); })', |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 320 | ], |
| 321 | }, |
| 322 | ], |
| 323 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 324 | } |
| 325 | ] |
| 326 | ], |
| 327 | }, |
| 328 | } |