From 986b05cb9ec3ad0fab27c9fb094d4a6ec9332ccd Mon Sep 17 00:00:00 2001 From: dpranke Date: Wed, 25 Feb 2015 19:30:58 -0800 Subject: [PATCH] Land prep work to enable NaCl in the Linux x64 GN builds. This should get most of NaCl and the PPAPI stuff needed for NaCl building and linking. There is more work to be done to get some of the test binaries working (and probably fill out parts of the NaCl SDK) and possibly some pnacl support work remaining as well. NaCl is still disabled by default (set enable_nacl=true to change). Enabling nacl is still mostly untested and likely doesn't work at all :). R=ncbray@chromium.org, brettw@chromium.org BUG=432959 CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:android_chromium_gn_compile_dbg,android_chromium_gn_compile_rel;tryserver.chromium.win:win8_chromium_gn_rel,win8_chromium_gn_dbg;tryserver.chromium.mac:mac_chromium_gn_rel,mac_chromium_gn_dbg Review URL: https://codereview.chromium.org/877553008 Cr-Original-Commit-Position: refs/heads/master@{#318180} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 6065cf751340a8a99b670357b2053ed6df12a7af --- config/BUILDCONFIG.gn | 6 ++++++ config/features.gni | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn index a554f12dc..7c06e5934 100644 --- a/config/BUILDCONFIG.gn +++ b/config/BUILDCONFIG.gn @@ -548,6 +548,12 @@ if (is_win) { } else if (is_ios) { host_toolchain = "//build/toolchain/mac:host_clang" set_default_toolchain("//build/toolchain/mac:clang") +} else if (is_nacl) { + # TODO(GYP): This will need to change when we get NaCl working + # on multiple platforms, but this whole block of code (how we define + # host_toolchain) needs to be reworked regardless to key off of build_os + # and build_cpu_arch rather than the is_* variables. + host_toolchain = "//build/toolchain/linux:clang_x64" } # ============================================================================== diff --git a/config/features.gni b/config/features.gni index 5477674cc..5ee92f77f 100644 --- a/config/features.gni +++ b/config/features.gni @@ -22,9 +22,20 @@ declare_args() { enable_plugins = !is_android && !is_ios # Enables Native Client support. - # TODO(GYP) enable this when nacl works in GN. + # TODO(GYP): Get NaCl linking on other platforms. + # Also, see if we can always get rid of enable_nacl_untrusted and + # enable_pnacl and always build them if enable_nacl is true. + # The "is_nacl" part of the condition is needed to ensure that + # the untrusted code is built properly; arguably it should be + # guarded by "is_nacl" directly rather than enable_nacl_untrusted, but + # this will go away when Mac and Win are working and we can just use + # the commented out logic. + # enable_nacl = !is_ios && !is_android + # Currently this *should* work: + # enable_nacl = (is_linux && build_cpu_arch == "x64") || is_nacl enable_nacl = false - #enable_nacl = (!is_ios && !is_android) + enable_nacl_untrusted = enable_nacl + enable_pnacl = enable_nacl_untrusted # If debug_devtools is set to true, JavaScript files for DevTools are stored # as is and loaded from disk. Otherwise, a concatenated file is stored in