Browse Source

refactor: [gn] compile node with boringssl (#13285)

Jeremy Apthorp 6 years ago
parent
commit
c598272891
2 changed files with 14 additions and 1 deletions
  1. 5 1
      build/node/BUILD.gn
  2. 9 0
      build/node/node_override.gypi

+ 5 - 1
build/node/BUILD.gn

@@ -2,9 +2,12 @@ action("configure_node") {
   script = "//third_party/electron_node/configure"
   args = [
     "--enable-static",
-    "--openssl-no-asm",
     "--release-urlbase=https://atom.io/download/electron",
     "--shared",
+    "--shared-openssl",
+    "--shared-openssl-includes=" + rebase_path("//third_party/boringssl/src/include"),
+    "--shared-openssl-libname=boringssl",
+    "--shared-openssl-libpath=" + rebase_path(root_out_dir),
     "--without-npm",
     "--without-bundled-v8",
     "--without-dtrace",
@@ -57,6 +60,7 @@ action("gyp_node") {
 
 action("build_node") {
   deps = [
+    "//third_party/boringssl",
     "//third_party/icu",
     "//v8",
     "//v8:v8_libbase",

+ 9 - 0
build/node/node_override.gypi

@@ -26,6 +26,15 @@
           '../../../../../../libv8_libplatform.dylib',
           '../../../../../../libicuuc.dylib',
         ],
+        'defines': [
+          # These will no longer be necessary once
+          # https://github.com/google/boringssl/commit/a02ed04d527e1b57b4efaa0b4f9bdbc1ed5975b2
+          # is in the past for Electron
+          'EVP_CIPH_CCM_MODE=0',
+          'EVP_CIPH_WRAP_MODE=0',
+          'EVP_CIPHER_CTX_FLAG_WRAP_ALLOW=0',
+          'EVP_CIPHER_CTX_set_flags(...)',
+        ],
       }],
     ],
   },