Index: build/config/nacl/rules.gni |
diff --git a/build/config/nacl/rules.gni b/build/config/nacl/rules.gni |
index bfc3ec3b8f63642eef20246c26dc5182500a9c74..0d6d03640a3de8586de2fdef6cca10a53d611d7d 100644 |
--- a/build/config/nacl/rules.gni |
+++ b/build/config/nacl/rules.gni |
@@ -71,28 +71,48 @@ template("generate_nmf") { |
lib_path += "/${lib_prefix}" |
} |
- # NOTE: There is no explicit dependency for the lib32 |
- # and lib64 directories created in the product directory. |
- # They are created as a side-effect of nmf creation. |
+ # Starts empty so the code below can use += everywhere. |
+ data = [] |
+ |
nmfflags += [ "--library-path=" + rebase_path(root_out_dir) ] |
- if (current_cpu == "x86") { |
- nmfflags += [ "--library-path=" + |
- rebase_path("${nacl_toolchain_tooldir}/lib32") ] |
- data = [ |
- "${lib_path}/lib32/", |
- ] |
- } else if (current_cpu == "x64") { |
+ |
+ # NOTE: There is no explicit dependency for the lib directory |
+ # (lib32 and lib64 for x86/x64) created in the product directory. |
+ # They are created as a side-effect of nmf creation. |
+ if (current_cpu != "x86" && current_cpu != "x64") { |
nmfflags += |
[ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ] |
- data = [ |
- "${lib_path}/lib64/", |
- ] |
+ data += [ "${lib_path}/lib/" ] |
} else { |
- nmfflags += |
- [ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ] |
- data = [ |
- "${lib_path}/lib/", |
- ] |
+ # For x86-32, the lib/ directory is called lib32/ instead. |
+ if (current_cpu == "x86") { |
+ nmfflags += [ "--library-path=" + |
+ rebase_path("${nacl_toolchain_tooldir}/lib32") ] |
+ data += [ "${lib_path}/lib32/" ] |
+ } |
+ |
+ # x86-32 Windows needs to build both x86-32 and x86-64 NaCl |
+ # binaries into the same nmf covering both architectures. That |
+ # gets handled at a higher level (see the nacl_test_data template), |
+ # so a single generate_nmf invocation gets both x86-32 and x86-64 |
+ # nexes listed in executables. |
+ if (current_cpu == "x64" || target_os == "win") { |
+ # For x86-64, the lib/ directory is called lib64/ instead |
+ # when copied by create_nmf.py. |
+ glibc_tc = "//build/toolchain/nacl:glibc" |
+ assert(current_toolchain == "${glibc_tc}_${current_cpu}") |
+ if (current_cpu == "x64") { |
+ x64_out_dir = root_out_dir |
+ } else { |
+ x64_out_dir = get_label_info(":${target_name}(${glibc_tc}_x64)", |
+ "root_out_dir") |
+ } |
+ nmfflags += [ |
+ "--library-path=" + rebase_path(x64_out_dir), |
+ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib"), |
+ ] |
+ data += [ "${lib_path}/lib64/" ] |
+ } |
} |
} |
args = [ |