author: Andres Salomon <dilinger@debian.org>
description: don't disable i386 builds on linux

https://chromium-review.googlesource.com/c/chromium/src/+/3583780

Chromium upstream decided to kill off i386 builds on Linux. They were
goin to add a 'force_x86_support' arg, but instead "[distributions that
still support i386] can patch the file."

At this point, i386 on linux is completely unsupported upstream, so
we're on our own with bugs.

The second part is needed as _mm_cvtsi128_si64 is not available on i386,
so let only amd64/x86_64 use it.

Last-Update: 2025-07-29

--- a/src/3rdparty/chromium/BUILD.gn
+++ b/src/3rdparty/chromium/BUILD.gn
@@ -1647,9 +1647,7 @@ if (!is_ios && !is_qtwebengine) {
 }

 # TODO(cassew): Add more OS's that don't support x86.
-is_valid_x86_target =
-    target_os != "ios" && target_os != "mac" &&
-    (target_os != "linux" || use_libfuzzer || !build_with_chromium)
+is_valid_x86_target = true

 # Note: v8_target_cpu == arm allows using the V8 arm simulator on x86 for fuzzing.
 assert(

--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/text/string_hasher.h
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/text/string_hasher.h
@@ -64,7 +64,7 @@ struct ConvertTo8BitHashReader {
     DCHECK_LE(p[5], 0xff);
     DCHECK_LE(p[6], 0xff);
     DCHECK_LE(p[7], 0xff);
-#ifdef __SSE2__
+#ifdef __x86_64__
     __m128i x = _mm_loadu_si128(reinterpret_cast<const __m128i*>(p));
     return _mm_cvtsi128_si64(_mm_packus_epi16(x, x));
 #elif defined(__ARM_NEON__)
@@ -84,7 +84,7 @@ struct ConvertTo8BitHashReader {
     DCHECK_LE(p[1], 0xff);
     DCHECK_LE(p[2], 0xff);
     DCHECK_LE(p[3], 0xff);
-#ifdef __SSE2__
+#ifdef __x86_64__
     __m128i x = _mm_loadu_si64(reinterpret_cast<const __m128i*>(p));
     return _mm_cvtsi128_si64(_mm_packus_epi16(x, x));
 #elif defined(__ARM_NEON__)
