OLD | NEW |
1 # Copyright 2015 The Native Client Authors. All rights reserved. | 1 # Copyright 2015 The Native Client 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 | 7 |
8 # Generate a nmf file | 8 # Generate a nmf file |
9 # | 9 # |
10 # Native Client Manifest (nmf) is a JSON file that tells the browser where to | 10 # Native Client Manifest (nmf) is a JSON file that tells the browser where to |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 lib_path = root_build_dir | 67 lib_path = root_build_dir |
68 } | 68 } |
69 if (defined(lib_prefix)) { | 69 if (defined(lib_prefix)) { |
70 nmfflags += [ "--lib-prefix=" + lib_prefix ] | 70 nmfflags += [ "--lib-prefix=" + lib_prefix ] |
71 lib_path += "/${lib_prefix}" | 71 lib_path += "/${lib_prefix}" |
72 } | 72 } |
73 | 73 |
74 # Starts empty so the code below can use += everywhere. | 74 # Starts empty so the code below can use += everywhere. |
75 data = [] | 75 data = [] |
76 | 76 |
77 nmfflags += [ "--library-path=" + rebase_path(root_out_dir) ] | 77 nmfflags += |
| 78 [ "--library-path=" + rebase_path(root_out_dir, root_build_dir) ] |
78 | 79 |
79 # NOTE: There is no explicit dependency for the lib directory | 80 # NOTE: There is no explicit dependency for the lib directory |
80 # (lib32 and lib64 for x86/x64) created in the product directory. | 81 # (lib32 and lib64 for x86/x64) created in the product directory. |
81 # They are created as a side-effect of nmf creation. | 82 # They are created as a side-effect of nmf creation. |
82 if (current_cpu != "x86" && current_cpu != "x64") { | 83 if (current_cpu != "x86" && current_cpu != "x64") { |
83 nmfflags += | 84 nmfflags += |
84 [ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ] | 85 [ "--library-path=" + |
| 86 rebase_path("${nacl_toolchain_tooldir}/lib", root_build_dir) ] |
85 if (current_cpu == "arm") { | 87 if (current_cpu == "arm") { |
86 data += [ "${lib_path}/libarm/" ] | 88 data += [ "${lib_path}/libarm/" ] |
87 } else { | 89 } else { |
88 data += [ "${lib_path}/lib/" ] | 90 data += [ "${lib_path}/lib/" ] |
89 } | 91 } |
90 } else { | 92 } else { |
91 # For x86-32, the lib/ directory is called lib32/ instead. | 93 # For x86-32, the lib/ directory is called lib32/ instead. |
92 if (current_cpu == "x86") { | 94 if (current_cpu == "x86") { |
93 nmfflags += [ "--library-path=" + | 95 nmfflags += |
94 rebase_path("${nacl_toolchain_tooldir}/lib32") ] | 96 [ "--library-path=" + |
| 97 rebase_path("${nacl_toolchain_tooldir}/lib32", root_build_dir) ] |
95 data += [ "${lib_path}/lib32/" ] | 98 data += [ "${lib_path}/lib32/" ] |
96 } | 99 } |
97 | 100 |
98 # x86-32 Windows needs to build both x86-32 and x86-64 NaCl | 101 # x86-32 Windows needs to build both x86-32 and x86-64 NaCl |
99 # binaries into the same nmf covering both architectures. That | 102 # binaries into the same nmf covering both architectures. That |
100 # gets handled at a higher level (see the nacl_test_data template), | 103 # gets handled at a higher level (see the nacl_test_data template), |
101 # so a single generate_nmf invocation gets both x86-32 and x86-64 | 104 # so a single generate_nmf invocation gets both x86-32 and x86-64 |
102 # nexes listed in executables. | 105 # nexes listed in executables. |
103 if (current_cpu == "x64" || target_os == "win") { | 106 if (current_cpu == "x64" || target_os == "win") { |
104 # For x86-64, the lib/ directory is called lib64/ instead | 107 # For x86-64, the lib/ directory is called lib64/ instead |
105 # when copied by create_nmf.py. | 108 # when copied by create_nmf.py. |
106 glibc_tc = "//build/toolchain/nacl:glibc" | 109 glibc_tc = "//build/toolchain/nacl:glibc" |
107 assert(current_toolchain == "${glibc_tc}_${current_cpu}") | 110 assert(current_toolchain == "${glibc_tc}_${current_cpu}") |
108 if (current_cpu == "x64") { | 111 if (current_cpu == "x64") { |
109 x64_out_dir = root_out_dir | 112 x64_out_dir = root_out_dir |
110 } else { | 113 } else { |
111 x64_out_dir = get_label_info(":${target_name}(${glibc_tc}_x64)", | 114 x64_out_dir = get_label_info(":${target_name}(${glibc_tc}_x64)", |
112 "root_out_dir") | 115 "root_out_dir") |
113 } | 116 } |
114 nmfflags += [ | 117 nmfflags += [ |
115 "--library-path=" + rebase_path(x64_out_dir), | 118 "--library-path=" + rebase_path(x64_out_dir, root_build_dir), |
116 "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib"), | 119 "--library-path=" + |
| 120 rebase_path("${nacl_toolchain_tooldir}/lib", root_build_dir), |
117 ] | 121 ] |
118 data += [ "${lib_path}/lib64/" ] | 122 data += [ "${lib_path}/lib64/" ] |
119 } | 123 } |
120 } | 124 } |
121 } | 125 } |
122 args = [ | 126 args = [ |
123 "--no-default-libpath", | 127 "--no-default-libpath", |
124 "--objdump=" + objdump, | 128 "--objdump=" + rebase_path(objdump, root_build_dir), |
125 "--output=" + rebase_path(nmf, root_build_dir), | 129 "--output=" + rebase_path(nmf, root_build_dir), |
126 ] + nmfflags + rebase_path(sources, root_build_dir) | 130 ] + nmfflags + rebase_path(sources, root_build_dir) |
127 if (is_nacl_glibc && current_cpu == "arm") { | 131 if (is_nacl_glibc && current_cpu == "arm") { |
128 deps += [ "//native_client/src/untrusted/elf_loader:elf_loader" ] | 132 deps += [ "//native_client/src/untrusted/elf_loader:elf_loader" ] |
129 } | 133 } |
130 } | 134 } |
131 } | 135 } |
132 | 136 |
133 # Generate a nmf file for Non-SFI tests | 137 # Generate a nmf file for Non-SFI tests |
134 # | 138 # |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 args = [ | 180 args = [ |
177 "--program=" + rebase_path(executable, root_build_dir), | 181 "--program=" + rebase_path(executable, root_build_dir), |
178 "--arch=${arch}", | 182 "--arch=${arch}", |
179 "--output=" + rebase_path(nmf, root_build_dir), | 183 "--output=" + rebase_path(nmf, root_build_dir), |
180 ] | 184 ] |
181 if (defined(invoker.nmfflags)) { | 185 if (defined(invoker.nmfflags)) { |
182 args += invoker.nmfflags | 186 args += invoker.nmfflags |
183 } | 187 } |
184 } | 188 } |
185 } | 189 } |
OLD | NEW |