OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 import("//build/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
| 7 import("//build/toolchain/toolchain.gni") |
7 import("//ppapi/native_client/nacl_test_data.gni") | 8 import("//ppapi/native_client/nacl_test_data.gni") |
8 | 9 |
9 group("nacl") { | 10 group("nacl") { |
10 newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}" | 11 newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}" |
11 pnacl = "//build/toolchain/nacl:newlib_pnacl" | 12 pnacl = "//build/toolchain/nacl:newlib_pnacl" |
12 data_deps = [ | 13 data_deps = [ |
13 ":exit_status_test($newlib)", | 14 ":exit_status_test($newlib)", |
14 ":exit_status_test($pnacl)", | 15 ":exit_status_test($pnacl)", |
15 ":extension_validation_cache($newlib)", | 16 ":extension_validation_cache($newlib)", |
16 ":irt_exception_test($newlib)", | 17 ":irt_exception_test($newlib)", |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 # Optimizers may translate the original code to code which | 547 # Optimizers may translate the original code to code which |
547 # requires builtin functions and/or relocations. Specifically, | 548 # requires builtin functions and/or relocations. Specifically, |
548 # the LLVM's optimizer translates for-loop based zero | 549 # the LLVM's optimizer translates for-loop based zero |
549 # clear to memset. | 550 # clear to memset. |
550 "-O0", | 551 "-O0", |
551 | 552 |
552 # ARM GCC emits symbols like __aeabi_unwind_cpp_pr0 in | 553 # ARM GCC emits symbols like __aeabi_unwind_cpp_pr0 in |
553 # .exidx sections without this flag. | 554 # .exidx sections without this flag. |
554 "-fno-unwind-tables", | 555 "-fno-unwind-tables", |
555 ] | 556 ] |
| 557 |
| 558 # Workaround against LLVM bug. |
| 559 # In short, an LTO optimization pass might recognize |
| 560 # naive implementations of builtins (such as memset) |
| 561 # and replace them with references to the real builtins, |
| 562 # which, in the case of -nostdlib, might cause the binary |
| 563 # to get undefined references to those symbols. |
| 564 # |
| 565 # See more details: |
| 566 # https://llvm.org/bugs/show_bug.cgi?id=30403 |
| 567 if (use_thin_lto) { |
| 568 ldflags = [ "-Wl,-plugin-opt,O0" ] |
| 569 } |
556 } | 570 } |
557 | 571 |
558 executable("nonsfi_libc_free_nexe") { | 572 executable("nonsfi_libc_free_nexe") { |
559 output_name = "libc_free_$arch" | 573 output_name = "libc_free_$arch" |
560 output_extension = "nexe" | 574 output_extension = "nexe" |
561 sources = [ | 575 sources = [ |
562 "nonsfi/libc_free.c", | 576 "nonsfi/libc_free.c", |
563 ] | 577 ] |
564 | 578 |
565 # Here, we would like to link a relocatable, libc-free executable. | 579 # Here, we would like to link a relocatable, libc-free executable. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 "nonsfi/libc_free.nmf", | 619 "nonsfi/libc_free.nmf", |
606 ] | 620 ] |
607 outputs = [ | 621 outputs = [ |
608 "${root_build_dir}/nacl_test_data/libc-free/{{source_file_part}}", | 622 "${root_build_dir}/nacl_test_data/libc-free/{{source_file_part}}", |
609 ] | 623 ] |
610 deps = [ | 624 deps = [ |
611 ":nonsfi_libc_free_nexe", | 625 ":nonsfi_libc_free_nexe", |
612 ] | 626 ] |
613 } | 627 } |
614 } | 628 } |
OLD | NEW |