Skip to content

Commit

Permalink
更新补丁文件。
Browse files Browse the repository at this point in the history
  • Loading branch information
sunhaiyong1978 committed Jul 13, 2023
1 parent a6a32e9 commit 036cc7d
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From 242b2cd4990af76eaa358620cc2a70f66644ac12 Mon Sep 17 00:00:00 2001
From: Sun Haiyong <[email protected]>
Date: Thu, 13 Jul 2023 11:14:39 +0000
Subject: [PATCH] thunderbird 115 add loongarch support.

---
ipc/chromium/src/build/build_config.h | 3 +++
third_party/libwebrtc/build/build_config.h | 4 ++++
toolkit/moz.configure | 6 +++---
3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h
index c39ae9d..66c0d4a 100644
--- a/ipc/chromium/src/build/build_config.h
+++ b/ipc/chromium/src/build/build_config.h
@@ -125,6 +125,9 @@
#elif defined(__riscv) && __riscv_xlen == 64
# define ARCH_CPU_RISCV64 1
# define ARCH_CPU_64_BITS 1
+#elif defined(__loongarch_lp64)
+# define ARCH_CPU_LOONGARCH64 1
+# define ARCH_CPU_64_BITS 1
#else
# error Please add support for your architecture in build/build_config.h
#endif
diff --git a/third_party/libwebrtc/build/build_config.h b/third_party/libwebrtc/build/build_config.h
index c39ae9d..66c0d4a 100644
--- a/third_party/libwebrtc/build/build_config.h
+++ b/third_party/libwebrtc/build/build_config.h
@@ -210,6 +210,10 @@
#define ARCH_CPU_SPARC 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_BIG_ENDIAN 1
+#elif defined(__loongarch_lp64)
+#define ARCH_CPU_LOONGARCH64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
#else
#error Please add support for your architecture in build/build_config.h
#endif
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
index c518e02..b04997d 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -513,7 +513,7 @@ set_define("MOZ_WAYLAND", depends_if(wayland_headers)(lambda _: True))
def vaapi(target, wayland_headers):
# VAAPI is only used in Wayland. It's mostly used on x86(-64) but is
# sometimes used on ARM/ARM64 SOCs. Wayland implies GTK and Linux.
- if target.cpu in ("arm", "aarch64", "x86", "x86_64") and wayland_headers:
+ if target.cpu in ("arm", "aarch64", "x86", "x86_64", "loongarch64") and wayland_headers:
return True


@@ -521,7 +521,7 @@ def vaapi(target, wayland_headers):
def v4l2(target, wayland_headers):
# V4L2 decode is only used in Wayland, and generally only appears on
# embedded SOCs. Wayland implies GTK and Linux.
- if target.cpu in ("arm", "aarch64", "riscv64") and wayland_headers:
+ if target.cpu in ("arm", "aarch64", "riscv64", "loongarch64") and wayland_headers:
return True


@@ -2240,7 +2240,7 @@ with only_when(compile_environment | artifact_builds):
use_nasm = False
elif target.cpu == "x86_64":
flags = ["-D__x86_64__", "-DPIC", "-DELF", "-Pconfig_unix64.asm"]
- elif target.cpu in ("x86", "arm", "aarch64"):
+ elif target.cpu in ("x86", "arm", "aarch64", "loongarch64"):
flac_only = True
else:
enable = False
--
2.31.1

This file was deleted.

16 changes: 16 additions & 0 deletions loongarch64/scripts/step/cross-tools/gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source env/cross-tools/config
source env/distro.info
source env/function.sh
export STEP_BUILDNAME=cross-tools
export STEP_PACKAGENAME=gdb
export PACKAGE_VERSION=13.2
export RESOURCEDIR=${NEW_TARGET_SYSDIR}/files/cross-tools/gdb/13.2/
rm -rf ${BUILD_DIRECTORY}/gdb-13.2
tar xvf ${DOWNLOADDIR}/gdb-13.2.tar.xz -C ${BUILD_DIRECTORY}
pushd ${BUILD_DIRECTORY}/gdb-13.2

./configure --prefix=${CROSSTOOLS_DIR} --build=${CROSS_HOST} \
--host=${CROSS_HOST} --target=${CROSS_TARGET} --with-sysroot=${SYSROOT_DIR} --enable-64-bit-bfd
eval ${MAKE_AND_INSTALL}
popd
rm -rf ${BUILD_DIRECTORY}/gdb-13.2
1 change: 1 addition & 0 deletions loongarch64/scripts/step/cross-tools/gdb.info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gdb|13.2
2 changes: 1 addition & 1 deletion loongarch64/scripts/step/desktop-app/thunderbird
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pushd ${BUILD_DIRECTORY}/thunderbird-115.0
cp -a ${SYSROOT_DIR}/usr/lib/python3.11/site-packages/Jinja2-*-info third_party/python/Jinja2/
cp -a ${SYSROOT_DIR}/usr/lib/python3.11/site-packages/jinja2 third_party/python/Jinja2/
sed -i "/MarkupSafe/[email protected]@2.1.3@g" third_party/python/glean_parser/glean_parser-7*.dist-info/METADATA
patch -Np1 -i ${SYSDIR}/files/desktop-app/thunderbird/115.0/patches/0001-thunderbird-116-add-loongarch-support.patch
patch -Np1 -i ${SYSDIR}/files/desktop-app/thunderbird/115.0/patches/0001-thunderbird-115-add-loongarch-support.patch
patch -Np1 -i ${SYSDIR}/files/desktop-app/thunderbird/115.0/patches/firefox-110-fix-rust.patch
patch -Np1 -i ${SYSDIR}/files/desktop-app/thunderbird/115.0/patches/0001_xpcom_add_loongarch64_support.patch
patch -Np1 -i ${SYSDIR}/files/desktop-app/thunderbird/115.0/patches/firefox-100-for-clfs.patch
Expand Down
1 change: 1 addition & 0 deletions loongarch64/sources/url/cross-tools/gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
URL|https://ftp.gnu.org/gnu/gdb/gdb-13.2.tar.xz|gdb-13.2.tar.xz
1 change: 1 addition & 0 deletions loongarch64/step
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
%step/cross-tools/JSON|
%step/host-tools/autoconf-archive|
%step/cross-tools/SPIRV-LLVM-Translator|f_opt
%step/cross-tools/gdb|
%step/host-tools/hiredis|
%step/host-tools/ccache|
%step/host-tools/asciidoctor|
Expand Down

0 comments on commit 036cc7d

Please sign in to comment.