From 52e399b02be2c28eb79004f4dd452f7c21ddd925 Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:38:20 -0800 Subject: [PATCH 1/2] chore: build fixes for 133 --- .../remove-undefined-ffmpeg-identifier.patch | 15 ++++++++ patches/use-clang19-cflag.patch | 37 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 patches/remove-undefined-ffmpeg-identifier.patch create mode 100644 patches/use-clang19-cflag.patch diff --git a/patches/remove-undefined-ffmpeg-identifier.patch b/patches/remove-undefined-ffmpeg-identifier.patch new file mode 100644 index 00000000..37ac9a98 --- /dev/null +++ b/patches/remove-undefined-ffmpeg-identifier.patch @@ -0,0 +1,15 @@ +diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc +index 26bb9e8b92614..05143a0130b22 100644 +--- a/media/filters/ffmpeg_glue.cc ++++ b/media/filters/ffmpeg_glue.cc +@@ -109,10 +109,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) { + // Enable fast, but inaccurate seeks for MP3. + format_context_->flags |= AVFMT_FLAG_FAST_SEEK; + +- // We don't allow H.264 parsing during demuxing since we have our own parser +- // and the ffmpeg one increases memory usage unnecessarily. +- format_context_->flags |= AVFMT_FLAG_NOH264PARSE; +- + // Ensures format parsing errors will bail out. From an audit on 11/2017, all + // instances were real failures. Solves bugs like http://crbug.com/710791. + format_context_->error_recognition |= AV_EF_EXPLODE; diff --git a/patches/use-clang19-cflag.patch b/patches/use-clang19-cflag.patch new file mode 100644 index 00000000..a7f61e4c --- /dev/null +++ b/patches/use-clang19-cflag.patch @@ -0,0 +1,37 @@ +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 88109264ea962..42697fb3b83ef 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -382,7 +382,7 @@ config("compiler") { + } else if ((is_posix && !is_nacl) || is_fuchsia) { + if (current_os != "aix") { + # Not available on aix. +- cflags += [ "-fstack-protector" ] ++ cflags += [ "-fstack-protector-strong" ] + } + } + } +@@ -394,6 +394,14 @@ config("compiler") { + } + } + ++ if (is_clang && !is_ubsan && !is_ubsan_security) { ++ cflags += [ "-fwrapv" ] ++ } ++ ++ if (is_clang) { ++ cflags += [ "-ftrivial-auto-var-init=zero" ] ++ } ++ + # Linker warnings. + if (fatal_linker_warnings && !is_apple && current_os != "aix" && + current_os != "zos") { +@@ -1991,7 +1999,7 @@ config("default_warnings") { + cflags_cc += [ "-Wno-dangling-assignment-gsl" ] + + # TODO(crbug.com/376641662): Fix and re-enable. +- cflags += [ "-Wno-nontrivial-memcall" ] ++ cflags += [ "-Wno-nontrivial-memaccess" ] + } + } + From 89941b5ef9fe9b258aed148441cdffcbc68ba27d Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:39:29 -0800 Subject: [PATCH 2/2] fixup --- patches/use-clang19-cflag.patch | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/patches/use-clang19-cflag.patch b/patches/use-clang19-cflag.patch index a7f61e4c..75362b17 100644 --- a/patches/use-clang19-cflag.patch +++ b/patches/use-clang19-cflag.patch @@ -1,32 +1,8 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 88109264ea962..42697fb3b83ef 100644 +index 88109264ea962..ac9f6663f2cf5 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -382,7 +382,7 @@ config("compiler") { - } else if ((is_posix && !is_nacl) || is_fuchsia) { - if (current_os != "aix") { - # Not available on aix. -- cflags += [ "-fstack-protector" ] -+ cflags += [ "-fstack-protector-strong" ] - } - } - } -@@ -394,6 +394,14 @@ config("compiler") { - } - } - -+ if (is_clang && !is_ubsan && !is_ubsan_security) { -+ cflags += [ "-fwrapv" ] -+ } -+ -+ if (is_clang) { -+ cflags += [ "-ftrivial-auto-var-init=zero" ] -+ } -+ - # Linker warnings. - if (fatal_linker_warnings && !is_apple && current_os != "aix" && - current_os != "zos") { -@@ -1991,7 +1999,7 @@ config("default_warnings") { +@@ -1991,7 +1991,7 @@ config("default_warnings") { cflags_cc += [ "-Wno-dangling-assignment-gsl" ] # TODO(crbug.com/376641662): Fix and re-enable.