aports/community/librewolf/loong-skia-lasx.patch
2025-01-26 02:02:30 +00:00

47 lines
1.8 KiB
Diff

Generated using Skia revision 06cd249f39638e88c4b5c0fa2b1c87f5dbc0660c,
grafted onto Firefox sources, and with the resulting moz.build cherry-picked.
diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
index ef45446141947..a0bdae70eca66 100755
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -133,7 +133,10 @@ def parse_sources(output):
return set(v.replace('//', 'skia/') for v in output.decode('utf-8').split() if v.endswith('.cpp') or v.endswith('.S'))
def generate_opt_sources():
- cpus = [('intel', 'x86', [':hsw'])]
+ cpus = [
+ ('intel', 'x86', [':hsw']),
+ ('loong64', 'loong64', [':lasx'])
+ ]
opt_sources = {}
for key, cpu, deps in cpus:
@@ -424,6 +427,11 @@ def write_mozbuild(sources):
write_sources(f, sources['arm64'], 4)
write_cflags(f, sources['arm64'], opt_allowlist, 'skia_opt_flags', 4)
+ if sources['loong64']:
+ f.write("elif CONFIG['TARGET_CPU'] == 'loongarch64':\n")
+ write_sources(f, sources['loong64'], 4)
+ write_cflags(f, sources['loong64'], opt_allowlist, 'skia_opt_flags', 4)
+
if sources['none']:
f.write("else:\n")
write_sources(f, sources['none'], 4)
diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
index cd3fcc9467644..8dfdcd23841ab 100644
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -573,6 +573,11 @@ if CONFIG['INTEL_ARCHITECTURE']:
]
SOURCES['skia/modules/skcms/src/skcms_TransformHsw.cc'].flags += skia_opt_flags
SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += skia_opt_flags
+elif CONFIG['TARGET_CPU'] == 'loongarch64':
+ SOURCES += [
+ 'skia/src/opts/SkOpts_lasx.cpp',
+ ]
+ SOURCES['skia/src/opts/SkOpts_lasx.cpp'].flags += skia_opt_flags
# We allow warnings for third-party code that can be updated from upstream.