Skip to content

Commit fdd11bc

Browse files
authored
deps, src: simplifying base64 encoding
nodejs/node#52714
1 parent 8dfa030 commit fdd11bc

1 file changed

Lines changed: 1 addition & 80 deletions

File tree

patches/node/build_add_gn_build_files.patch

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ diff --git a/BUILD.gn b/BUILD.gn
1414
index 1ed186b597eece7c34cb69c8e1e20870555a040d..2ce1e8a7dcca2ba153d387d11970c72b5f43c167 100644
1515
--- a/BUILD.gn
1616
+++ b/BUILD.gn
17-
@@ -1,14 +1,406 @@
17+
@@ -1,14 +1,405 @@
1818
-##############################################################################
1919
-# #
2020
-# DO NOT EDIT THIS FILE! #
@@ -284,7 +284,6 @@ index 1ed186b597eece7c34cb69c8e1e20870555a040d..2ce1e8a7dcca2ba153d387d11970c72b
284284
+ ":node_js2c_exec",
285285
+ "deps/googletest:gtest",
286286
+ "deps/ada",
287-
+ "deps/base64",
288287
+ "deps/simdutf",
289288
+ "deps/uvwasi",
290289
+ "//third_party/zlib",
@@ -458,84 +457,6 @@ index e92ac3a3beac143dced2efb05304ed8ba832b067..1ce69e9deba1a9b191e8d95f4c82e0ec
458457
-ada_gn_build("ada") {
459458
+ public_configs = [ ":ada_config" ]
460459
}
461-
diff --git a/deps/base64/unofficial.gni b/deps/base64/unofficial.gni
462-
index 0e69d7383762f6b81c5b57698aa9d121d5a9c401..35bbeb37acc7ccb14b4b8a644ec3d4c76ca5c61c 100644
463-
--- a/deps/base64/unofficial.gni
464-
+++ b/deps/base64/unofficial.gni
465-
@@ -12,6 +12,10 @@ template("base64_gn_build") {
466-
}
467-
}
468-
469-
+ # FIXME(zcbenz): ASM on win/x86 compiles perfectly in upstream Node, figure
470-
+ # out why it does not work in Electron's build configs.
471-
+ support_x86_asm = current_cpu == "x64" || (current_cpu == "x86" && !is_win)
472-
+
473-
config("base64_internal_config") {
474-
include_dirs = [ "base64/lib" ]
475-
if (is_component_build) {
476-
@@ -19,7 +23,7 @@ template("base64_gn_build") {
477-
} else {
478-
defines = []
479-
}
480-
- if (current_cpu == "x86" || current_cpu == "x64") {
481-
+ if (support_x86_asm) {
482-
defines += [
483-
"HAVE_SSSE3=1",
484-
"HAVE_SSE41=1",
485-
@@ -69,7 +73,7 @@ template("base64_gn_build") {
486-
source_set("base64_ssse3") {
487-
configs += [ ":base64_internal_config" ]
488-
sources = [ "base64/lib/arch/ssse3/codec.c" ]
489-
- if (current_cpu == "x86" || current_cpu == "x64") {
490-
+ if (support_x86_asm) {
491-
if (is_clang || !is_win) {
492-
cflags_c = [ "-mssse3" ]
493-
}
494-
@@ -79,7 +83,7 @@ template("base64_gn_build") {
495-
source_set("base64_sse41") {
496-
configs += [ ":base64_internal_config" ]
497-
sources = [ "base64/lib/arch/sse41/codec.c" ]
498-
- if (current_cpu == "x86" || current_cpu == "x64") {
499-
+ if (support_x86_asm) {
500-
if (is_clang || !is_win) {
501-
cflags_c = [ "-msse4.1" ]
502-
}
503-
@@ -89,7 +93,7 @@ template("base64_gn_build") {
504-
source_set("base64_sse42") {
505-
configs += [ ":base64_internal_config" ]
506-
sources = [ "base64/lib/arch/sse42/codec.c" ]
507-
- if (current_cpu == "x86" || current_cpu == "x64") {
508-
+ if (support_x86_asm) {
509-
if (is_clang || !is_win) {
510-
cflags_c = [ "-msse4.2" ]
511-
}
512-
@@ -99,7 +103,7 @@ template("base64_gn_build") {
513-
source_set("base64_avx") {
514-
configs += [ ":base64_internal_config" ]
515-
sources = [ "base64/lib/arch/avx/codec.c" ]
516-
- if (current_cpu == "x86" || current_cpu == "x64") {
517-
+ if (support_x86_asm) {
518-
if (is_clang || !is_win) {
519-
cflags_c = [ "-mavx" ]
520-
} else if (is_win) {
521-
@@ -111,7 +115,7 @@ template("base64_gn_build") {
522-
source_set("base64_avx2") {
523-
configs += [ ":base64_internal_config" ]
524-
sources = [ "base64/lib/arch/avx2/codec.c" ]
525-
- if (current_cpu == "x86" || current_cpu == "x64") {
526-
+ if (support_x86_asm) {
527-
if (is_clang || !is_win) {
528-
cflags_c = [ "-mavx2" ]
529-
} else if (is_win) {
530-
@@ -123,7 +127,7 @@ template("base64_gn_build") {
531-
source_set("base64_avx512") {
532-
configs += [ ":base64_internal_config" ]
533-
sources = [ "base64/lib/arch/avx512/codec.c" ]
534-
- if (current_cpu == "x86" || current_cpu == "x64") {
535-
+ if (support_x86_asm) {
536-
if (is_clang || !is_win) {
537-
cflags_c = [
538-
"-mavx512vl",
539460
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
540461
index ac19ac73ed1e24c61cb679f3851685b79cfc8b39..ef745c19f2b1cd433cc43c834a18db7eaa8e5162 100644
541462
--- a/deps/cares/BUILD.gn

0 commit comments

Comments
 (0)