Index: build/config/nacl/rules.gni |
diff --git a/build/config/nacl/rules.gni b/build/config/nacl/rules.gni |
index bfc3ec3b8f63642eef20246c26dc5182500a9c74..e28343f81aee0b791ee9e6670d43cee36d518cb9 100644 |
--- a/build/config/nacl/rules.gni |
+++ b/build/config/nacl/rules.gni |
@@ -71,25 +71,35 @@ template("generate_nmf") { |
lib_path += "/${lib_prefix}" |
} |
- # NOTE: There is no explicit dependency for the lib32 |
- # and lib64 directories created in the product directory. |
+ # 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. |
- 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/", |
+ if (current_cpu == "x86" || current_cpu == "x64") { |
+ # For x86, include both x86-32 and x86-64 library directories |
+ # so that a single generate_nmf invocation with both x86-32 |
+ # and x86-64 nexes listed in executables works to generate one |
+ # nmf covering both architectures. |
+ glibc_tc = "//build/toolchain/nacl:glibc" |
+ assert(current_toolchain == "${glibc_tc}_${current_cpu}") |
+ x86_out_dir = |
+ get_label_info(":${target_name}(${glibc_tc}_x86)", "root_out_dir") |
+ x64_out_dir = |
+ get_label_info(":${target_name}(${glibc_tc}_x64)", "root_out_dir") |
+ nmfflags += [ |
+ "--library-path=" + rebase_path(x86_out_dir), |
+ "--library-path=" + rebase_path(x64_out_dir), |
+ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib32"), |
+ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib"), |
] |
- } else if (current_cpu == "x64") { |
- nmfflags += |
- [ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ] |
data = [ |
+ "${lib_path}/lib32/", |
"${lib_path}/lib64/", |
] |
} else { |
- nmfflags += |
- [ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ] |
+ nmfflags += [ |
+ "--library-path=" + rebase_path(root_out_dir), |
Petr Hosek
2016/05/12 22:08:26
Was this a bug?
Roland McGrath
2016/05/12 22:29:59
Previously this was done above, before this 'if' b
|
+ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib"), |
+ ] |
data = [ |
"${lib_path}/lib/", |
] |