Bug 1726515 - Workaround GCC-calling-into-LLVM ABI issue by making GenericFontFamily larger. r=stransky,#layout-reviewers draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 19 Aug 2021 18:14:13 +0000
changeset 3890312 11a14ffe5200c48b8170727731f2293161e71f68
parent 3889161 7a2320e8b395cfd610e8619e6461ed310b3377e7
child 3890313 f6ef7c97fac70c47b89436e377c6a6a444589bb4
push id721329
push userreviewbot
push dateThu, 19 Aug 2021 18:14:44 +0000
treeherdertry@f6ef7c97fac7 [default view] [failures only]
reviewersstransky
bugs1726515
milestone93.0a1
Bug 1726515 - Workaround GCC-calling-into-LLVM ABI issue by making GenericFontFamily larger. r=stransky,#layout-reviewers Summary: This enum being a bit larger doesn't cause many common data structures to grow, so this should be fine. Differential Revision: https://phabricator.services.mozilla.com/D123146 Test Plan: Reviewers: stransky, #layout-reviewers Subscribers: Bug #: 1726515 Differential Diff: PHID-DIFF-hr4m2fet2y3wesvryc6y
gfx/thebes/gfxTypes.h
servo/components/style/values/computed/font.rs
--- a/gfx/thebes/gfxTypes.h
+++ b/gfx/thebes/gfxTypes.h
@@ -5,17 +5,17 @@
 
 #ifndef GFX_TYPES_H
 #define GFX_TYPES_H
 
 #include <stdint.h>
 #include "mozilla/TypedEnumBits.h"
 
 namespace mozilla {
-enum class StyleGenericFontFamily : uint8_t;
+enum class StyleGenericFontFamily : uint32_t;
 }
 
 typedef struct _cairo_surface cairo_surface_t;
 typedef struct _cairo_user_data_key cairo_user_data_key_t;
 
 typedef void (*thebes_destroy_func_t)(void* data);
 
 /**
--- a/servo/components/style/values/computed/font.rs
+++ b/servo/components/style/values/computed/font.rs
@@ -377,32 +377,36 @@ fn system_ui_enabled(_: &ParserContext) 
     static_prefs::pref!("layout.css.system-ui.enabled")
 }
 
 /// A generic font-family name.
 ///
 /// The order here is important, if you change it make sure that
 /// `gfxPlatformFontList.h`s ranged array and `gfxFontFamilyList`'s
 /// sSingleGenerics are updated as well.
+///
+/// NOTE(emilio): Should be u8, but it's a u32 because of ABI issues between GCC
+/// and LLVM see https://bugs.llvm.org/show_bug.cgi?id=44228 / bug 1600735 /
+/// bug 1726515.
 #[derive(
     Clone,
     Copy,
     Debug,
     Eq,
     Hash,
     MallocSizeOf,
     PartialEq,
     Parse,
     ToCss,
     ToComputedValue,
     ToResolvedValue,
     ToShmem,
 )]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[repr(u8)]
+#[repr(u32)]
 #[allow(missing_docs)]
 pub enum GenericFontFamily {
     /// No generic family specified, only for internal usage.
     ///
     /// NOTE(emilio): Gecko code relies on this variant being zero.
     #[css(skip)]
     None = 0,
     Serif,