Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 { | 5 { |
| 6 'target_defaults': { | 6 'target_defaults': { |
| 7 'variables': { | 7 'variables': { |
| 8 'nacl_target': 0, | 8 'nacl_target': 0, |
| 9 }, | 9 }, |
| 10 'target_conditions': [ | 10 'target_conditions': [ |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 # would be if gyp were to really build properly for the host. | 229 # would be if gyp were to really build properly for the host. |
| 230 # TODO(bradnelson): Clean up with proper cross support. | 230 # TODO(bradnelson): Clean up with proper cross support. |
| 231 'conditions': [ | 231 'conditions': [ |
| 232 ['host_arch=="x64"', { | 232 ['host_arch=="x64"', { |
| 233 'cflags/': [['exclude', '-m.*']], | 233 'cflags/': [['exclude', '-m.*']], |
| 234 'ldflags/': [['exclude', '-m.*']], | 234 'ldflags/': [['exclude', '-m.*']], |
| 235 }], | 235 }], |
| 236 ], | 236 ], |
| 237 }, | 237 }, |
| 238 { | 238 { |
| 239 'target_name': 'nacl_helper_bootstrap_raw', | 239 'target_name': 'nacl_helper_bootstrap_lib', |
|
Roland McGrath
2011/09/07 17:21:17
This is a library not actually being used for anyt
Brad Chen
2011/09/07 19:05:40
Done.
| |
| 240 'type': 'executable', | 240 'type': 'static_library', |
| 241 'hard_depencency': 1, | |
| 241 'include_dirs': [ | 242 'include_dirs': [ |
| 242 '..', | 243 '..', |
| 243 ], | 244 ], |
| 244 'sources': [ | 245 'sources': [ |
| 245 'nacl/nacl_helper_bootstrap_linux.c', | 246 'nacl/nacl_helper_bootstrap_linux.c', |
|
Roland McGrath
2011/09/07 17:21:17
Putting the linker script here was on the recommen
Brad Chen
2011/09/07 19:05:40
The linker script is now an input dependency of th
| |
| 246 # We list the linker script here for documentation purposes. | |
| 247 # But even this doesn't make gyp treat it as a dependency, | |
| 248 # so incremental builds won't relink when the script changes. | |
| 249 # TODO(bradnelson): Fix the dependency handling. | |
| 250 'nacl/nacl_helper_bootstrap_linux.x', | |
| 251 ], | 247 ], |
| 252 'cflags': [ | 248 'cflags': [ |
| 253 # The tiny standalone bootstrap program is incompatible with | 249 # The tiny standalone bootstrap program is incompatible with |
| 254 # -fstack-protector, which might be on by default. That switch | 250 # -fstack-protector, which might be on by default. That switch |
| 255 # requires using the standard libc startup code, which we do not. | 251 # requires using the standard libc startup code, which we do not. |
| 256 '-fno-stack-protector', | 252 '-fno-stack-protector', |
| 257 # We don't want to compile it PIC (or its cousin PIE), because | 253 # We don't want to compile it PIC (or its cousin PIE), because |
| 258 # it goes at an absolute address anyway, and because any kind | 254 # it goes at an absolute address anyway, and because any kind |
| 259 # of PIC complicates life for the x86-32 assembly code. We | 255 # of PIC complicates life for the x86-32 assembly code. We |
| 260 # append -fno-* flags here instead of using a 'cflags!' stanza | 256 # append -fno-* flags here instead of using a 'cflags!' stanza |
| 261 # to remove -f* flags, just in case some system's compiler | 257 # to remove -f* flags, just in case some system's compiler |
| 262 # defaults to using PIC for everything. | 258 # defaults to using PIC for everything. |
| 263 '-fno-pic', '-fno-PIC', | 259 '-fno-pic', '-fno-PIC', |
| 264 '-fno-pie', '-fno-PIE', | 260 '-fno-pie', '-fno-PIE', |
| 265 ], | 261 ], |
| 266 'link_settings': { | 262 }, |
| 267 'ldflags': [ | 263 { |
| 268 # TODO(bradchen): Delete the -B argument when Gold is verified | 264 'target_name': 'nacl_helper_bootstrap_raw', |
| 269 # to produce good results with our custom linker script. | 265 'type': 'none', |
| 270 # Until then use ld.bfd. | 266 'dependencies': [ |
| 271 '-B', '<(PRODUCT_DIR)/../../tools/ld_bfd', | 267 'nacl_helper_bootstrap_lib', |
| 272 # This programs is (almost) entirely standalone. It has | 268 ], |
| 273 # its own startup code, so no crt1.o for it. It is | 269 'actions': [ |
| 274 # statically linked, and on x86 it actually does not use | 270 { |
| 275 # libc at all. However, on ARM it needs a few (safe) | 271 'action_name': 'link_with_ld_bfd', |
| 276 # things from libc, so we don't use '-nostdlib' here. | 272 'variables': { |
| 277 '-static', '-nostartfiles', | 273 # We list the linker script here for documentation purposes. |
| 278 # Link with our custom linker script to get out special layout. | 274 # But even this doesn't make gyp treat it as a dependency, |
| 279 '-Wl,--script=<(PRODUCT_DIR)/../../chrome/nacl/nacl_helper_bootstr ap_linux.x', | 275 # so incremental builds won't relink when the script changes. |
| 280 # On x86-64, the default page size with some | 276 # TODO(bradnelson): Fix the dependency handling. |
|
Roland McGrath
2011/09/07 17:21:17
This comment doesn't make any sense here.
Brad Chen
2011/09/07 19:05:40
Removed
On 2011/09/07 17:21:17, Roland McGrath wro
| |
| 281 # linkers is 2M rather than the real Linux page | 277 'nacl_bootstrap_linker_script': './nacl/nacl_helper_bootstrap_li nux.x', |
| 282 # size of 4K. A larger page size is incompatible | 278 }, |
| 283 # with our custom linker script's special layout. | 279 'inputs': [ |
| 284 '-Wl,-z,max-page-size=0x1000', | 280 '<(PRODUCT_DIR)/obj.target/nacl_helper_bootstrap_lib/chrome/nacl /nacl_helper_bootstrap_linux.o', |
|
Evan Martin
2011/09/07 17:14:00
This is hardcoding a private build path. It may w
Brad Chen
2011/09/07 19:05:40
With help from Brad Nelson I think I figured out h
| |
| 285 ], | 281 ], |
| 286 }, | 282 'outputs': [ |
| 283 '<(PRODUCT_DIR)/nacl_helper_bootstrap_raw', | |
| 284 ], | |
| 285 'message': 'Linking nacl_helper_bootstrap_raw', | |
| 286 'conditions': [ | |
| 287 ['target_arch=="x64"', { | |
| 288 'variables': { | |
| 289 'linker_emulation': 'elf_x86_64', | |
| 290 } | |
| 291 }], | |
| 292 ['target_arch=="ia32"', { | |
| 293 'variables': { | |
| 294 'linker_emulation': 'elf_i386', | |
| 295 } | |
| 296 }], | |
| 297 ['target_arch=="arm"', { | |
| 298 'variables': { | |
| 299 'linker_emulation': 'arm', | |
|
Roland McGrath
2011/09/07 17:21:17
This should be 'armelf_linux_eabi'.
Brad Chen
2011/09/07 19:05:40
Done.
| |
| 300 } | |
| 301 }], | |
| 302 ], | |
| 303 'action': ['../tools/ld_bfd/ld', | |
| 304 '-m', '<(linker_emulation)', | |
| 305 # This program is (almost) entirely standalone. It | |
| 306 # has its own startup code, so no crt1.o for it. It is | |
| 307 # statically linked, and on x86 it does not use | |
| 308 # libc at all. However, on ARM it needs a few (safe) | |
|
Roland McGrath
2011/09/07 17:21:17
This comment doesn't make sense here. There is no
Brad Chen
2011/09/07 19:05:40
I've revised it, removing the -nostdlib', so that
| |
| 309 # things from libc, so we don't use '-nostdlib' here. | |
| 310 '-static', | |
| 311 '-o', '<@(_outputs)', | |
| 312 # Link with custom linker script for special layout. | |
| 313 '--script=<(nacl_bootstrap_linker_script)', | |
| 314 # On x86-64, the default page size with some | |
| 315 # linkers is 2M rather than the real Linux page | |
| 316 # size of 4K. A larger page size is incompatible | |
| 317 # with our custom linker script's special layout. | |
| 318 '-z', 'max-page-size=0x1000', | |
| 319 '<@(_inputs)', | |
|
Roland McGrath
2011/09/07 17:21:17
For ARM it's necessary to add a '-lc' argument aft
Brad Chen
2011/09/07 19:05:40
Done.
| |
| 320 ], | |
| 321 } | |
| 322 ], | |
| 287 }, | 323 }, |
| 288 { | 324 { |
| 289 'target_name': 'nacl_helper_bootstrap', | 325 'target_name': 'nacl_helper_bootstrap', |
| 290 'dependencies': [ | 326 'dependencies': [ |
| 291 'nacl_helper_bootstrap_raw', | 327 'nacl_helper_bootstrap_raw', |
| 292 'nacl_helper_bootstrap_munge_phdr#host', | 328 'nacl_helper_bootstrap_munge_phdr#host', |
| 293 ], | 329 ], |
| 294 'type': 'none', | 330 'type': 'none', |
| 295 'actions': [{ | 331 'actions': [{ |
| 296 'action_name': 'munge_phdr', | 332 'action_name': 'munge_phdr', |
| 297 'inputs': ['nacl/nacl_helper_bootstrap_munge_phdr.py', | 333 'inputs': ['nacl/nacl_helper_bootstrap_munge_phdr.py', |
| 298 '<(PRODUCT_DIR)/nacl_helper_bootstrap_munge_phdr', | 334 '<(PRODUCT_DIR)/nacl_helper_bootstrap_munge_phdr', |
| 299 '<(PRODUCT_DIR)/nacl_helper_bootstrap_raw'], | 335 '<(PRODUCT_DIR)/nacl_helper_bootstrap_raw'], |
| 300 'outputs': ['<(PRODUCT_DIR)/nacl_helper_bootstrap'], | 336 'outputs': ['<(PRODUCT_DIR)/nacl_helper_bootstrap'], |
| 301 'message': 'Munging ELF program header', | 337 'message': 'Munging ELF program header', |
| 302 'action': ['python', '<@(_inputs)', '<@(_outputs)'] | 338 'action': ['python', '<@(_inputs)', '<@(_outputs)'] |
| 303 }], | 339 }], |
| 304 } | 340 }, |
| 305 ], | 341 ], |
| 306 }], | 342 }], |
| 307 ], | 343 ], |
| 308 } | 344 } |
| OLD | NEW |