From 9e9daaf64bfd4b3000c95dd6f3a58b1f040968a2 Mon Sep 17 00:00:00 2001 From: Guochunrong Date: Thu, 29 May 2025 10:19:36 +0800 Subject: [PATCH] update to phytium_linux_yocto_4.0_2025-v2.3 Signed-off-by: Guochunrong --- README.md | 73 ++- default.xml | 3 +- meta-bsp/classes/user-with-full-skel.bbclass | 2 +- meta-bsp/conf/distro/phytium.conf | 2 +- meta-bsp/conf/machine/phytium-base.inc | 2 - .../docker-distribution_git.bbappend | 1 - .../recipes-core/images/core-image-gnome.bb | 79 ++++ .../recipes-core/images/core-image-xfce.bb | 3 +- .../images/meta-toolchain.bbappend | 9 + .../images/xen-image-minimal.bbappend | 7 - .../packagegroups/packagegroup-optee.bb | 1 - .../packagegroup-phy-benchmark.bb | 2 +- .../packagegroups/packagegroup-x100um-sdk.bb | 2 +- .../users/group-wheel.bb | 11 + .../users/unpriv-user_1.2.bb | 33 ++ .../recipes-devtools/clang/clang-cross.inc | 2 - .../clang/clang-cross_git.bbappend | 1 - .../recipes-devtools/clang/clang_git.bbappend | 1 - .../clang/llvm-project-source.bbappend | 1 - .../valgrind/valgrind_%.bbappend | 1 + meta-bsp/recipes-extended/gawk/gawk.inc | 5 + .../recipes-extended/gawk/gawk_%.bbappend | 1 + .../igh-ethercat/igh-ethercat.bb | 2 +- .../jailhouse/jailhouse_0.12.bb | 69 ++- .../mozjs/mozjs-91_%.bbappend | 1 + meta-bsp/recipes-extended/xen/xen-phytium.inc | 15 - .../recipes-extended/xen/xen_4.15.bbappend | 1 - .../glibc/glibc-external.bbappend | 19 + meta-bsp/recipes-gnome/gdm/gdm_%.bbappend | 5 + ...0001-start-gnome-session-through-gdm.patch | 22 + .../gnome-session/gnome-session_%.bbappend | 2 + .../recipes-graphics/mesa/mesa_%.bbappend | 7 +- ...mor_egl-Don-t-initialize-on-softpipe.patch | 29 ++ .../xorg-xserver/xserver-xorg_%.bbappend | 2 + .../kernel-modules/rtl8821cs.bb | 22 + .../0001-Makefile-fix-cannot-find-.h.patch | 31 -- .../linux/linux-phytium-rt_4.19.bb | 2 +- .../linux/linux-phytium-rt_5.10.bb | 5 +- .../linux/linux-phytium_4.19.bb | 2 +- .../linux/linux-phytium_5.10.bb | 5 +- meta-bsp/recipes-multimedia/x264/x264.inc | 3 + .../recipes-multimedia/x264/x264_%.bbappend | 1 + ...spection.cmake-prefix-variables-obta.patch | 38 ++ .../0001-Fix-build-without-opengl-or-es.patch | 133 ++++++ ...tings-so-that-gtkdoc-generation-work.patch | 47 ++ ...trospection-files-do-not-quote-CFLAG.patch | 78 ++++ ...44e17d258106617b0e6d783d073b188a2548.patch | 296 ++++++++++++ .../webkit/webkitgtk/CVE-2022-32888.patch | 41 ++ .../webkit/webkitgtk/CVE-2022-32923.patch | 435 ++++++++++++++++++ .../webkit/webkitgtk/CVE-2022-42867.patch | 104 +++++ .../webkit/webkitgtk/CVE-2022-46691.patch | 43 ++ .../webkit/webkitgtk/CVE-2022-46699.patch | 136 ++++++ .../webkit/webkitgtk/CVE-2022-46700.patch | 67 +++ .../webkit/webkitgtk/CVE-2022-48503.patch | 225 +++++++++ .../webkit/webkitgtk/CVE-2023-23529.patch | 65 +++ .../webkit/webkitgtk/CVE-2023-32439.patch | 127 +++++ .../webkit/webkitgtk/CVE-2024-40776.patch | 141 ++++++ .../webkit/webkitgtk/CVE-2024-40779.patch | 91 ++++ .../webkit/webkitgtk/CVE-2024-40780.patch | 94 ++++ .../webkit/webkitgtk/reproducibility.patch | 22 + .../recipes-sato/webkit/webkitgtk_%.bbappend | 22 + ...it_4.0.0.bb => optee-os-tadevkit_4.6.0.bb} | 2 +- ...4.0.0.bb => optee-phytium-client_4.6.0.bb} | 4 +- ...0.0.bb => optee-phytium-examples_4.6.0.bb} | 0 ...-os_4.0.0.bb => optee-phytium-os_4.6.0.bb} | 0 .../optee-phytium/optee-phytium-test_4.0.0.bb | 59 --- .../recipes-security/optee-phytium/optee.inc | 2 +- .../linux/linux-xenomai-phytium_4.19.bb | 2 +- .../linux/linux-xenomai-phytium_5.10.bb | 5 +- .../{xenomai_3.1.3.bb => xenomai_3.1.5.bb} | 6 +- .../{xenomai_3.2.4.bb => xenomai_3.2.6.bb} | 6 +- phyt_yocto_setenv.sh | 62 +++ tools/setup-env | 3 +- 73 files changed, 2631 insertions(+), 212 deletions(-) delete mode 100644 meta-bsp/recipes-containers/docker-distribution/docker-distribution_git.bbappend create mode 100644 meta-bsp/recipes-core/images/core-image-gnome.bb delete mode 100644 meta-bsp/recipes-core/images/xen-image-minimal.bbappend create mode 100644 meta-bsp/recipes-defaultconfig/users/group-wheel.bb create mode 100644 meta-bsp/recipes-defaultconfig/users/unpriv-user_1.2.bb delete mode 100644 meta-bsp/recipes-devtools/clang/clang-cross.inc delete mode 100644 meta-bsp/recipes-devtools/clang/clang-cross_git.bbappend delete mode 100644 meta-bsp/recipes-devtools/clang/clang_git.bbappend delete mode 100644 meta-bsp/recipes-devtools/clang/llvm-project-source.bbappend create mode 100644 meta-bsp/recipes-devtools/valgrind/valgrind_%.bbappend create mode 100644 meta-bsp/recipes-extended/gawk/gawk.inc create mode 100644 meta-bsp/recipes-extended/gawk/gawk_%.bbappend create mode 100644 meta-bsp/recipes-extended/mozjs/mozjs-91_%.bbappend delete mode 100644 meta-bsp/recipes-extended/xen/xen-phytium.inc delete mode 100644 meta-bsp/recipes-extended/xen/xen_4.15.bbappend create mode 100644 meta-bsp/recipes-external/glibc/glibc-external.bbappend create mode 100644 meta-bsp/recipes-gnome/gdm/gdm_%.bbappend create mode 100644 meta-bsp/recipes-gnome/gnome-session/gnome-session/0001-start-gnome-session-through-gdm.patch create mode 100644 meta-bsp/recipes-gnome/gnome-session/gnome-session_%.bbappend create mode 100644 meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor_egl-Don-t-initialize-on-softpipe.patch create mode 100644 meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend create mode 100644 meta-bsp/recipes-kernel/kernel-modules/rtl8821cs.bb delete mode 100644 meta-bsp/recipes-kernel/linux/files/0001-Makefile-fix-cannot-find-.h.patch create mode 100644 meta-bsp/recipes-multimedia/x264/x264.inc create mode 100644 meta-bsp/recipes-multimedia/x264/x264_%.bbappend create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/0001-Fix-build-without-opengl-or-es.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-do-not-quote-CFLAG.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32888.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32923.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-42867.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46691.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46699.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-48503.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-23529.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-32439.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40776.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40779.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40780.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk/reproducibility.patch create mode 100644 meta-bsp/recipes-sato/webkit/webkitgtk_%.bbappend rename meta-bsp/recipes-security/optee-phytium/{optee-os-tadevkit_4.0.0.bb => optee-os-tadevkit_4.6.0.bb} (94%) rename meta-bsp/recipes-security/optee-phytium/{optee-phytium-client_4.0.0.bb => optee-phytium-client_4.6.0.bb} (89%) rename meta-bsp/recipes-security/optee-phytium/{optee-phytium-examples_4.0.0.bb => optee-phytium-examples_4.6.0.bb} (100%) rename meta-bsp/recipes-security/optee-phytium/{optee-phytium-os_4.0.0.bb => optee-phytium-os_4.6.0.bb} (100%) delete mode 100644 meta-bsp/recipes-security/optee-phytium/optee-phytium-test_4.0.0.bb rename meta-xenomai/recipes-xenomai/xenomai/{xenomai_3.1.3.bb => xenomai_3.1.5.bb} (87%) rename meta-xenomai/recipes-xenomai/xenomai/{xenomai_3.2.4.bb => xenomai_3.2.6.bb} (88%) create mode 100644 phyt_yocto_setenv.sh diff --git a/README.md b/README.md index 44757ea..1a6433a 100644 --- a/README.md +++ b/README.md @@ -7,24 +7,44 @@ phytium-linux-yocto基于Yocto,适配了飞腾E2000,D2000,FT-2000/4等CPU 用户手册位于https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/linux # 预备知识 + Yocto涉及了rootfs、make、Kconfig、Linux command、Shell scripts、U-Boot、Linux kernel、dts等相关知识,了解与熟悉它们有助于Yocto的使用。 了解上述知识,可以参考Wiki:[相关知识与学习链接](https://gitee.com/phytium_embedded/phytium-linux-yocto/wikis/%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%86%E4%B8%8E%E5%AD%A6%E4%B9%A0%E9%93%BE%E6%8E%A5) # 开发环境 + ## 系统要求 + 我们只支持在Ubuntu22.04、Debian11这二种x86主机上运行,最少4GB内存,磁盘剩余空间至少50GB -首先,phytium-linux-yocto 需要主机系统上安装如下软件包 +## 通过脚本自动设置编译环境 + +进入工程根目录执行以下命令自动完成开发环境设置 ``` - sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib +$ git clone https://gitee.com/phytium_embedded/phytium-linux-yocto.git - build-essential chrpath socat cpio python3 python3-pip python3-pexpect - - xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa +$ cd phytium-linux-yocto + +$ source phyt_yocto_setenv.sh + +该脚本实现了自动安装主机环境、工具链部署和构建目录生成 + +$ bitbake core-image-minimal + +``` + +## 手动设置编译环境 + +phytium-linux-yocto 需要主机系统上安装如下软件包 + +``` + $ sudo apt-get install build-essential chrpath cpio debianutils diffstat file + + gawk gcc git iputils-ping libacl1 liblz4-tool locales python3 python3-git - libsdl1.2-dev pylint3 xterm libncursesw5-dev openssl libssl-dev zstd lz4 + python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd ``` ## 通过repo manifest获取phytium-linux-yocto @@ -38,8 +58,6 @@ Yocto涉及了rootfs、make、Kconfig、Linux command、Shell scripts、U-Boot $: chmod a+x ~/bin/repo - $: PATH=~/bin:${PATH} - Download the Yocto layers: $: export PATH=~/bin:${PATH} @@ -61,6 +79,7 @@ Yocto涉及了rootfs、make、Kconfig、Linux command、Shell scripts、U-Boot ## 构建phytium 镜像: +``` $: . ./setup-env -m phytium $: bitbake core-image-minimal @@ -73,25 +92,34 @@ Yocto涉及了rootfs、make、Kconfig、Linux command、Shell scripts、U-Boot $: bitbake phydisk +``` + +## 支持GNOME桌面 +``` + +$: bitbake core-image-gnome + +``` ## 支持编译SD卡镜像 在local.conf 里添加变量如下变量 MACHINE_FEATURES:append = " sd" - +``` $ bitbake phydisk - +``` 镜像的输出位置 tmp/deploy/images/phytium/. # phydisk镜像的使用 Phydisk.img 镜像包含了根文件系统、内核、设备树和GRUB。 使用img 镜像安装系统,不需要像之前那样将存储设备手动分区再拷贝文件,只需要将phydisk.img文件写入存储设备即可。 - + ``` $ sudo umount /dev/sdb\* $ sudo dd if=phydisk.img of=/dev/sdb bs=1M $ sync +``` ## Uefi启动系统 如果是使用phydisk.img 镜像安装系统,将存储设备接到开发板,启动开发板电源,进入UEFI 模式,选择启动的介质,即可自动启动系统。 @@ -100,12 +128,14 @@ Yocto涉及了rootfs、make、Kconfig、Linux command、Shell scripts、U-Boot 安装系统后,将存储设备接到开发板,启动开发板电源,串口输出U-Boot命令行,设置U-Boot环境变量来启动系统。 +``` =>setenv bootargs console=ttyAMA1,115200 audit=0 earlycon=pl011,0x2800d000 root=PARTUUID="0a52c129-7e0f-43ad-989f-d96b07ccdbb2" rootdelay=5 rw; =>setenv bootcmd 'usb start;fatload usb 0:1 0x90100000 Image;fatload usb 0:1 0x90000000 e2000q-demo-board.dtb;booti 0x90100000 - 0x90000000' =>saveenv +``` ## 登录 文件系统只需要输入用户名root,按回车键,没有密码。 @@ -127,6 +157,27 @@ Yocto涉及了rootfs、make、Kconfig、Linux command、Shell scripts、U-Boot IMAGE_INSTALL:append = " lib32-glibc lib32-libgcc lib32-libstdc++" +# 外部工具链使用 + 工具链下载地址:https://gitee.com/phytium_embedded/phytium-rogue-umlibs/raw/develop/pre-toolchain/phytium-glibc-x86_64-meta-toolchain-aarch64-toolchain-4.0.6.sh + + 安装工具链到64位X86开发主机上 + + $ sh phytium-glibc-x86_64-meta-toolchain-aarch64-toolchain-4.0.6.sh + + 修改 local.conf 添加下列内容 + + EXTERNAL_TOOLCHAIN = "/path/to/your/external-toolchain-installed" + + TCMODE = "external-oe-sdk" + + PREFERRED_PROVIDER_virtual/crypt = "libxcrypt" + + PREFERRED_PROVIDER_linux-libc-headers = "glibc-external" + + PREFERRED_PROVIDER_linux-libc-headers-dev = "glibc-external" + + PREFERRED_PROVIDER_virtual/linux-libc-headers = "glibc-external" + # 常见问题 ## 如何编译Linux RT 内核? diff --git a/default.xml b/default.xml index 97733e2..7233da9 100644 --- a/default.xml +++ b/default.xml @@ -12,9 +12,8 @@ - - + diff --git a/meta-bsp/classes/user-with-full-skel.bbclass b/meta-bsp/classes/user-with-full-skel.bbclass index 76cd155..9274de6 100644 --- a/meta-bsp/classes/user-with-full-skel.bbclass +++ b/meta-bsp/classes/user-with-full-skel.bbclass @@ -15,7 +15,7 @@ SKEL_INIT_MARKER = "force-skel-full-init" # user recipe part -pkg_postinst_${PN}_prepend() { +pkg_postinst:${PN}:prepend() { if [ -n "$D" -a -n "${USERNAME}" ]; then touch $D/home/${USERNAME}/${SKEL_INIT_MARKER} fi diff --git a/meta-bsp/conf/distro/phytium.conf b/meta-bsp/conf/distro/phytium.conf index ed61df7..a29d3b8 100644 --- a/meta-bsp/conf/distro/phytium.conf +++ b/meta-bsp/conf/distro/phytium.conf @@ -10,7 +10,7 @@ SDK_NAME_PREFIX = "${DISTRO}" TOOLCHAIN_OUTPUTNAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-toolchain-${SDK_VERSION}" -DISTRO_FEATURES:append = " x11 opengl virtualization polkit systemd pam seccomp audio pulseaudio" +DISTRO_FEATURES:append = " x11 opengl polkit systemd pam seccomp audio pulseaudio" LICENSE_FLAGS_ACCEPTED = "non-commercial_netperf commercial" diff --git a/meta-bsp/conf/machine/phytium-base.inc b/meta-bsp/conf/machine/phytium-base.inc index 7a2eeec..385dc10 100644 --- a/meta-bsp/conf/machine/phytium-base.inc +++ b/meta-bsp/conf/machine/phytium-base.inc @@ -26,8 +26,6 @@ MACHINE_ARCH_FILTER = "virtual/kernel" XSERVER ?= "xserver-xorg \ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \ xf86-video-fbdev \ - xf86-video-amdgpu \ - xf86-video-ati \ xf86-video-modesetting \ " PREFERRED_VERSION_gstreamer1.0-libav ?= "1.16.0" diff --git a/meta-bsp/recipes-containers/docker-distribution/docker-distribution_git.bbappend b/meta-bsp/recipes-containers/docker-distribution/docker-distribution_git.bbappend deleted file mode 100644 index e5be5e4..0000000 --- a/meta-bsp/recipes-containers/docker-distribution/docker-distribution_git.bbappend +++ /dev/null @@ -1 +0,0 @@ -RDEPENDS:${PN}-dev = "" diff --git a/meta-bsp/recipes-core/images/core-image-gnome.bb b/meta-bsp/recipes-core/images/core-image-gnome.bb new file mode 100644 index 0000000..42d22d9 --- /dev/null +++ b/meta-bsp/recipes-core/images/core-image-gnome.bb @@ -0,0 +1,79 @@ +DESCRIPTION = "A GNOME phytium demo image." + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +IMAGE_INSTALL += " \ + packagegroup-boot \ + packagegroup-base \ + ${ROOTFS_PKGMANAGE} \ + update-alternatives-opkg \ + coreutils \ + bash \ + bash-completion \ + systemd-bash-completion \ + systemd-analyze \ + cpufrequtils \ + findutils \ + htop \ + util-linux-lsblk \ + nano \ + rsync \ + wget \ + dbus-broker \ + sudo \ + ${LIBC_SPECIFIC_PACKS} \ +" + +LIBC_SPECIFIC_PACKS = "" +LIBC_SPECIFIC_PACKS:libc-glibc = "glibc-gconv glibc-gconvs glibc-utils" + +IMAGE_DEV_MANAGER = "udev" +IMAGE_INIT_MANAGER = "systemd" +IMAGE_INITSCRIPTS = " " +IMAGE_LOGIN_MANAGER = "busybox shadow" + +inherit image + + +X11_BASE_INSTALL += " \ + packagegroup-core-x11-xserver \ + \ + iso-codes \ + mime-support \ + xauth \ + xdg-utils \ + xhost \ + xinetd \ + xinit \ + xrandr \ + xrdb \ + xset \ + xvinfo \ +" + +GUI_INSTALL = " ttf-dejavu-sans ttf-dejavu-sans-mono ttf-dejavu-common \ + ttf-liberation-sans ttf-liberation-mono ttf-liberation-serif \ + fontconfig fontconfig-utils font-util \ + gedit gtksourceview-classic-light \ + xarchiver \ + shared-mime-info \ + xterm \ +" + +NET_INSTALL = " avahi-autoipd \ + iputils \ + networkmanager \ + networkmanager-nmcli \ + openssh \ +" + +IMAGE_INSTALL += " ${X11_BASE_INSTALL} \ + packagegroup-gnome-desktop \ + ${GUI_INSTALL} \ + ${NET_INSTALL} \ + network-manager-applet \ + gdm \ + unpriv-user \ +" +SYSTEMD_DEFAULT_TARGET = "graphical.target" diff --git a/meta-bsp/recipes-core/images/core-image-xfce.bb b/meta-bsp/recipes-core/images/core-image-xfce.bb index fc627c5..5dd9188 100644 --- a/meta-bsp/recipes-core/images/core-image-xfce.bb +++ b/meta-bsp/recipes-core/images/core-image-xfce.bb @@ -36,7 +36,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" IMAGE_FSTYPES = "tar.gz ext4" -IMAGE_INSTALL += " ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', 'packagegroup-phy-virtualization', '', d)} \ +IMAGE_INSTALL += " ${@bb.utils.contains('DISTRO_FEATURES', 'jailhouse', 'packagegroup-phy-virtualization', '', d)} \ packagegroup-phy-mfgtools \ openssh \ packagegroup-phy-gstreamer1.0-full \ @@ -46,6 +46,7 @@ IMAGE_INSTALL += " ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', 'pa packagegroup-phy-tools-core-dev \ packagegroup-gui-base \ wireless-regdb-static \ + ${@bb.utils.contains('MACHINE_FEATURES', 'sd', 'rtl8821cs iw wpa-supplicant', '', d)} \ ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'packagegroup-optee', '', d)} \ ${@bb.utils.contains('MACHINE_FEATURES', 'x100', 'packagegroup-x100um-sdk', '', d)} \ " diff --git a/meta-bsp/recipes-core/images/meta-toolchain.bbappend b/meta-bsp/recipes-core/images/meta-toolchain.bbappend index 87759c6..20ed5cb 100644 --- a/meta-bsp/recipes-core/images/meta-toolchain.bbappend +++ b/meta-bsp/recipes-core/images/meta-toolchain.bbappend @@ -1,3 +1,12 @@ TOOLCHAIN_TARGET_TASK += " \ openssl \ + libxcrypt \ + libtirpc \ + libnsl2 \ + glibc-charmaps \ + localedef \ + glibc-mtrace \ + glibc-localedatas \ + libgomp \ + ldd \ " diff --git a/meta-bsp/recipes-core/images/xen-image-minimal.bbappend b/meta-bsp/recipes-core/images/xen-image-minimal.bbappend deleted file mode 100644 index 86839a5..0000000 --- a/meta-bsp/recipes-core/images/xen-image-minimal.bbappend +++ /dev/null @@ -1,7 +0,0 @@ -inherit phy-utils - -ROOTFS_POSTPROCESS_COMMAND += "rootfs_copy_xen_image;" - -do_rootfs[depends] += "xen-guest-image-minimal:do_image_complete" - -IMAGE_INSTALL:remove = "${XEN_KERNEL_MODULES}" diff --git a/meta-bsp/recipes-core/packagegroups/packagegroup-optee.bb b/meta-bsp/recipes-core/packagegroups/packagegroup-optee.bb index 39bd3f8..8a40b07 100644 --- a/meta-bsp/recipes-core/packagegroups/packagegroup-optee.bb +++ b/meta-bsp/recipes-core/packagegroups/packagegroup-optee.bb @@ -8,5 +8,4 @@ PACKAGES = "${PN}" RDEPENDS:${PN} = "\ optee-phytium-client optee-phytium-examples optee-phytium-os \ - optee-phytium-test \ " diff --git a/meta-bsp/recipes-core/packagegroups/packagegroup-phy-benchmark.bb b/meta-bsp/recipes-core/packagegroups/packagegroup-phy-benchmark.bb index f0a9cec..8964240 100644 --- a/meta-bsp/recipes-core/packagegroups/packagegroup-phy-benchmark.bb +++ b/meta-bsp/recipes-core/packagegroups/packagegroup-phy-benchmark.bb @@ -16,7 +16,7 @@ RDEPENDS:${PN}-core = "\ lmbench \ netperf \ can-utils netcat devmem2 evtest libgpiod \ - tcpdump memtester fio coremark unixbench bpftrace stream-openmp \ + tcpdump memtester fio coremark unixbench stream-openmp \ glmark2 \ " RDEPENDS:${PN}-extended = " \ diff --git a/meta-bsp/recipes-core/packagegroups/packagegroup-x100um-sdk.bb b/meta-bsp/recipes-core/packagegroups/packagegroup-x100um-sdk.bb index 934c913..51b73fe 100644 --- a/meta-bsp/recipes-core/packagegroups/packagegroup-x100um-sdk.bb +++ b/meta-bsp/recipes-core/packagegroups/packagegroup-x100um-sdk.bb @@ -9,5 +9,5 @@ PACKAGES = "${PN}" RDEPENDS:${PN} = "bison flex gawk gcc g++ make ninja m4 meson patch pkgconfig tar zip automake bc cmake dpkg-dev ncurses \ opencl-headers perl qemu texinfo wget gperf intltool libtool python3-mako \ libxslt xkbutils git libglvnd libglvnd-dev libdrm-dev libgbm-dev pixman libepoxy-dev libudev libxcb \ - libxshmfence-dev libxrandr-dev ffmpeg x264 x265 libomxillibegl-mesa-dev mesa xserver-xorg-dev xserver-xorg-extension-glx \ + libxshmfence-dev libxrandr-dev ffmpeg x264 x265 libomxil libegl-mesa-dev mesa xserver-xorg-dev xserver-xorg-extension-glx \ x265 x265-dev x264 x264-dev dracut kernel-devsrc" diff --git a/meta-bsp/recipes-defaultconfig/users/group-wheel.bb b/meta-bsp/recipes-defaultconfig/users/group-wheel.bb new file mode 100644 index 0000000..30b8c0f --- /dev/null +++ b/meta-bsp/recipes-defaultconfig/users/group-wheel.bb @@ -0,0 +1,11 @@ +SUMMARY = "Create usergroup wheel for sudo" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit useradd + +USERADD_PACKAGES = "${PN}" +#USERADD_PARAM = "" +GROUPADD_PARAM:${PN} = "--system wheel" + +ALLOW_EMPTY:${PN} = "1" diff --git a/meta-bsp/recipes-defaultconfig/users/unpriv-user_1.2.bb b/meta-bsp/recipes-defaultconfig/users/unpriv-user_1.2.bb new file mode 100644 index 0000000..cbacb64 --- /dev/null +++ b/meta-bsp/recipes-defaultconfig/users/unpriv-user_1.2.bb @@ -0,0 +1,33 @@ +DESCRIPTION = "This recipe adds a user 'user' without password" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit useradd user-with-full-skel + +USERNAME = "user" +# groups user shall be member of (NO WHITESPACES ALLOWED) +USERGROUPS = "audio,video,dialout,wheel,${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', 'datetime,network,', '', d)}systemd-journal" + +# all those we are member of +USER_DEPS ?= " \ + systemd \ + \ + group-wheel \ + ${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', 'polkit-group-rule-datetime polkit-group-rule-network', '', d)} \ +" + +DEPENDS += "${USER_DEPS}" +RDEPENDS:${PN} = "${USER_DEPS} bash" + +USERADD_PACKAGES = "${PN}" + +USERADD_PARAM:${PN} = "-m -c user -d /home/${USERNAME} -s /bin/bash -k /etc/skel -g ${USERNAME} --groups ${USERGROUPS} ${USERNAME}" + +GROUPADD_PARAM:${PN} = "${USERNAME}" + +pkg_postinst_ontarget:${PN}() { +# empty password +passwd -d ${USERNAME} +} + +ALLOW_EMPTY:${PN} = "1" diff --git a/meta-bsp/recipes-devtools/clang/clang-cross.inc b/meta-bsp/recipes-devtools/clang/clang-cross.inc deleted file mode 100644 index 2970321..0000000 --- a/meta-bsp/recipes-devtools/clang/clang-cross.inc +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDS_remove = "binutils-cross-${TARGET_ARCH}" -DEPENDS += "virtual/${TARGET_PREFIX}binutils" diff --git a/meta-bsp/recipes-devtools/clang/clang-cross_git.bbappend b/meta-bsp/recipes-devtools/clang/clang-cross_git.bbappend deleted file mode 100644 index 7dffe64..0000000 --- a/meta-bsp/recipes-devtools/clang/clang-cross_git.bbappend +++ /dev/null @@ -1 +0,0 @@ -require ${@oe.utils.conditional('TCMODE', 'external-arm', 'clang-cross.inc', '', d)} diff --git a/meta-bsp/recipes-devtools/clang/clang_git.bbappend b/meta-bsp/recipes-devtools/clang/clang_git.bbappend deleted file mode 100644 index a261868..0000000 --- a/meta-bsp/recipes-devtools/clang/clang_git.bbappend +++ /dev/null @@ -1 +0,0 @@ -SYSROOT_PREPROCESS_FUNCS:remove_class-target = " clang_sysroot_preprocess" diff --git a/meta-bsp/recipes-devtools/clang/llvm-project-source.bbappend b/meta-bsp/recipes-devtools/clang/llvm-project-source.bbappend deleted file mode 100644 index 89d1c8c..0000000 --- a/meta-bsp/recipes-devtools/clang/llvm-project-source.bbappend +++ /dev/null @@ -1 +0,0 @@ -LLVM_GIT = "git://mirrors.tuna.tsinghua.edu.cn/git" diff --git a/meta-bsp/recipes-devtools/valgrind/valgrind_%.bbappend b/meta-bsp/recipes-devtools/valgrind/valgrind_%.bbappend new file mode 100644 index 0000000..38a47d4 --- /dev/null +++ b/meta-bsp/recipes-devtools/valgrind/valgrind_%.bbappend @@ -0,0 +1 @@ +RDEPENDS:${PN}-ptest:remove = "${TCLIBC}-src gcc-runtime-dbg" diff --git a/meta-bsp/recipes-extended/gawk/gawk.inc b/meta-bsp/recipes-extended/gawk/gawk.inc new file mode 100644 index 0000000..1b47c6e --- /dev/null +++ b/meta-bsp/recipes-extended/gawk/gawk.inc @@ -0,0 +1,5 @@ +do_install:append() { + # remove the link since we don't package it + rm ${D}${libexecdir}/awk/grcat +} + diff --git a/meta-bsp/recipes-extended/gawk/gawk_%.bbappend b/meta-bsp/recipes-extended/gawk/gawk_%.bbappend new file mode 100644 index 0000000..a291e31 --- /dev/null +++ b/meta-bsp/recipes-extended/gawk/gawk_%.bbappend @@ -0,0 +1 @@ +require ${@oe.utils.conditional('TCMODE', 'external-oe-sdk', 'gawk.inc', '', d)} diff --git a/meta-bsp/recipes-extended/igh-ethercat/igh-ethercat.bb b/meta-bsp/recipes-extended/igh-ethercat/igh-ethercat.bb index 579ad5a..ed1db47 100644 --- a/meta-bsp/recipes-extended/igh-ethercat/igh-ethercat.bb +++ b/meta-bsp/recipes-extended/igh-ethercat/igh-ethercat.bb @@ -7,7 +7,7 @@ SRCBRANCH ?= "master" SRC_URI = "git://gitee.com/phytium_embedded/ether-cat.git;branch=${SRCBRANCH};protocol=https" -SRCREV = "46f2cd974b728696a3c53fd36728d0fec189479c" +SRCREV = "47dc5942ff6b982197e70342279e7788e8cf1425" S = "${WORKDIR}/git" PACKAGECONFIG ??= "generic cadence" diff --git a/meta-bsp/recipes-extended/jailhouse/jailhouse_0.12.bb b/meta-bsp/recipes-extended/jailhouse/jailhouse_0.12.bb index 9e7661d..f9c800c 100644 --- a/meta-bsp/recipes-extended/jailhouse/jailhouse_0.12.bb +++ b/meta-bsp/recipes-extended/jailhouse/jailhouse_0.12.bb @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \ " SRCBRANCH = "master" -SRCREV = "e1e7fe28dd48a07bf1c45bdbc9923ae445ad761e" +SRCREV = "086b03865bea241c49efd53f5a77891637a2128e" SRC_URI = "git://gitee.com/phytium_embedded/phytium-jailhouse.git;protocol=https;branch=${SRCBRANCH} \ file://0001-tools-scripts-update-shebang-to-python3.patch \ @@ -40,53 +40,38 @@ do_configure() { fi } -USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \ - -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \ - -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \ - -I../driver' -TOOLS_SRC_DIR = "${S}/tools" -TOOLS_OBJ_DIR = "${S}/tools" +EXTRA_OEMAKE += 'PYTHON=python3' +EXTRA_OEMAKE += 'LDFLAGS=""' +EXTRA_OEMAKE += 'CC="${CC}"' +EXTRA_OEMAKE += 'ARCH=${JH_ARCH}' +EXTRA_OEMAKE += 'CROSS_COMPILE=${TARGET_PREFIX}' +EXTRA_OEMAKE += 'KDIR=${STAGING_KERNEL_BUILDDIR}' +EXTRA_OEMAKE += 'MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}"' +EXTRA_OEMAKE += 'INSTALL_MOD_PATH=${D}${root_prefix}' +EXTRA_OEMAKE += 'firmwaredir=${nonarch_base_libdir}/firmware' do_compile() { - unset LDFLAGS - oe_runmake V=1 CC="${CC}" \ - ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \ - KDIR=${STAGING_KERNEL_BUILDDIR} - - cd ${TOOLS_SRC_DIR} - export JAILHOUSE_VERSION=$(cat ../VERSION) - oe_runmake V=1 \ - CFLAGS="${USER_SPACE_CFLAGS}" \ - src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \ - ${TOOLS_OBJ_DIR}/jailhouse-config-collect ${TOOLS_OBJ_DIR}/jailhouse + oe_runmake V=1 } do_install() { - oe_runmake \ - PYTHON=python3 \ - V=1 \ - LDFLAGS="" \ - CC="${CC}" \ - ARCH=${JH_ARCH} \ - CROSS_COMPILE=${TARGET_PREFIX} \ - KDIR=${STAGING_KERNEL_BUILDDIR} \ - DESTDIR=${D} install - - install -d ${D}${CELL_DIR} - install ${B}/configs/${JH_ARCH}/*.cell ${D}${CELL_DIR}/ - - install -d ${D}${INMATES_DIR}/tools/${JH_ARCH} - install ${B}/inmates/demos/${JH_ARCH}/*.bin ${D}${INMATES_DIR} - - install -d ${D}${JH_DATADIR}/tools - install ${B}/tools/jailhouse-cell-linux ${D}${JH_DATADIR}/tools - install ${B}/tools/jailhouse-cell-stats ${D}${JH_DATADIR}/tools - install ${B}/tools/jailhouse-config-collect ${D}${JH_DATADIR}/tools - install ${B}/tools/jailhouse-config-create ${D}${JH_DATADIR}/tools - install ${B}/tools/jailhouse-gcov-extract ${D}${JH_DATADIR}/tools - install ${B}/tools/jailhouse-hardware-check ${D}${JH_DATADIR}/tools - install ${B}/inmates/tools/${JH_ARCH}/linux-loader.bin ${D}${INMATES_DIR}/tools/${JH_ARCH} + oe_runmake DESTDIR=${D} install + install -d ${D}${CELL_DIR} + install ${B}/configs/${JH_ARCH}/*.cell ${D}${CELL_DIR}/ + + install -d ${D}${INMATES_DIR}/tools/${JH_ARCH} + install ${B}/inmates/demos/${JH_ARCH}/*.bin ${D}${INMATES_DIR} + + install -d ${D}${JH_DATADIR}/tools + install ${B}/tools/jailhouse-cell-linux ${D}${JH_DATADIR}/tools + install ${B}/tools/jailhouse-cell-stats ${D}${JH_DATADIR}/tools + install ${B}/tools/jailhouse-config-collect ${D}${JH_DATADIR}/tools + install ${B}/tools/jailhouse-config-create ${D}${JH_DATADIR}/tools + install ${B}/tools/jailhouse-gcov-extract ${D}${JH_DATADIR}/tools + install ${B}/tools/jailhouse-hardware-check ${D}${JH_DATADIR}/tools + install ${B}/inmates/tools/${JH_ARCH}/linux-loader.bin ${D}${INMATES_DIR}/tools/${JH_ARCH} + } PACKAGE_BEFORE_PN = "kernel-module-jailhouse pyjailhouse" diff --git a/meta-bsp/recipes-extended/mozjs/mozjs-91_%.bbappend b/meta-bsp/recipes-extended/mozjs/mozjs-91_%.bbappend new file mode 100644 index 0000000..58bc43b --- /dev/null +++ b/meta-bsp/recipes-extended/mozjs/mozjs-91_%.bbappend @@ -0,0 +1 @@ +DEPENDS += " m4-native" diff --git a/meta-bsp/recipes-extended/xen/xen-phytium.inc b/meta-bsp/recipes-extended/xen/xen-phytium.inc deleted file mode 100644 index 90622fd..0000000 --- a/meta-bsp/recipes-extended/xen/xen-phytium.inc +++ /dev/null @@ -1,15 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/files:" - -DEPENDS += "dtc-native virtual/kernel" - -do_deploy[depends] += "virtual/kernel:do_deploy" - -BLOB_LOADADDRESS ?= "0x8000" -DTB_NAME:d2000 = "d2000-devboard-dsk.dtb" -DTB_NAME:ft2004-evm = "ft2004-devboard-d4-dsk.dtb" -do_deploy:append() { - if [ -f ${DEPLOYDIR}/xen-${MACHINE} ]; then - dtc -I dtb -O dts ${DEPLOY_DIR_IMAGE}/${DTB_NAME} > ${DEPLOY_DIR_IMAGE}/xen.dts - dtc -I dts -O dtb -S ${BLOB_LOADADDRESS} ${DEPLOY_DIR_IMAGE}/xen.dts > ${DEPLOY_DIR_IMAGE}/xen.dtb - fi -} diff --git a/meta-bsp/recipes-extended/xen/xen_4.15.bbappend b/meta-bsp/recipes-extended/xen/xen_4.15.bbappend deleted file mode 100644 index 626ee03..0000000 --- a/meta-bsp/recipes-extended/xen/xen_4.15.bbappend +++ /dev/null @@ -1 +0,0 @@ -include xen-phytium.inc diff --git a/meta-bsp/recipes-external/glibc/glibc-external.bbappend b/meta-bsp/recipes-external/glibc/glibc-external.bbappend new file mode 100644 index 0000000..f7f427f --- /dev/null +++ b/meta-bsp/recipes-external/glibc/glibc-external.bbappend @@ -0,0 +1,19 @@ +PROVIDES += "glibc \ + virtual/linux-libc-headers \ + linux-libc-headers \ + virtual/libc \ + virtual/libintl \ + virtual/libiconv" + +glibc_external_do_install_extra:append () { + install ${EXTERNAL_TOOLCHAIN}/sysroots/aarch64-phy-linux/usr/include/sys/ucontext-64.h ${D}/usr/include/sys/ + install ${EXTERNAL_TOOLCHAIN}/sysroots/aarch64-phy-linux/usr/include/sys/procfs-64.h ${D}/usr/include/sys/ + install ${EXTERNAL_TOOLCHAIN}/sysroots/aarch64-phy-linux/usr/include/sys/user-64.h ${D}/usr/include/sys/ + install ${EXTERNAL_TOOLCHAIN}/sysroots/aarch64-phy-linux/usr/include/sys/ptrace-64.h ${D}/usr/include/sys/ +} +FILES:${PN}-dev += "\ + ${includedir}/sys/ucontext-64.h \ + ${includedir}/sys/procfs-64.h \ + ${includedir}/sys/user-64.h \ + ${includedir}/sys/ptrace-64.h \ +" diff --git a/meta-bsp/recipes-gnome/gdm/gdm_%.bbappend b/meta-bsp/recipes-gnome/gdm/gdm_%.bbappend new file mode 100644 index 0000000..048db4f --- /dev/null +++ b/meta-bsp/recipes-gnome/gdm/gdm_%.bbappend @@ -0,0 +1,5 @@ +do_install:append() { + sed -i '7i\AutomaticLoginEnable = true' ${D}${sysconfdir}/gdm/custom.conf + sed -i '8i\AutomaticLogin = user' ${D}${sysconfdir}/gdm/custom.conf +} + diff --git a/meta-bsp/recipes-gnome/gnome-session/gnome-session/0001-start-gnome-session-through-gdm.patch b/meta-bsp/recipes-gnome/gnome-session/gnome-session/0001-start-gnome-session-through-gdm.patch new file mode 100644 index 0000000..d101c58 --- /dev/null +++ b/meta-bsp/recipes-gnome/gnome-session/gnome-session/0001-start-gnome-session-through-gdm.patch @@ -0,0 +1,22 @@ +From 972bda02255c947e43c72db7a7abdef1bf739da4 Mon Sep 17 00:00:00 2001 +From: Guochunrong +Date: Tue, 20 May 2025 16:37:37 +0800 +Subject: [PATCH] start gnome-session through gdm + +Signed-off-by: Guochunrong +--- + data/gnome.desktop.in.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/data/gnome.desktop.in.in b/data/gnome.desktop.in.in +index 7eec1de..015beff 100644 +--- a/data/gnome.desktop.in.in ++++ b/data/gnome.desktop.in.in +@@ -6,3 +6,4 @@ TryExec=@bindir@/gnome-session + Type=Application + DesktopNames=GNOME + X-GDM-SessionRegisters=true ++X-GDM-BypassXsession=true +-- +2.34.1 + diff --git a/meta-bsp/recipes-gnome/gnome-session/gnome-session_%.bbappend b/meta-bsp/recipes-gnome/gnome-session/gnome-session_%.bbappend new file mode 100644 index 0000000..9d10a8c --- /dev/null +++ b/meta-bsp/recipes-gnome/gnome-session/gnome-session_%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-start-gnome-session-through-gdm.patch" diff --git a/meta-bsp/recipes-graphics/mesa/mesa_%.bbappend b/meta-bsp/recipes-graphics/mesa/mesa_%.bbappend index 1ff34a8..9ee8ceb 100644 --- a/meta-bsp/recipes-graphics/mesa/mesa_%.bbappend +++ b/meta-bsp/recipes-graphics/mesa/mesa_%.bbappend @@ -1,14 +1,11 @@ -PACKAGECONFIG:append = " r600 gallium-llvm \ - ${@bb.utils.contains('MACHINE_FEATURES', 'x100', 'glvnd', '', d)} \ +PACKAGECONFIG:append = "${@bb.utils.contains('MACHINE_FEATURES', 'x100', 'glvnd', '', d)} \ " PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'glvnd', 'virtual/libglx', '', d)} " PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd" PACKAGES += " libglx-mesa libglx-mesa-dev" -python () { - d.setVar("GALLIUMDRIVERS", "swrast,r300,r600,radeonsi") -} do_install:append () { rm -f ${D}${libdir}/libGLX* } + diff --git a/meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor_egl-Don-t-initialize-on-softpipe.patch b/meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor_egl-Don-t-initialize-on-softpipe.patch new file mode 100644 index 0000000..5857c62 --- /dev/null +++ b/meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor_egl-Don-t-initialize-on-softpipe.patch @@ -0,0 +1,29 @@ +From b4241725d47a9f6e3e3c16d2eae10dda17df3cbb Mon Sep 17 00:00:00 2001 +From: Guochunrong +Date: Tue, 15 Apr 2025 17:02:05 +0800 +Subject: [PATCH] glamor_egl: Don't initialize on softpipe + +Signed-off-by: Guochunrong +--- + glamor/glamor_egl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c +index 6e0fc65..8689fe2 100644 +--- a/glamor/glamor_egl.c ++++ b/glamor/glamor_egl.c +@@ -1070,6 +1070,11 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) + } + } + ++ if (strstr((const char *)renderer, "softpipe")) { ++ xf86DrvMsg(scrn->scrnIndex, X_INFO, ++ "Refusing to try glamor on softpipe\n"); ++ goto error; ++ } + /* + * Force the next glamor_make_current call to set the right context + * (in case of multiple GPUs using glamor) +-- +2.34.1 + diff --git a/meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend new file mode 100644 index 0000000..26ad3b0 --- /dev/null +++ b/meta-bsp/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-glamor_egl-Don-t-initialize-on-softpipe.patch " diff --git a/meta-bsp/recipes-kernel/kernel-modules/rtl8821cs.bb b/meta-bsp/recipes-kernel/kernel-modules/rtl8821cs.bb new file mode 100644 index 0000000..1c774a6 --- /dev/null +++ b/meta-bsp/recipes-kernel/kernel-modules/rtl8821cs.bb @@ -0,0 +1,22 @@ +SUMMARY = "RTL8192CS kernel driver (wifi)" +DESCRIPTION = "RTL8192CS kernel driver" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" + +SRCREV = "bce547e2de6ef07cf7b51aeb3ec0cbc28c40c10a" +SRC_URI = "git://gitee.com/phytium_embedded/phytium-rogue-umlibs.git;subpath=rtl8821cs;protocol=https;branch=develop;destsuffix=git/" +S = "${WORKDIR}/git" + +inherit module + +do_configure:prepend () { + tar zxvf ${S}/rtl8821cs.tar.gz -C ${S}/ + mv ${S}/rtl8821cs/* ${S}/ + sed -i '2472i\ + modules_install:\ + $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules_install' Makefile + +} + +KERNEL_MODULE_AUTOLOAD = "8821cs" +EXTRA_OEMAKE:append = " KSRC=${STAGING_KERNEL_DIR}" diff --git a/meta-bsp/recipes-kernel/linux/files/0001-Makefile-fix-cannot-find-.h.patch b/meta-bsp/recipes-kernel/linux/files/0001-Makefile-fix-cannot-find-.h.patch deleted file mode 100644 index cb5bb94..0000000 --- a/meta-bsp/recipes-kernel/linux/files/0001-Makefile-fix-cannot-find-.h.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ff09b2ab84b8711382540d118ab68ec8f4b4d39f Mon Sep 17 00:00:00 2001 -From: jenkins -Date: Wed, 30 Aug 2023 13:45:01 +0800 -Subject: [PATCH] Makefile: fix cannot find *.h - -Signed-off-by: jenkins ---- - drivers/net/wireless/rtl8821cs/Makefile | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/wireless/rtl8821cs/Makefile b/drivers/net/wireless/rtl8821cs/Makefile -index 3103f5f52..5a6e12322 100644 ---- a/drivers/net/wireless/rtl8821cs/Makefile -+++ b/drivers/net/wireless/rtl8821cs/Makefile -@@ -20,8 +20,11 @@ ifeq ($(GCC_VER_49),1) - EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later - endif - --EXTRA_CFLAGS += -I$(src)/include -- -+EXTRA_CFLAGS += -I$(srctree)/include -+ccflags-y += -I$(srctree)/drivers/net/wireless/rtl8821cs/platform -+ccflags-y += -I$(srctree)/drivers/net/wireless/rtl8821cs/core/crypto -+ccflags-y += -I$(srctree)/drivers/net/wireless/rtl8821cs/hal/phydm -+ccflags-y += -I$(srctree)/drivers/net/wireless/rtl8821cs/include - EXTRA_LDFLAGS += --strip-debug - - CONFIG_AUTOCFG_CP = n --- -2.30.2 - diff --git a/meta-bsp/recipes-kernel/linux/linux-phytium-rt_4.19.bb b/meta-bsp/recipes-kernel/linux/linux-phytium-rt_4.19.bb index 25a016a..299e30b 100644 --- a/meta-bsp/recipes-kernel/linux/linux-phytium-rt_4.19.bb +++ b/meta-bsp/recipes-kernel/linux/linux-phytium-rt_4.19.bb @@ -3,4 +3,4 @@ require linux-phytium.inc LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" KERNEL_BRANCH = "linux-4.19-rt" -SRCREV = "499abe18c492325990c38df915c3f7dadda10293" +SRCREV = "c45781eabbdb730a202197baf3f22a486fb59cd3" diff --git a/meta-bsp/recipes-kernel/linux/linux-phytium-rt_5.10.bb b/meta-bsp/recipes-kernel/linux/linux-phytium-rt_5.10.bb index 22f0423..15ceb3c 100644 --- a/meta-bsp/recipes-kernel/linux/linux-phytium-rt_5.10.bb +++ b/meta-bsp/recipes-kernel/linux/linux-phytium-rt_5.10.bb @@ -3,8 +3,7 @@ require linux-phytium.inc LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" KERNEL_BRANCH = "linux-5.10-rt" -SRC_URI:append = " file://0001-Makefile-fix-cannot-find-.h.patch \ - file://0001-Makfile-add-dtbo.patch" +SRC_URI:append = " file://0001-Makfile-add-dtbo.patch" -SRCREV = "555b7182ffc491c617cdceed62db4bb7a529b0ac" +SRCREV = "b363ff25a2aa82a3f220123540a983c06a180db6" KERNEL_DEVICETREE:append = " phytium/px210.dtbo phytium/usb2_host_for_pe220x.dtbo" diff --git a/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bb b/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bb index 238de6e..f2a9d10 100644 --- a/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bb +++ b/meta-bsp/recipes-kernel/linux/linux-phytium_4.19.bb @@ -3,7 +3,7 @@ require linux-phytium.inc LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" KERNEL_BRANCH = "linux-4.19" -SRCREV = "3a7c49ff0b9662796d13f420611faa1fe4b28636" +SRCREV = "c7b904a3861d37d85c0a04d368deb0ee1b1b37fd" XEN_PATCHES = " file://xen.cfg" SRC_URI:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${XEN_PATCHES}', '', d)}" diff --git a/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bb b/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bb index abc1fae..3060ae0 100644 --- a/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bb +++ b/meta-bsp/recipes-kernel/linux/linux-phytium_5.10.bb @@ -3,10 +3,9 @@ require linux-phytium.inc LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" KERNEL_BRANCH = "linux-5.10" -SRCREV = "4d506631d5ff96122a2d3499f83790d43f4d0e24" +SRCREV = "cee620455f83bf02724b5aa6a579d60764089d0e" -SRC_URI:append = " file://0001-Makefile-fix-cannot-find-.h.patch \ - file://0001-Makfile-add-dtbo.patch" +SRC_URI:append = " file://0001-Makfile-add-dtbo.patch" DELTA_KERNEL_DEFCONFIG:prepend = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'phytium_optee.config', '', d)}" KERNEL_DEVICETREE:append = " phytium/px210.dtbo phytium/usb2_host_for_pe220x.dtbo" diff --git a/meta-bsp/recipes-multimedia/x264/x264.inc b/meta-bsp/recipes-multimedia/x264/x264.inc new file mode 100644 index 0000000..be6c4a7 --- /dev/null +++ b/meta-bsp/recipes-multimedia/x264/x264.inc @@ -0,0 +1,3 @@ +do_configure() { + ./configure ${EXTRA_OECONF} +} diff --git a/meta-bsp/recipes-multimedia/x264/x264_%.bbappend b/meta-bsp/recipes-multimedia/x264/x264_%.bbappend new file mode 100644 index 0000000..4dbf8c6 --- /dev/null +++ b/meta-bsp/recipes-multimedia/x264/x264_%.bbappend @@ -0,0 +1 @@ +require ${@oe.utils.conditional('TCMODE', 'external-oe-sdk', 'x264.inc', '', d)} diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch new file mode 100644 index 0000000..2379924 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch @@ -0,0 +1,38 @@ +From e0bf97eecfa601e08b9578f00b1000890284241a Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 27 Oct 2015 16:02:19 +0200 +Subject: [PATCH] FindGObjectIntrospection.cmake: prefix variables obtained + from pkg-config with PKG_CONFIG_SYSROOT_DIR + +See discussion at https://bugs.webkit.org/show_bug.cgi?id=232933 for +reasons why this is not approproiate for upstream submission. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin + +--- + Source/cmake/FindGObjectIntrospection.cmake | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Source/cmake/FindGObjectIntrospection.cmake b/Source/cmake/FindGObjectIntrospection.cmake +index be96814a..ae67b593 100644 +--- a/Source/cmake/FindGObjectIntrospection.cmake ++++ b/Source/cmake/FindGObjectIntrospection.cmake +@@ -16,7 +16,6 @@ + # Redistribution and use is allowed according to the terms of the BSD license. + + +- + find_package(PkgConfig QUIET) + if (PKG_CONFIG_FOUND) + if (PACKAGE_FIND_VERSION_COUNT GREATER 0) +@@ -30,6 +29,9 @@ if (PKG_CONFIG_FOUND) + pkg_get_variable(INTROSPECTION_GENERATE gobject-introspection-1.0 g_ir_generate) + pkg_get_variable(INTROSPECTION_GIRDIR gobject-introspection-1.0 girdir) + pkg_get_variable(INTROSPECTION_TYPELIBDIR gobject-introspection-1.0 typelibdir) ++ set(INTROSPECTION_SCANNER "$ENV{PKG_CONFIG_SYSROOT_DIR}${INTROSPECTION_SCANNER}") ++ set(INTROSPECTION_COMPILER "$ENV{PKG_CONFIG_SYSROOT_DIR}${INTROSPECTION_COMPILER}") ++ set(INTROSPECTION_GENERATE "$ENV{PKG_CONFIG_SYSROOT_DIR}${INTROSPECTION_GENERATE}") + set(INTROSPECTION_VERSION "${_pc_gir_VERSION}") + if (${INTROSPECTION_VERSION} VERSION_GREATER_EQUAL "1.59.1") + set(INTROSPECTION_HAVE_SOURCES_TOP_DIRS YES) diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/0001-Fix-build-without-opengl-or-es.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-Fix-build-without-opengl-or-es.patch new file mode 100644 index 0000000..0925695 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-Fix-build-without-opengl-or-es.patch @@ -0,0 +1,133 @@ +From 646e347c173dbb9782492ac7cb4f54b65533ba90 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Sun, 17 Oct 2021 20:49:21 +0000 +Subject: [PATCH] Fix build without opengl-or-es + +* fix build failure when opengl-or-es is disabled: + In file included from /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/webkitgtk/2.34.0-r0/webkitgtk-2.34.0/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:30, + from /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/webkitgtk/2.34.0-r0/build/DerivedSources/WebKit/unified-sources/UnifiedSource-54928a2b-36.cpp:1: + /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/webkitgtk/2.34.0-r0/webkitgtk-2.34.0/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:41:10: fatal error: WebCore/CoordinatedGraphicsLayer.h: No such file or directory + 41 | #include + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + compilation terminated. + +* the CoordinatedGraphicsLayer.h header installation is controled by + USE_COORDINATED_GRAPHICS in webkitgtk-2.34.0/Source/WebCore/platform/TextureMapper.cmake + but in Source/cmake/OptionsGTK.cmake USE_COORDINATED_GRAPHICS was enabled only inside + if (USE_OPENGL_OR_ES) + +Upstream-Status: Submitted [https://bugs.webkit.org/show_bug.cgi?id=232934] +--- + .../DrawingAreaProxyCoordinatedGraphics.cpp | 2 +- + .../DrawingAreaProxyCoordinatedGraphics.h | 2 +- + .../CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp | 2 +- + .../CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h | 2 +- + .../WebPage/CoordinatedGraphics/LayerTreeHost.cpp | 4 ++-- + .../WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h | 6 +++--- + 6 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp +index 038d9ee2..5e828a10 100644 +--- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp ++++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp +@@ -152,7 +152,7 @@ void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBa + #endif + } + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + void DrawingAreaProxyCoordinatedGraphics::adjustTransientZoom(double scale, FloatPoint origin) + { + send(Messages::DrawingArea::AdjustTransientZoom(scale, origin)); +diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h +index b23a45ff..cd263402 100644 +--- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h ++++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h +@@ -57,7 +57,7 @@ private: + void waitForBackingStoreUpdateOnNextPaint() override; + void setBackingStoreIsDiscardable(bool) override; + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + void adjustTransientZoom(double scale, WebCore::FloatPoint origin) override; + void commitTransientZoom(double scale, WebCore::FloatPoint origin) override; + #endif +diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp +index 33ac2e1d..42375784 100644 +--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp ++++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp +@@ -486,7 +486,7 @@ void DrawingAreaCoordinatedGraphics::didUpdate() + displayTimerFired(); + } + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + void DrawingAreaCoordinatedGraphics::adjustTransientZoom(double scale, FloatPoint origin) + { + if (!m_transientZoom) { +diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h +index d8dc6df7..c8322364 100644 +--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h ++++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h +@@ -84,7 +84,7 @@ private: + void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset) override; + void didUpdate() override; + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + void adjustTransientZoom(double scale, WebCore::FloatPoint origin) override; + void commitTransientZoom(double scale, WebCore::FloatPoint origin) override; + #endif +diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp +index f3304d10..ca0476ff 100644 +--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp ++++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp +@@ -156,7 +156,7 @@ void LayerTreeHost::layerFlushTimerFired() + + bool didSync = m_coordinator.flushPendingLayerChanges(flags); + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + // If we have an active transient zoom, we want the zoom to win over any changes + // that WebCore makes to the relevant layers, so re-apply our changes after flushing. + if (m_transientZoom) +@@ -453,7 +453,7 @@ void LayerTreeHost::renderNextFrame(bool forceRepaint) + } + } + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + FloatPoint LayerTreeHost::constrainTransientZoomOrigin(double scale, FloatPoint origin) const + { + FrameView& frameView = *m_webPage.mainFrameView(); +diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h +index 4f727e41..b070266e 100644 +--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h ++++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h +@@ -37,7 +37,7 @@ + #include + #include + #include +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + #include + #endif + +@@ -100,7 +100,7 @@ public: + + WebCore::PlatformDisplayID displayID() const { return m_displayID; } + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + void adjustTransientZoom(double, WebCore::FloatPoint); + void commitTransientZoom(double, WebCore::FloatPoint); + #endif +@@ -213,7 +213,7 @@ private: + #endif // USE(COORDINATED_GRAPHICS) + WebCore::PlatformDisplayID m_displayID; + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(COORDINATED_GRAPHICS) + bool m_transientZoom { false }; + double m_transientZoomScale { 1 }; + WebCore::FloatPoint m_transientZoomOrigin; diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch new file mode 100644 index 0000000..866e9d9 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch @@ -0,0 +1,47 @@ +From 1c7e7a385387d7febf633bbb6d2b99ece523e719 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Thu, 11 Aug 2016 17:13:51 +0300 +Subject: [PATCH] Tweak gtkdoc settings so that gtkdoc generation works under + OpenEmbedded build system + +This requires setting a few environment variables so that the transient +binary is build and linked correctly, and disabling the tweaks to RUN +variable from gtkdoc.py script so that our qemu wrapper is taken into use. + +Upstream-Status: Inappropriate [oe-specific] +Signed-off-by: Alexander Kanavin + +--- + Source/cmake/GtkDoc.cmake | 2 +- + Tools/gtkdoc/gtkdoc.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Source/cmake/GtkDoc.cmake b/Source/cmake/GtkDoc.cmake +index 18e86448..102c873a 100644 +--- a/Source/cmake/GtkDoc.cmake ++++ b/Source/cmake/GtkDoc.cmake +@@ -4,7 +4,7 @@ macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args) + add_custom_command( + OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}" + DEPENDS ${DocumentationDependencies} +- COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/gtkdoc/generate-gtkdoc ${_extra_args} ++ COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" "LD=${CMAKE_C_COMPILER}" "LDFLAGS=${CMAKE_C_LINK_FLAGS}" "RUN=${CMAKE_BINARY_DIR}/gtkdoc-qemuwrapper" ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/gtkdoc/generate-gtkdoc ${_extra_args} + COMMAND touch ${_stamp_name} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + VERBATIM +diff --git a/Tools/gtkdoc/gtkdoc.py b/Tools/gtkdoc/gtkdoc.py +index 054cafa1..416de7d1 100644 +--- a/Tools/gtkdoc/gtkdoc.py ++++ b/Tools/gtkdoc/gtkdoc.py +@@ -320,9 +320,9 @@ class GTKDoc(object): + additional_ldflags = '%s %s' % (additional_ldflags, arg) + ldflags = ' "-L%s" %s ' % (self.library_path, additional_ldflags) + ldflags + current_ld_library_path = env.get('LD_LIBRARY_PATH') +- if current_ld_library_path: ++ if current_ld_library_path and 'RUN' not in env: + env['LD_LIBRARY_PATH'] = '%s:%s' % (self.library_path, current_ld_library_path) +- else: ++ elif 'RUN' not in env: + env['LD_LIBRARY_PATH'] = self.library_path + + if ldflags: diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-do-not-quote-CFLAG.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-do-not-quote-CFLAG.patch new file mode 100644 index 0000000..3d02be9 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-do-not-quote-CFLAG.patch @@ -0,0 +1,78 @@ +From 01f5ab0edf3dd8f76d37fd36c2dcd3108be33a7b Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 4 Apr 2022 21:20:05 +0200 +Subject: [PATCH] When building introspection files, do not quote CFLAGS. + +This does not seem to be propagated to the compiler correctly: + +In file included from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.2.0/include-fixed/syslimits.h:7, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.2.0/include-fixed/limits.h:34, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/lib/glib-2.0/include/glibconfig.h:11, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/gtypes.h:32, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/galloca.h:32, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib.h:30, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/build/Source/JavaScriptCore/tmp-introspectb51ks33n/JavaScriptCore-4.0.c:2: +/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.2.0/include-fixed/limits.h:203:75: error: no include path in which to search for limits.h + 203 | #include_next /* recurse down to the real one */ + | ^ +In file included from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/galloca.h:32, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib.h:30, + from /srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/build/Source/JavaScriptCore/tmp-introspectb51ks33n/JavaScriptCore-4.0.c:2: +/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot/usr/include/glib-2.0/glib/gtypes.h:35:10: fatal error: time.h: No such file or directory + 35 | #include + | ^~~~~~~~ +compilation terminated. +Traceback (most recent call last): + File "/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/python3.10/distutils/unixccompiler.py", line 117, in _compile + self.spawn(compiler_so + cc_args + [src, '-o', obj] + + File "/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/python3.10/distutils/ccompiler.py", line 910, in spawn + spawn(cmd, dry_run=self.dry_run) + File "/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/lib/python3.10/distutils/spawn.py", line 91, in spawn + raise DistutilsExecError( +distutils.errors.DistutilsExecError: command '/srv/work/alex/poky/build-64-alt/tmp/work/core2-64-poky-linux/webkitgtk/2.36.0-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc' failed with exit code 1 + +Upstream-Status: Inappropriate [upstream has rewritten the whole thing as of https://github.com/WebKit/WebKit/commit/b0ae032850bb6b2672051bab8032fc9f9ef5eb97] +Signed-off-by: Alexander Kanavin +--- + Source/JavaScriptCore/PlatformGTK.cmake | 2 +- + Source/WebKit/PlatformGTK.cmake | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Source/JavaScriptCore/PlatformGTK.cmake b/Source/JavaScriptCore/PlatformGTK.cmake +index 1c3c8fb7..efd18807 100644 +--- a/Source/JavaScriptCore/PlatformGTK.cmake ++++ b/Source/JavaScriptCore/PlatformGTK.cmake +@@ -71,7 +71,7 @@ if (ENABLE_INTROSPECTION) + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir + DEPENDS JavaScriptCore +- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS="-Wno-deprecated-declarations ${CMAKE_C_FLAGS}" LDFLAGS= ++ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS= + ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}" + ${INTROSPECTION_SCANNER} + --quiet +diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake +index 48d1820d..ded05035 100644 +--- a/Source/WebKit/PlatformGTK.cmake ++++ b/Source/WebKit/PlatformGTK.cmake +@@ -675,7 +675,7 @@ if (ENABLE_INTROSPECTION) + add_custom_target(WebKit2-${WEBKITGTK_API_VERSION}-gir + DEPENDS WebKit + DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir +- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS="-Wno-deprecated-declarations ${CMAKE_C_FLAGS}" LDFLAGS= ++ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS= + ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}" + ${INTROSPECTION_SCANNER} + --quiet +@@ -721,7 +721,7 @@ if (ENABLE_INTROSPECTION) + OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir + DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir + DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir +- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS="-Wno-deprecated-declarations ${CMAKE_C_FLAGS}" ++ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} + LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}" + ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}" + ${INTROSPECTION_SCANNER} +-- +2.30.2 + diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch new file mode 100644 index 0000000..32f92f7 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch @@ -0,0 +1,296 @@ +From 0d3344e17d258106617b0e6d783d073b188a2548 Mon Sep 17 00:00:00 2001 +From: Adrian Perez de Castro +Date: Thu, 2 Jun 2022 11:19:06 +0300 +Subject: [PATCH] [ARM][NEON] FELightningNEON.cpp fails to build, NEON fast + path seems unused https://bugs.webkit.org/show_bug.cgi?id=241182 + +Reviewed by NOBODY (OOPS!). + +Move the NEON fast path for the SVG lighting filter effects into +FELightingSoftwareApplier, and arrange to actually use them by +forwarding calls to applyPlatformGeneric() into applyPlatformNeon(). + +Some changes were needed to adapt platformApplyNeon() to the current +state of filters after r286140. This was not detected because the code +bitrotted due to it being guarded with CPU(ARM_TRADITIONAL), which does +not get used much these days: CPU(ARM_THUMB2) is more common. It should +be possible to use the NEON fast paths also in Thumb mode, but that is +left for a follow-up fix. + +* Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp: +(WebCore::FELightingSoftwareApplier::platformApplyNeonWorker): +(WebCore::FELightingSoftwareApplier::getPowerCoefficients): +(WebCore::FELighting::platformApplyNeonWorker): Deleted. +(WebCore::FELighting::getPowerCoefficients): Deleted. +* Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h: +(WebCore::FELightingSoftwareApplier::applyPlatformNeon): +(WebCore::FELighting::platformApplyNeon): Deleted. +* Source/WebCore/platform/graphics/filters/DistantLightSource.h: +* Source/WebCore/platform/graphics/filters/FELighting.h: +* Source/WebCore/platform/graphics/filters/PointLightSource.h: +* Source/WebCore/platform/graphics/filters/SpotLightSource.h: +* Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h: +--- +Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/1233] +Signed-off-by: Khem Raj + + .../cpu/arm/filters/FELightingNEON.cpp | 4 +- + .../graphics/cpu/arm/filters/FELightingNEON.h | 54 +++++++++---------- + .../graphics/filters/DistantLightSource.h | 4 ++ + .../platform/graphics/filters/FELighting.h | 7 --- + .../graphics/filters/PointLightSource.h | 4 ++ + .../graphics/filters/SpotLightSource.h | 4 ++ + .../software/FELightingSoftwareApplier.h | 16 ++++++ + 7 files changed, 57 insertions(+), 36 deletions(-) + +--- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp ++++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp +@@ -49,7 +49,7 @@ short* feLightingConstantsForNeon() + return s_FELightingConstantsForNeon; + } + +-void FELighting::platformApplyNeonWorker(FELightingPaintingDataForNeon* parameters) ++void FELightingSoftwareApplier::platformApplyNeonWorker(FELightingPaintingDataForNeon* parameters) + { + neonDrawLighting(parameters); + } +@@ -464,7 +464,7 @@ TOSTRING(neonDrawLighting) ":" NL + "b .lightStrengthCalculated" NL + ); // NOLINT + +-int FELighting::getPowerCoefficients(float exponent) ++int FELightingSoftwareApplier::getPowerCoefficients(float exponent) + { + // Calling a powf function from the assembly code would require to save + // and reload a lot of NEON registers. Since the base is in range [0..1] +--- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h ++++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h +@@ -24,14 +24,15 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef FELightingNEON_h +-#define FELightingNEON_h ++#pragma once + + #if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE) + +-#include "FELighting.h" ++#include "FELightingSoftwareApplier.h" ++#include "ImageBuffer.h" + #include "PointLightSource.h" + #include "SpotLightSource.h" ++#include + #include + + namespace WebCore { +@@ -93,14 +94,14 @@ extern "C" { + void neonDrawLighting(FELightingPaintingDataForNeon*); + } + +-inline void FELighting::platformApplyNeon(const LightingData& data, const LightSource::PaintingData& paintingData) ++inline void FELightingSoftwareApplier::applyPlatformNeon(const FELightingSoftwareApplier::LightingData& data, const LightSource::PaintingData& paintingData) + { +- alignas(16) FELightingFloatArgumentsForNeon floatArguments; +- FELightingPaintingDataForNeon neonData = { ++ WebCore::FELightingFloatArgumentsForNeon alignas(16) floatArguments; ++ WebCore::FELightingPaintingDataForNeon neonData = { + data.pixels->data(), + 1, +- data.widthDecreasedByOne - 1, +- data.heightDecreasedByOne - 1, ++ data.width - 2, ++ data.height - 2, + 0, + 0, + 0, +@@ -111,23 +112,23 @@ inline void FELighting::platformApplyNeo + // Set light source arguments. + floatArguments.constOne = 1; + +- auto color = m_lightingColor.toColorTypeLossy>().resolved(); ++ auto color = data.lightingColor.toColorTypeLossy>().resolved(); + + floatArguments.colorRed = color.red; + floatArguments.colorGreen = color.green; + floatArguments.colorBlue = color.blue; + floatArguments.padding4 = 0; + +- if (m_lightSource->type() == LS_POINT) { ++ if (data.lightSource->type() == LS_POINT) { + neonData.flags |= FLAG_POINT_LIGHT; +- PointLightSource& pointLightSource = static_cast(m_lightSource.get()); ++ const auto& pointLightSource = *static_cast(data.lightSource); + floatArguments.lightX = pointLightSource.position().x(); + floatArguments.lightY = pointLightSource.position().y(); + floatArguments.lightZ = pointLightSource.position().z(); + floatArguments.padding2 = 0; +- } else if (m_lightSource->type() == LS_SPOT) { ++ } else if (data.lightSource->type() == LS_SPOT) { + neonData.flags |= FLAG_SPOT_LIGHT; +- SpotLightSource& spotLightSource = static_cast(m_lightSource.get()); ++ const auto& spotLightSource = *static_cast(data.lightSource); + floatArguments.lightX = spotLightSource.position().x(); + floatArguments.lightY = spotLightSource.position().y(); + floatArguments.lightZ = spotLightSource.position().z(); +@@ -145,7 +146,7 @@ inline void FELighting::platformApplyNeo + if (spotLightSource.specularExponent() == 1) + neonData.flags |= FLAG_CONE_EXPONENT_IS_1; + } else { +- ASSERT(m_lightSource->type() == LS_DISTANT); ++ ASSERT(data.lightSource->type() == LS_DISTANT); + floatArguments.lightX = paintingData.initialLightingData.lightVector.x(); + floatArguments.lightY = paintingData.initialLightingData.lightVector.y(); + floatArguments.lightZ = paintingData.initialLightingData.lightVector.z(); +@@ -155,38 +156,39 @@ inline void FELighting::platformApplyNeo + // Set lighting arguments. + floatArguments.surfaceScale = data.surfaceScale; + floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4; +- if (m_lightingType == FELighting::DiffuseLighting) +- floatArguments.diffuseConstant = m_diffuseConstant; ++ if (data.filterType == FilterEffect::Type::FEDiffuseLighting) ++ floatArguments.diffuseConstant = data.diffuseConstant; + else { + neonData.flags |= FLAG_SPECULAR_LIGHT; +- floatArguments.diffuseConstant = m_specularConstant; +- neonData.specularExponent = getPowerCoefficients(m_specularExponent); +- if (m_specularExponent == 1) ++ floatArguments.diffuseConstant = data.specularConstant; ++ neonData.specularExponent = getPowerCoefficients(data.specularExponent); ++ if (data.specularExponent == 1) + neonData.flags |= FLAG_SPECULAR_EXPONENT_IS_1; + } + if (floatArguments.diffuseConstant == 1) + neonData.flags |= FLAG_DIFFUSE_CONST_IS_1; + +- int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension; ++ static constexpr int minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs ++ int optimalThreadNumber = ((data.width - 2) * (data.height - 2)) / minimalRectDimension; + if (optimalThreadNumber > 1) { + // Initialize parallel jobs +- ParallelJobs parallelJobs(&WebCore::FELighting::platformApplyNeonWorker, optimalThreadNumber); ++ ParallelJobs parallelJobs(&FELightingSoftwareApplier::platformApplyNeonWorker, optimalThreadNumber); + + // Fill the parameter array + int job = parallelJobs.numberOfJobs(); + if (job > 1) { + int yStart = 1; +- int yStep = (data.heightDecreasedByOne - 1) / job; ++ int yStep = (data.height - 2) / job; + for (--job; job >= 0; --job) { + FELightingPaintingDataForNeon& params = parallelJobs.parameter(job); + params = neonData; + params.yStart = yStart; +- params.pixels += (yStart - 1) * (data.widthDecreasedByOne + 1) * 4; ++ params.pixels += (yStart - 1) * data.width * 4; + if (job > 0) { + params.absoluteHeight = yStep; + yStart += yStep; + } else +- params.absoluteHeight = data.heightDecreasedByOne - yStart; ++ params.absoluteHeight = (data.height - 1) - yStart; + } + parallelJobs.execute(); + return; +@@ -199,5 +201,3 @@ inline void FELighting::platformApplyNeo + } // namespace WebCore + + #endif // CPU(ARM_NEON) && COMPILER(GCC_COMPATIBLE) +- +-#endif // FELightingNEON_h +--- a/Source/WebCore/platform/graphics/filters/DistantLightSource.h ++++ b/Source/WebCore/platform/graphics/filters/DistantLightSource.h +@@ -25,6 +25,10 @@ + #include "LightSource.h" + #include + ++namespace WTF { ++class TextStream; ++} // namespace WTF ++ + namespace WebCore { + + class DistantLightSource : public LightSource { +--- a/Source/WebCore/platform/graphics/filters/FELighting.h ++++ b/Source/WebCore/platform/graphics/filters/FELighting.h +@@ -35,8 +35,6 @@ + + namespace WebCore { + +-struct FELightingPaintingDataForNeon; +- + class FELighting : public FilterEffect { + public: + const Color& lightingColor() const { return m_lightingColor; } +@@ -67,11 +65,6 @@ protected: + + std::unique_ptr createSoftwareApplier() const override; + +-#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE) +- static int getPowerCoefficients(float exponent); +- inline void platformApplyNeon(const LightingData&, const LightSource::PaintingData&); +-#endif +- + Color m_lightingColor; + float m_surfaceScale; + float m_diffuseConstant; +--- a/Source/WebCore/platform/graphics/filters/PointLightSource.h ++++ b/Source/WebCore/platform/graphics/filters/PointLightSource.h +@@ -26,6 +26,10 @@ + #include "LightSource.h" + #include + ++namespace WTF { ++class TextStream; ++} // namespace WTF ++ + namespace WebCore { + + class PointLightSource : public LightSource { +--- a/Source/WebCore/platform/graphics/filters/SpotLightSource.h ++++ b/Source/WebCore/platform/graphics/filters/SpotLightSource.h +@@ -26,6 +26,10 @@ + #include "LightSource.h" + #include + ++namespace WTF { ++class TextStream; ++} // namespace WTF ++ + namespace WebCore { + + class SpotLightSource : public LightSource { +--- a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h ++++ b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h +@@ -36,6 +36,7 @@ + namespace WebCore { + + class FELighting; ++struct FELightingPaintingDataForNeon; + + class FELightingSoftwareApplier final : public FilterEffectConcreteApplier { + WTF_MAKE_FAST_ALLOCATED; +@@ -132,8 +133,23 @@ private: + + static void applyPlatformGenericPaint(const LightingData&, const LightSource::PaintingData&, int startY, int endY); + static void applyPlatformGenericWorker(ApplyParameters*); ++ ++#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE) ++ static int getPowerCoefficients(float exponent); ++ static void platformApplyNeonWorker(FELightingPaintingDataForNeon*); ++ inline static void applyPlatformNeon(const LightingData&, const LightSource::PaintingData&); ++ ++ inline static void applyPlatformGeneric(const LightingData& data, const LightSource::PaintingData& paintingData) ++ { ++ applyPlatformNeon(data, paintingData); ++ } ++#else + static void applyPlatformGeneric(const LightingData&, const LightSource::PaintingData&); ++#endif ++ + static void applyPlatform(const LightingData&); + }; + + } // namespace WebCore ++ ++#include "FELightingNEON.h" diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32888.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32888.patch new file mode 100644 index 0000000..1a6b685 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32888.patch @@ -0,0 +1,41 @@ +CVE: CVE-2022-32888 +Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/a3dd7dc] + +[1]: https://support.apple.com/en-us/HT213446 +[2]: https://bugs.webkit.org/show_bug.cgi?id=242047 + +Signed-off-by: Kai Kang + +From a3dd7dc5f60b87a7cfd14c372e40ebd339076763 Mon Sep 17 00:00:00 2001 +From: Yusuke Suzuki +Date: Mon, 27 Jun 2022 21:34:55 -0700 +Subject: [PATCH] [JSC] Drop wasm stale assertion + https://bugs.webkit.org/show_bug.cgi?id=242047 rdar://95866655 + +Reviewed by Mark Lam. + +This patch drops stale assertion in addDelegateToUnreachable. + +* Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp: +(JSC::Wasm::LLIntGenerator::addDelegateToUnreachable): + +Canonical link: https://commits.webkit.org/251902@main +--- + Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp b/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp +index 39fb39b3331f..d0d2b9725991 100644 +--- a/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp ++++ b/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp +@@ -1182,7 +1182,6 @@ auto LLIntGenerator::addDelegateToUnreachable(ControlType& target, ControlType& + + ControlTry& tryData = std::get(data); + m_codeBlock->addExceptionHandler({ HandlerType::Delegate, tryData.m_try->location(), delegateLabel->location(), 0, m_tryDepth, targetDepth }); +- checkConsistency(); + return { }; + } + +-- +2.34.1 + diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32923.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32923.patch new file mode 100644 index 0000000..60342a1 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-32923.patch @@ -0,0 +1,435 @@ +CVE: CVE-2022-32923 +Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/ef76e31] + +[1]: https://support.apple.com/en-us/HT213495 +[2]: https://bugs.webkit.org/show_bug.cgi?id=242964 + +Signed-off-by: Kai Kang + +From ef76e31a2a066c3d65a9c94a9e2cd88133260c1f Mon Sep 17 00:00:00 2001 +From: Yusuke Suzuki +Date: Wed, 20 Jul 2022 19:30:48 -0700 +Subject: [PATCH] [JSC] BakcwardPropagationPhase should carry NaN / Infinity + handling https://bugs.webkit.org/show_bug.cgi?id=242964 rdar://96791603 + +Reviewed by Mark Lam. + +For correctness, we should carry NaN / Infinity handling to make it more clear in the code generation site. + +* Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp: +(JSC::DFG::BackwardsPropagationPhase::propagate): +* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp: +(JSC::DFG::FixupPhase::fixupArithDivInt32): +(JSC::DFG::FixupPhase::fixupArithDiv): +* Source/JavaScriptCore/dfg/DFGGraph.h: +* Source/JavaScriptCore/dfg/DFGNode.h: +* Source/JavaScriptCore/dfg/DFGNodeFlags.cpp: +(JSC::DFG::dumpNodeFlags): +* Source/JavaScriptCore/dfg/DFGNodeFlags.h: +(JSC::DFG::bytecodeCanIgnoreNaNAndInfinity): +(JSC::DFG::nodeCanSpeculateInt32ForDiv): +* Source/JavaScriptCore/dfg/DFGNodeType.h: + +Canonical link: https://commits.webkit.org/252675@main +--- + .../dfg/DFGBackwardsPropagationPhase.cpp | 51 +++++++++++-------- + Source/JavaScriptCore/dfg/DFGFixupPhase.cpp | 6 ++- + Source/JavaScriptCore/dfg/DFGGraph.h | 11 ++++ + Source/JavaScriptCore/dfg/DFGNode.h | 12 +++-- + Source/JavaScriptCore/dfg/DFGNodeFlags.cpp | 10 ++-- + Source/JavaScriptCore/dfg/DFGNodeFlags.h | 37 +++++++++++--- + Source/JavaScriptCore/dfg/DFGNodeType.h | 3 +- + 7 files changed, 91 insertions(+), 39 deletions(-) + +diff --git a/Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp +index 306ea5d6b974..83a08aff7c20 100644 +--- a/Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp ++++ b/Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp +@@ -272,7 +272,7 @@ private: + case ValueBitNot: + case ArithBitNot: { + flags |= NodeBytecodeUsesAsInt; +- flags &= ~(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeUsesAsOther); ++ flags &= ~(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity | NodeBytecodeUsesAsOther); + flags &= ~NodeBytecodeUsesAsArrayIndex; + node->child1()->mergeFlags(flags); + break; +@@ -291,7 +291,7 @@ private: + case BitURShift: + case ArithIMul: { + flags |= NodeBytecodeUsesAsInt; +- flags &= ~(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeUsesAsOther); ++ flags &= ~(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity | NodeBytecodeUsesAsOther); + flags &= ~NodeBytecodeUsesAsArrayIndex; + node->child1()->mergeFlags(flags); + node->child2()->mergeFlags(flags); +@@ -308,9 +308,9 @@ private: + + case StringSlice: { + node->child1()->mergeFlags(NodeBytecodeUsesAsValue); +- node->child2()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex); ++ node->child2()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex | NodeBytecodeNeedsNaNOrInfinity); + if (node->child3()) +- node->child3()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex); ++ node->child3()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex | NodeBytecodeNeedsNaNOrInfinity); + break; + } + +@@ -320,11 +320,11 @@ private: + if (node->numChildren() == 2) + m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsValue); + else if (node->numChildren() == 3) { +- m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex); ++ m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex | NodeBytecodeNeedsNaNOrInfinity); + m_graph.varArgChild(node, 2)->mergeFlags(NodeBytecodeUsesAsValue); + } else if (node->numChildren() == 4) { +- m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex); +- m_graph.varArgChild(node, 2)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex); ++ m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex | NodeBytecodeNeedsNaNOrInfinity); ++ m_graph.varArgChild(node, 2)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex | NodeBytecodeNeedsNaNOrInfinity); + m_graph.varArgChild(node, 3)->mergeFlags(NodeBytecodeUsesAsValue); + } + break; +@@ -345,6 +345,7 @@ private: + flags |= NodeBytecodeUsesAsNumber; + if (!m_allowNestedOverflowingAdditions) + flags |= NodeBytecodeUsesAsNumber; ++ flags |= NodeBytecodeNeedsNaNOrInfinity; + + node->child1()->mergeFlags(flags); + node->child2()->mergeFlags(flags); +@@ -359,6 +360,7 @@ private: + flags |= NodeBytecodeUsesAsNumber; + if (!m_allowNestedOverflowingAdditions) + flags |= NodeBytecodeUsesAsNumber; ++ flags |= NodeBytecodeNeedsNaNOrInfinity; + + node->child1()->mergeFlags(flags); + node->child2()->mergeFlags(flags); +@@ -366,7 +368,7 @@ private: + } + + case ArithClz32: { +- flags &= ~(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeUsesAsOther | ~NodeBytecodeUsesAsArrayIndex); ++ flags &= ~(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity | NodeBytecodeUsesAsOther | ~NodeBytecodeUsesAsArrayIndex); + flags |= NodeBytecodeUsesAsInt; + node->child1()->mergeFlags(flags); + break; +@@ -380,6 +382,7 @@ private: + flags |= NodeBytecodeUsesAsNumber; + if (!m_allowNestedOverflowingAdditions) + flags |= NodeBytecodeUsesAsNumber; ++ flags |= NodeBytecodeNeedsNaNOrInfinity; + + node->child1()->mergeFlags(flags); + node->child2()->mergeFlags(flags); +@@ -387,6 +390,7 @@ private: + } + + case ArithNegate: { ++ // negation does not care about NaN, Infinity, -Infinity are converted into 0 if the result is evaluated under the integer context. + flags &= ~NodeBytecodeUsesAsOther; + + node->child1()->mergeFlags(flags); +@@ -401,6 +405,7 @@ private: + flags |= NodeBytecodeUsesAsNumber; + if (!m_allowNestedOverflowingAdditions) + flags |= NodeBytecodeUsesAsNumber; ++ flags |= NodeBytecodeNeedsNaNOrInfinity; + + node->child1()->mergeFlags(flags); + break; +@@ -421,7 +426,7 @@ private: + + node->mergeFlags(flags); + +- flags |= NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero; ++ flags |= NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity; + flags &= ~NodeBytecodeUsesAsOther; + + node->child1()->mergeFlags(flags); +@@ -431,7 +436,13 @@ private: + + case ValueDiv: + case ArithDiv: { +- flags |= NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero; ++ // ArithDiv / ValueDiv need to have NodeBytecodeUsesAsNumber even if it is used in the context of integer. ++ // For example, ++ // ((@x / @y) + @z) | 0 ++ // In this context, (@x / @y) can have integer context at first, but the result can be different if div ++ // generates NaN. Div and Mod are operations that can produce NaN / Infinity though only taking binary Int32 operands. ++ // Thus, we always need to check for overflow since it can affect downstream calculations. ++ flags |= NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity; + flags &= ~NodeBytecodeUsesAsOther; + + node->child1()->mergeFlags(flags); +@@ -441,7 +452,7 @@ private: + + case ValueMod: + case ArithMod: { +- flags |= NodeBytecodeUsesAsNumber; ++ flags |= NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity; + flags &= ~NodeBytecodeUsesAsOther; + + node->child1()->mergeFlags(flags); +@@ -452,7 +463,7 @@ private: + case EnumeratorGetByVal: + case GetByVal: { + m_graph.varArgChild(node, 0)->mergeFlags(NodeBytecodeUsesAsValue); +- m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex); ++ m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeNeedsNaNOrInfinity | NodeBytecodeUsesAsArrayIndex); + break; + } + +@@ -461,13 +472,13 @@ private: + // Negative zero is not observable. NaN versus undefined are only observable + // in that you would get a different exception message. So, like, whatever: we + // claim here that NaN v. undefined is observable. +- node->child1()->mergeFlags(NodeBytecodeUsesAsInt | NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsArrayIndex); ++ node->child1()->mergeFlags(NodeBytecodeUsesAsInt | NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeNeedsNaNOrInfinity | NodeBytecodeUsesAsArrayIndex); + break; + } + + case ToString: + case CallStringConstructor: { +- node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther); ++ node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeNeedsNaNOrInfinity); + break; + } + +@@ -487,15 +498,15 @@ private: + case CompareBelowEq: + case CompareEq: + case CompareStrictEq: { +- node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther); +- node->child2()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther); ++ node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeNeedsNaNOrInfinity); ++ node->child2()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeNeedsNaNOrInfinity); + break; + } + + case PutByValDirect: + case PutByVal: { + m_graph.varArgChild(node, 0)->mergeFlags(NodeBytecodeUsesAsValue); +- m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex); ++ m_graph.varArgChild(node, 1)->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex | NodeBytecodeNeedsNaNOrInfinity); + m_graph.varArgChild(node, 2)->mergeFlags(NodeBytecodeUsesAsValue); + break; + } +@@ -508,20 +519,20 @@ private: + // then -0 and 0 are treated the same. We don't need NodeBytecodeUsesAsOther + // because if all of the cases are integers then NaN and undefined are + // treated the same (i.e. they will take default). +- node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsInt); ++ node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsInt | NodeBytecodeNeedsNaNOrInfinity); + break; + case SwitchChar: { + // We don't need NodeBytecodeNeedsNegZero because if the cases are all strings + // then -0 and 0 are treated the same. We don't need NodeBytecodeUsesAsOther + // because if all of the cases are single-character strings then NaN + // and undefined are treated the same (i.e. they will take default). +- node->child1()->mergeFlags(NodeBytecodeUsesAsNumber); ++ node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNaNOrInfinity); + break; + } + case SwitchString: + // We don't need NodeBytecodeNeedsNegZero because if the cases are all strings + // then -0 and 0 are treated the same. +- node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther); ++ node->child1()->mergeFlags(NodeBytecodeUsesAsNumber | NodeBytecodeUsesAsOther | NodeBytecodeNeedsNaNOrInfinity); + break; + case SwitchCell: + // There is currently no point to being clever here since this is used for switching +diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp +index e8bee58ada15..b679539de2e6 100644 +--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp ++++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp +@@ -81,7 +81,9 @@ private: + if (optimizeForX86() || optimizeForARM64() || optimizeForARMv7IDIVSupported()) { + fixIntOrBooleanEdge(leftChild); + fixIntOrBooleanEdge(rightChild); +- if (bytecodeCanTruncateInteger(node->arithNodeFlags())) ++ // We need to be careful about skipping overflow check because div / mod can generate non integer values ++ // from (Int32, Int32) inputs. For now, we always check non-zero divisor. ++ if (bytecodeCanTruncateInteger(node->arithNodeFlags()) && bytecodeCanIgnoreNaNAndInfinity(node->arithNodeFlags()) && bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) + node->setArithMode(Arith::Unchecked); + else if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) + node->setArithMode(Arith::CheckOverflow); +@@ -122,7 +124,7 @@ private: + + void fixupArithDiv(Node* node, Edge& leftChild, Edge& rightChild) + { +- if (m_graph.binaryArithShouldSpeculateInt32(node, FixupPass)) { ++ if (m_graph.divShouldSpeculateInt32(node, FixupPass)) { + fixupArithDivInt32(node, leftChild, rightChild); + return; + } +diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h +index ca566d3a484e..284c87672849 100644 +--- a/Source/JavaScriptCore/dfg/DFGGraph.h ++++ b/Source/JavaScriptCore/dfg/DFGGraph.h +@@ -373,6 +373,17 @@ public: + + return shouldSpeculateInt52ForAdd(left) && shouldSpeculateInt52ForAdd(right); + } ++ ++ bool divShouldSpeculateInt32(Node* node, PredictionPass pass) ++ { ++ // Even if inputs are Int32, div can generate NaN or Infinity. ++ // Thus, Overflow in div can be caused by these non integer values as well as actual Int32 overflow. ++ Node* left = node->child1().node(); ++ Node* right = node->child2().node(); ++ ++ return Node::shouldSpeculateInt32OrBooleanForArithmetic(left, right) ++ && nodeCanSpeculateInt32ForDiv(node->arithNodeFlags(), node->sourceFor(pass)); ++ } + + bool binaryArithShouldSpeculateInt32(Node* node, PredictionPass pass) + { +diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h +index f9ff50658e93..04509a3846ca 100644 +--- a/Source/JavaScriptCore/dfg/DFGNode.h ++++ b/Source/JavaScriptCore/dfg/DFGNode.h +@@ -3308,21 +3308,25 @@ public: + out.printf(", @%u", child3()->index()); + } + +- NodeOrigin origin; ++ NO_UNIQUE_ADDRESS NodeOrigin origin; + ++private: ++ NO_UNIQUE_ADDRESS NodeType m_op; ++ ++ NO_UNIQUE_ADDRESS unsigned m_index { std::numeric_limits::max() }; ++ ++public: + // References to up to 3 children, or links to a variable length set of children. + AdjacencyList children; + + private: + friend class B3::SparseCollection; + +- unsigned m_index { std::numeric_limits::max() }; +- unsigned m_op : 10; // real type is NodeType +- unsigned m_flags : 21; + // The virtual register number (spill location) associated with this . + VirtualRegister m_virtualRegister; + // The number of uses of the result of this operation (+1 for 'must generate' nodes, which have side-effects). + unsigned m_refCount; ++ NodeFlags m_flags; + // The prediction ascribed to this node after propagation. + SpeculatedType m_prediction { SpecNone }; + // Immediate values, accesses type-checked via accessors above. +diff --git a/Source/JavaScriptCore/dfg/DFGNodeFlags.cpp b/Source/JavaScriptCore/dfg/DFGNodeFlags.cpp +index 88242947f6ef..0c53cd976c5c 100644 +--- a/Source/JavaScriptCore/dfg/DFGNodeFlags.cpp ++++ b/Source/JavaScriptCore/dfg/DFGNodeFlags.cpp +@@ -74,12 +74,14 @@ void dumpNodeFlags(PrintStream& actualOut, NodeFlags flags) + out.print(comma, "VarArgs"); + + if (flags & NodeResultMask) { +- if (!(flags & NodeBytecodeUsesAsNumber) && !(flags & NodeBytecodeNeedsNegZero)) ++ if (!(flags & NodeBytecodeUsesAsNumber)) + out.print(comma, "PureInt"); +- else if (!(flags & NodeBytecodeUsesAsNumber)) +- out.print(comma, "PureInt(w/ neg zero)"); +- else if (!(flags & NodeBytecodeNeedsNegZero)) ++ else + out.print(comma, "PureNum"); ++ if (flags & NodeBytecodeNeedsNegZero) ++ out.print(comma, "NeedsNegZero"); ++ if (flags & NodeBytecodeNeedsNaNOrInfinity) ++ out.print(comma, "NeedsNaNOrInfinity"); + if (flags & NodeBytecodeUsesAsOther) + out.print(comma, "UseAsOther"); + } +diff --git a/Source/JavaScriptCore/dfg/DFGNodeFlags.h b/Source/JavaScriptCore/dfg/DFGNodeFlags.h +index 2ebe3544f601..aa60db7e6ba0 100644 +--- a/Source/JavaScriptCore/dfg/DFGNodeFlags.h ++++ b/Source/JavaScriptCore/dfg/DFGNodeFlags.h +@@ -61,18 +61,19 @@ namespace JSC { namespace DFG { + #define NodeBytecodeUseBottom 0x00000 + #define NodeBytecodeUsesAsNumber 0x04000 // The result of this computation may be used in a context that observes fractional, or bigger-than-int32, results. + #define NodeBytecodeNeedsNegZero 0x08000 // The result of this computation may be used in a context that observes -0. +-#define NodeBytecodeUsesAsOther 0x10000 // The result of this computation may be used in a context that distinguishes between NaN and other things (like undefined). +-#define NodeBytecodeUsesAsInt 0x20000 // The result of this computation is known to be used in a context that prefers, but does not require, integer values. +-#define NodeBytecodeUsesAsArrayIndex 0x40000 // The result of this computation is known to be used in a context that strongly prefers integer values, to the point that we should avoid using doubles if at all possible. +-#define NodeBytecodeUsesAsValue (NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeUsesAsOther) +-#define NodeBytecodeBackPropMask (NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex) ++#define NodeBytecodeNeedsNaNOrInfinity 0x10000 // The result of this computation may be used in a context that observes NaN or Infinity. ++#define NodeBytecodeUsesAsOther 0x20000 // The result of this computation may be used in a context that distinguishes between NaN and other things (like undefined). ++#define NodeBytecodeUsesAsInt 0x40000 // The result of this computation is known to be used in a context that prefers, but does not require, integer values. ++#define NodeBytecodeUsesAsArrayIndex 0x80000 // The result of this computation is known to be used in a context that strongly prefers integer values, to the point that we should avoid using doubles if at all possible. ++#define NodeBytecodeUsesAsValue (NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity | NodeBytecodeUsesAsOther) ++#define NodeBytecodeBackPropMask (NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeNeedsNaNOrInfinity | NodeBytecodeUsesAsOther | NodeBytecodeUsesAsInt | NodeBytecodeUsesAsArrayIndex) + + #define NodeArithFlagsMask (NodeBehaviorMask | NodeBytecodeBackPropMask) + +-#define NodeIsFlushed 0x80000 // Computed by CPSRethreadingPhase, will tell you which local nodes are backwards-reachable from a Flush. ++#define NodeIsFlushed 0x100000 // Computed by CPSRethreadingPhase, will tell you which local nodes are backwards-reachable from a Flush. + +-#define NodeMiscFlag1 0x100000 +-#define NodeMiscFlag2 0x200000 ++#define NodeMiscFlag1 0x200000 ++#define NodeMiscFlag2 0x400000 + + typedef uint32_t NodeFlags; + +@@ -91,6 +92,11 @@ static inline bool bytecodeCanIgnoreNegativeZero(NodeFlags flags) + return !(flags & NodeBytecodeNeedsNegZero); + } + ++static inline bool bytecodeCanIgnoreNaNAndInfinity(NodeFlags flags) ++{ ++ return !(flags & NodeBytecodeNeedsNaNOrInfinity); ++} ++ + enum RareCaseProfilingSource { + BaselineRareCase, // Comes from slow case counting in the baseline JIT. + DFGRareCase, // Comes from OSR exit profiles. +@@ -147,6 +153,21 @@ static inline bool nodeCanSpeculateInt32(NodeFlags flags, RareCaseProfilingSourc + return true; + } + ++static inline bool nodeCanSpeculateInt32ForDiv(NodeFlags flags, RareCaseProfilingSource source) ++{ ++ if (nodeMayOverflowInt32(flags, source)) { ++ if (bytecodeUsesAsNumber(flags)) ++ return false; ++ if (!bytecodeCanIgnoreNaNAndInfinity(flags)) ++ return false; ++ } ++ ++ if (nodeMayNegZero(flags, source)) ++ return bytecodeCanIgnoreNegativeZero(flags); ++ ++ return true; ++} ++ + static inline bool nodeCanSpeculateInt52(NodeFlags flags, RareCaseProfilingSource source) + { + if (nodeMayOverflowInt52(flags, source)) +diff --git a/Source/JavaScriptCore/dfg/DFGNodeType.h b/Source/JavaScriptCore/dfg/DFGNodeType.h +index 8f885b570665..aad4d559ccf7 100644 +--- a/Source/JavaScriptCore/dfg/DFGNodeType.h ++++ b/Source/JavaScriptCore/dfg/DFGNodeType.h +@@ -567,7 +567,7 @@ namespace JSC { namespace DFG { + + // This enum generates a monotonically increasing id for all Node types, + // and is used by the subsequent enum to fill out the id (as accessed via the NodeIdMask). +-enum NodeType { ++enum NodeType : uint16_t { + #define DFG_OP_ENUM(opcode, flags) opcode, + FOR_EACH_DFG_OP(DFG_OP_ENUM) + #undef DFG_OP_ENUM +@@ -577,6 +577,7 @@ enum NodeType { + #define DFG_OP_COUNT(opcode, flags) + 1 + constexpr unsigned numberOfNodeTypes = FOR_EACH_DFG_OP(DFG_OP_COUNT); + #undef DFG_OP_COUNT ++static_assert(numberOfNodeTypes <= UINT16_MAX); + + // Specifies the default flags for each node. + inline NodeFlags defaultFlags(NodeType op) +-- +2.34.1 + diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-42867.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-42867.patch new file mode 100644 index 0000000..bf06809 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-42867.patch @@ -0,0 +1,104 @@ +From f67a882170609d15836204a689dc552322fbe653 Mon Sep 17 00:00:00 2001 +From: Yogita Urade +Date: Wed, 7 Jun 2023 08:15:11 +0000 +Subject: [oe-core][kirkstone][PATCH 1/1] RenderElement::updateFillImages + should take pointer arguments like other similar functions + https://bugs.webkit.org/show_bug.cgi?id=247317 rdar://100273147 + +Reviewed by Alan Baradlay. + +* Source/WebCore/rendering/RenderElement.cpp: +(WebCore::RenderElement::updateFillImages): +(WebCore::RenderElement::styleDidChange): +* Source/WebCore/rendering/RenderElement.h: + +Canonical link: https://commits.webkit.org/256215@main + +CVE: CVE-2022-42867 + +Upstream-Status: Backport +[https://github.com/WebKit/WebKit/commit/091a04e55c801ac6ba13f4b328fbee2eece853fc] + +Signed-off-by: Yogita Urade +--- + Source/WebCore/rendering/RenderElement.cpp | 27 ++++++++++++++-------- + Source/WebCore/rendering/RenderElement.h | 2 +- + 2 files changed, 19 insertions(+), 10 deletions(-) + +diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp +index da43bf3d..931686b8 100644 +--- a/Source/WebCore/rendering/RenderElement.cpp ++++ b/Source/WebCore/rendering/RenderElement.cpp +@@ -358,7 +358,7 @@ inline bool RenderElement::shouldRepaintForStyleDifference(StyleDifference diff) + return diff == StyleDifference::Repaint || (diff == StyleDifference::RepaintIfTextOrBorderOrOutline && hasImmediateNonWhitespaceTextChildOrBorderOrOutline()); + } + +-void RenderElement::updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers) ++void RenderElement::updateFillImages(const FillLayer* oldLayers, const FillLayer* newLayers) + { + auto fillImagesAreIdentical = [](const FillLayer* layer1, const FillLayer* layer2) -> bool { + if (layer1 == layer2) +@@ -379,7 +379,7 @@ void RenderElement::updateFillImages(const FillLayer* oldLayers, const FillLayer + }; + + auto isRegisteredWithNewFillImages = [&]() -> bool { +- for (auto* layer = &newLayers; layer; layer = layer->next()) { ++ for (auto* layer = newLayers; layer; layer = layer->next()) { + if (layer->image() && !layer->image()->hasClient(*this)) + return false; + } +@@ -388,11 +388,11 @@ void RenderElement::updateFillImages(const FillLayer* oldLayers, const FillLayer + + // If images have the same characteristics and this element is already registered as a + // client to the new images, there is nothing to do. +- if (fillImagesAreIdentical(oldLayers, &newLayers) && isRegisteredWithNewFillImages()) ++ if (fillImagesAreIdentical(oldLayers, newLayers) && isRegisteredWithNewFillImages()) + return; + + // Add before removing, to avoid removing all clients of an image that is in both sets. +- for (auto* layer = &newLayers; layer; layer = layer->next()) { ++ for (auto* layer = newLayers; layer; layer = layer->next()) { + if (layer->image()) + layer->image()->addClient(*this); + } +@@ -937,11 +937,20 @@ static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) + + void RenderElement::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) + { +- updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : nullptr, m_style.backgroundLayers()); +- updateFillImages(oldStyle ? &oldStyle->maskLayers() : nullptr, m_style.maskLayers()); +- updateImage(oldStyle ? oldStyle->borderImage().image() : nullptr, m_style.borderImage().image()); +- updateImage(oldStyle ? oldStyle->maskBoxImage().image() : nullptr, m_style.maskBoxImage().image()); +- updateShapeImage(oldStyle ? oldStyle->shapeOutside() : nullptr, m_style.shapeOutside()); ++ auto registerImages = [this](auto* style, auto* oldStyle) { ++ if (!style && !oldStyle) ++ return; ++ updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : nullptr, style ? &style->backgroundLayers() : nullptr); ++ updateFillImages(oldStyle ? &oldStyle->maskLayers() : nullptr, style ? &style->maskLayers() : nullptr); ++ updateImage(oldStyle ? oldStyle->borderImage().image() : nullptr, style ? style->borderImage().image() : nullptr); ++ updateImage(oldStyle ? oldStyle->maskBoxImage().image() : nullptr, style ? style->maskBoxImage().image() : nullptr); ++ updateShapeImage(oldStyle ? oldStyle->shapeOutside() : nullptr, style ? style->shapeOutside() : nullptr); ++ }; ++ ++ registerImages(&style(), oldStyle); ++ ++ // Are there other pseudo-elements that need the resources to be registered? ++ registerImages(style().getCachedPseudoStyle(PseudoId::FirstLine), oldStyle ? oldStyle->getCachedPseudoStyle(PseudoId::FirstLine) : nullptr); + + SVGRenderSupport::styleChanged(*this, oldStyle); + +diff --git a/Source/WebCore/rendering/RenderElement.h b/Source/WebCore/rendering/RenderElement.h +index f376cecb..d6ba2cdf 100644 +--- a/Source/WebCore/rendering/RenderElement.h ++++ b/Source/WebCore/rendering/RenderElement.h +@@ -349,7 +349,7 @@ private: + bool shouldRepaintForStyleDifference(StyleDifference) const; + bool hasImmediateNonWhitespaceTextChildOrBorderOrOutline() const; + +- void updateFillImages(const FillLayer*, const FillLayer&); ++ void updateFillImages(const FillLayer*, const FillLayer*); + void updateImage(StyleImage*, StyleImage*); + void updateShapeImage(const ShapeValue*, const ShapeValue*); + +-- +2.35.5 diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46691.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46691.patch new file mode 100644 index 0000000..ff9df40 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46691.patch @@ -0,0 +1,43 @@ +From fd57a49d07c9c285780495344073350182fd7c7c Mon Sep 17 00:00:00 2001 +From: Yijia Huang +Date: Mon, 10 Oct 2022 15:42:34 -0700 +Subject: [PATCH] [JSC] Should model BigInt with side effects + https://bugs.webkit.org/show_bug.cgi?id=246291 rdar://100494823 + +Reviewed by Yusuke Suzuki. + +Operations with two BigInt operands have side effects, +which should not be hoisted from loops. + +* Source/JavaScriptCore/dfg/DFGClobberize.cpp: +(JSC::DFG::doesWrites): +* Source/JavaScriptCore/dfg/DFGClobberize.h: +(JSC::DFG::clobberize): + +Canonical link: https://commits.webkit.org/255368@main + +CVE: CVE-2022-46691 + +Upstream-Status: Backport +[https://github.com/WebKit/WebKit/commit/fd57a49d07c9c285780495344073350182fd7c7c] + +Signed-off-by: Yogita Urade +--- + Source/JavaScriptCore/dfg/DFGClobberize.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Source/JavaScriptCore/dfg/DFGClobberize.h b/Source/JavaScriptCore/dfg/DFGClobberize.h +index 0363ab20dcd8..4b1bcfea1fd7 100644 +--- a/Source/JavaScriptCore/dfg/DFGClobberize.h ++++ b/Source/JavaScriptCore/dfg/DFGClobberize.h +@@ -811,6 +811,8 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu + case ValueBitRShift: + // FIXME: this use of single-argument isBinaryUseKind would prevent us from specializing (for example) for a HeapBigInt left-operand and a BigInt32 right-operand. + if (node->isBinaryUseKind(AnyBigIntUse) || node->isBinaryUseKind(BigInt32Use) || node->isBinaryUseKind(HeapBigIntUse)) { ++ read(World); ++ write(SideState); + def(PureValue(node)); + return; + } +-- +2.40.0 diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46699.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46699.patch new file mode 100644 index 0000000..0752b9c --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46699.patch @@ -0,0 +1,136 @@ +From 28686e63de0d3d7270a49b0d6b656467bc4fbf68 Mon Sep 17 00:00:00 2001 +From: Justin Michaud +Date: Wed, 9 Nov 2022 19:20:41 -0800 +Subject: [PATCH] Error() ICs should not cache special properties. + https://bugs.webkit.org/show_bug.cgi?id=247699 + +Reviewed by Yusuke Suzuki. + +HasOwnProperty/DeleteProperty are not always cacheable for special Error() +properties like column. These special properties are materialized on-demand +in materializeErrorInfoIfNeeded, but this function's behaviour can be changed +by Error.stackTraceLimit without causing a structure transition or firing watchpoints. + +That is, we cannot cache property misses, and we cannot assume HasOwnProperty is deterministic +for a given structure if we are using one of these properties. + +* Source/JavaScriptCore/runtime/ErrorInstance.cpp: +(JSC::ErrorInstance::deleteProperty): +* Source/JavaScriptCore/runtime/ErrorInstance.h: + +Canonical link: https://commits.webkit.org/256519@main + +CVE: CVE-2022-46699 + +Upstream-Status: Backport +[https://github.com/WebKit/WebKit/commit/28686e63de0d3d7270a49b0d6b656467bc4fbf68] + +Signed-off-by: Yogita Urade +--- + JSTests/stress/delete-cache-error.js | 19 ++++++++++++++++++ + .../get-own-property-slot-cache-error.js | 6 ++++++ + JSTests/stress/get-property-cache-error.js | 20 +++++++++++++++++++ + .../JavaScriptCore/runtime/ErrorInstance.cpp | 4 +++- + Source/JavaScriptCore/runtime/ErrorInstance.h | 3 ++- + 5 files changed, 50 insertions(+), 2 deletions(-) + create mode 100644 JSTests/stress/delete-cache-error.js + create mode 100644 JSTests/stress/get-own-property-slot-cache-error.js + create mode 100644 JSTests/stress/get-property-cache-error.js + +diff --git a/JSTests/stress/delete-cache-error.js b/JSTests/stress/delete-cache-error.js +new file mode 100644 +index 000000000000..d77c09185a13 +--- /dev/null ++++ b/JSTests/stress/delete-cache-error.js +@@ -0,0 +1,19 @@ ++delete Error.stackTraceLimit ++ ++// sourceURL is not materialized ++function cacheColumn(o) { ++ delete o.sourceURL ++} ++noInline(cacheColumn) ++ ++for (let i = 0; i < 200; ++i) { ++ let e = Error() ++ cacheColumn(e) ++ if (e.sourceURL !== undefined) ++ throw "Test failed on iteration " + i + " " + e.sourceURL ++ ++ if (i == 197) { ++ // now it is ++ Error.stackTraceLimit = 10 ++ } ++} +\ No newline at end of file +diff --git a/JSTests/stress/get-own-property-slot-cache-error.js b/JSTests/stress/get-own-property-slot-cache-error.js +new file mode 100644 +index 000000000000..f8202213bf79 +--- /dev/null ++++ b/JSTests/stress/get-own-property-slot-cache-error.js +@@ -0,0 +1,6 @@ ++delete Error.stackTraceLimit ++// GetOwnPropertySlot does not materializeErrorInfoIfNeeded because stackString is null. ++Object.hasOwn(Error(), "column") ++Error.stackTraceLimit = 10 ++// Now it does ++Object.hasOwn(Error(), "column") +\ No newline at end of file +diff --git a/JSTests/stress/get-property-cache-error.js b/JSTests/stress/get-property-cache-error.js +new file mode 100644 +index 000000000000..b35272ea6fe2 +--- /dev/null ++++ b/JSTests/stress/get-property-cache-error.js +@@ -0,0 +1,20 @@ ++// GetOwnPropertySlot does not materializeErrorInfoIfNeeded because stackString is null. ++delete Error.stackTraceLimit ++expected = undefined ++ ++function cacheColumn(o) { ++ return o.column ++} ++noInline(cacheColumn) ++ ++for (let i = 0; i < 1000; ++i) { ++ let val = cacheColumn(Error()) ++ if (val !== expected) ++ throw "Test failed on iteration " + i + ": " + val ++ ++ if (i == 900) { ++ // now it does ++ Error.stackTraceLimit = 10 ++ expected = 32 ++ } ++} +\ No newline at end of file +diff --git a/Source/JavaScriptCore/runtime/ErrorInstance.cpp b/Source/JavaScriptCore/runtime/ErrorInstance.cpp +index ddf96869e84a..8e5373257d34 100644 +--- a/Source/JavaScriptCore/runtime/ErrorInstance.cpp ++++ b/Source/JavaScriptCore/runtime/ErrorInstance.cpp +@@ -303,7 +303,9 @@ bool ErrorInstance::deleteProperty(JSCell* cell, JSGlobalObject* globalObject, P + { + VM& vm = globalObject->vm(); + ErrorInstance* thisObject = jsCast(cell); +- thisObject->materializeErrorInfoIfNeeded(vm, propertyName); ++ bool materializedProperties = thisObject->materializeErrorInfoIfNeeded(vm, propertyName); ++ if (materializedProperties) ++ slot.disableCaching(); + return Base::deleteProperty(thisObject, globalObject, propertyName, slot); + } + +diff --git a/Source/JavaScriptCore/runtime/ErrorInstance.h b/Source/JavaScriptCore/runtime/ErrorInstance.h +index 28807b4ea33e..2afb153a7442 100644 +--- a/Source/JavaScriptCore/runtime/ErrorInstance.h ++++ b/Source/JavaScriptCore/runtime/ErrorInstance.h +@@ -30,7 +30,8 @@ namespace JSC { + class ErrorInstance : public JSNonFinalObject { + public: + using Base = JSNonFinalObject; +- static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetOwnSpecialPropertyNames | OverridesPut; ++ ++ static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetOwnSpecialPropertyNames | OverridesPut | GetOwnPropertySlotIsImpureForPropertyAbsence; + static constexpr bool needsDestruction = true; + + static void destroy(JSCell* cell) +-- +2.40.0 diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch new file mode 100644 index 0000000..242b833 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch @@ -0,0 +1,67 @@ +From 86fbeb6fcd638e2350b09a43dde355f9830e75da Mon Sep 17 00:00:00 2001 +From: David Degazio +Date: Tue, 8 Nov 2022 19:54:33 -0800 +Subject: [PATCH] Intl.Locale.prototype.hourCycles leaks empty JSValue to + script https://bugs.webkit.org/show_bug.cgi?id=247562 rdar://102031379 + +Reviewed by Mark Lam. + +We currently don't check if IntlLocale::hourCycles returns a null JSArray, which allows it +to be encoded as an empty JSValue and exposed to user code. This patch throws a TypeError +when udatpg_open returns a failed status. + +* JSTests/stress/intl-locale-invalid-hourCycles.js: Added. +(main): +* Source/JavaScriptCore/runtime/IntlLocale.cpp: +(JSC::IntlLocale::hourCycles): + +Canonical link: https://commits.webkit.org/256473@main + +CVE:CVE-2022-46700 + +Upstream-Status: Backport +[https://github.com/WebKit/WebKit/commit/86fbeb6fcd638e2350b09a43dde355f9830e75da] + +Signed-off-by: Yogita Urade +--- + JSTests/stress/intl-locale-invalid-hourCycles.js | 12 ++++++++++++ + Source/JavaScriptCore/runtime/IntlLocale.cpp | 4 +++- + 2 files changed, 15 insertions(+), 1 deletion(-) + create mode 100644 JSTests/stress/intl-locale-invalid-hourCycles.js + +diff --git a/JSTests/stress/intl-locale-invalid-hourCycles.js b/JSTests/stress/intl-locale-invalid-hourCycles.js +new file mode 100644 +index 000000000000..7b94eb844764 +--- /dev/null ++++ b/JSTests/stress/intl-locale-invalid-hourCycles.js +@@ -0,0 +1,12 @@ ++function main() { ++ const v24 = new Intl.Locale("trimEnd", { 'numberingSystem': "foobar" }); ++ let empty = v24.hourCycles; ++ print(empty); ++} ++ ++try { ++ main(); ++} catch (e) { ++ if (!(e instanceof TypeError)) ++ throw e; ++} +diff --git a/Source/JavaScriptCore/runtime/IntlLocale.cpp b/Source/JavaScriptCore/runtime/IntlLocale.cpp +index c3c346163a18..bef424727a8a 100644 +--- a/Source/JavaScriptCore/runtime/IntlLocale.cpp ++++ b/Source/JavaScriptCore/runtime/IntlLocale.cpp +@@ -632,8 +632,10 @@ JSArray* IntlLocale::hourCycles(JSGlobalObject* globalObject) + + UErrorCode status = U_ZERO_ERROR; + auto generator = std::unique_ptr>(udatpg_open(m_localeID.data(), &status)); +- if (U_FAILURE(status)) ++ if (U_FAILURE(status)) { ++ throwTypeError(globalObject, scope, "invalid locale"_s); + return nullptr; ++ } + + // Use "j" skeleton and parse pattern to retrieve the configured hour-cycle information. + constexpr const UChar skeleton[] = { 'j', 0 }; +-- +2.40.0 diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-48503.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-48503.patch new file mode 100644 index 0000000..b677517 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2022-48503.patch @@ -0,0 +1,225 @@ +From 612c245823a515c8c70c2ad486957bd8a850f0f9 Mon Sep 17 00:00:00 2001 +From: Yusuke Suzuki +Date: Tue, 5 Sep 2023 08:40:19 +0000 +Subject: [PATCH] [JSC] Refactor wasm section ordering code + https://bugs.webkit.org/show_bug.cgi?id=241931 rdar://83326477 + +Reviewed by Keith Miller. + +This patch refactors existing validateOrder code since it is too adhoc right now. + +* Source/JavaScriptCore/wasm/WasmModuleInformation.h: +(JSC::Wasm::ModuleInformation::dataSegmentsCount const): +* Source/JavaScriptCore/wasm/WasmSectionParser.cpp: +(JSC::Wasm::SectionParser::parseData): +(JSC::Wasm::SectionParser::parseDataCount): +* Source/JavaScriptCore/wasm/WasmSectionParser.h: +* Source/JavaScriptCore/wasm/WasmSections.h: +(JSC::Wasm::orderingNumber): +(JSC::Wasm::isKnownSection): +(JSC::Wasm::validateOrder): +(JSC::Wasm::makeString): +* Source/JavaScriptCore/wasm/WasmStreamingParser.cpp: +(JSC::Wasm::StreamingParser::parseSectionPayload): +(JSC::Wasm::StreamingParser::finalize): + +Canonical link: https://commits.webkit.org/251800@main + +CVE: CVE-2022-48503 + +Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/612c245823a515c8c70c2ad486957bd8a850f0f9] + +Signed-off-by: Yogita Urade +--- + .../wasm/WasmModuleInformation.h | 4 +- + .../JavaScriptCore/wasm/WasmSectionParser.cpp | 3 ++ + .../JavaScriptCore/wasm/WasmSectionParser.h | 2 +- + Source/JavaScriptCore/wasm/WasmSections.h | 52 +++++++++++-------- + .../wasm/WasmStreamingParser.cpp | 11 +++- + 5 files changed, 45 insertions(+), 27 deletions(-) + +diff --git a/Source/JavaScriptCore/wasm/WasmModuleInformation.h b/Source/JavaScriptCore/wasm/WasmModuleInformation.h +index ae6bbeed..f9f1baf7 100644 +--- a/Source/JavaScriptCore/wasm/WasmModuleInformation.h ++++ b/Source/JavaScriptCore/wasm/WasmModuleInformation.h +@@ -86,7 +86,7 @@ struct ModuleInformation : public ThreadSafeRefCounted { + uint32_t memoryCount() const { return memory ? 1 : 0; } + uint32_t tableCount() const { return tables.size(); } + uint32_t elementCount() const { return elements.size(); } +- uint32_t dataSegmentsCount() const { return numberOfDataSegments; } ++ uint32_t dataSegmentsCount() const { return numberOfDataSegments.value_or(0); } + + const TableInformation& table(unsigned index) const { return tables[index]; } + +@@ -131,7 +131,7 @@ struct ModuleInformation : public ThreadSafeRefCounted { + Vector customSections; + Ref nameSection; + BranchHints branchHints; +- uint32_t numberOfDataSegments { 0 }; ++ std::optional numberOfDataSegments; + + BitVector m_declaredFunctions; + BitVector m_declaredExceptions; +diff --git a/Source/JavaScriptCore/wasm/WasmSectionParser.cpp b/Source/JavaScriptCore/wasm/WasmSectionParser.cpp +index 5b511811..c55ee3c0 100644 +--- a/Source/JavaScriptCore/wasm/WasmSectionParser.cpp ++++ b/Source/JavaScriptCore/wasm/WasmSectionParser.cpp +@@ -768,6 +768,8 @@ auto SectionParser::parseData() -> PartialResult + uint32_t segmentCount; + WASM_PARSER_FAIL_IF(!parseVarUInt32(segmentCount), "can't get Data section's count"); + WASM_PARSER_FAIL_IF(segmentCount > maxDataSegments, "Data section's count is too big ", segmentCount, " maximum ", maxDataSegments); ++ if (m_info->numberOfDataSegments) ++ WASM_PARSER_FAIL_IF(segmentCount != m_info->numberOfDataSegments.value(), "Data section's count ", segmentCount, " is different from Data Count section's count ", m_info->numberOfDataSegments.value()); + WASM_PARSER_FAIL_IF(!m_info->data.tryReserveCapacity(segmentCount), "can't allocate enough memory for Data section's ", segmentCount, " segments"); + + for (uint32_t segmentNumber = 0; segmentNumber < segmentCount; ++segmentNumber) { +@@ -847,6 +849,7 @@ auto SectionParser::parseDataCount() -> PartialResult + { + uint32_t numberOfDataSegments; + WASM_PARSER_FAIL_IF(!parseVarUInt32(numberOfDataSegments), "can't get Data Count section's count"); ++ WASM_PARSER_FAIL_IF(numberOfDataSegments > maxDataSegments, "Data Count section's count is too big ", numberOfDataSegments , " maximum ", maxDataSegments); + + m_info->numberOfDataSegments = numberOfDataSegments; + return { }; +diff --git a/Source/JavaScriptCore/wasm/WasmSectionParser.h b/Source/JavaScriptCore/wasm/WasmSectionParser.h +index 91fd3ed8..4d7dcbac 100644 +--- a/Source/JavaScriptCore/wasm/WasmSectionParser.h ++++ b/Source/JavaScriptCore/wasm/WasmSectionParser.h +@@ -44,7 +44,7 @@ public: + { + } + +-#define WASM_SECTION_DECLARE_PARSER(NAME, ID, DESCRIPTION) PartialResult WARN_UNUSED_RETURN parse ## NAME(); ++#define WASM_SECTION_DECLARE_PARSER(NAME, ID, ORDERING, DESCRIPTION) PartialResult WARN_UNUSED_RETURN parse ## NAME(); + FOR_EACH_KNOWN_WASM_SECTION(WASM_SECTION_DECLARE_PARSER) + #undef WASM_SECTION_DECLARE_PARSER + +diff --git a/Source/JavaScriptCore/wasm/WasmSections.h b/Source/JavaScriptCore/wasm/WasmSections.h +index bef20701..b422a587 100644 +--- a/Source/JavaScriptCore/wasm/WasmSections.h ++++ b/Source/JavaScriptCore/wasm/WasmSections.h +@@ -33,20 +33,21 @@ IGNORE_RETURN_TYPE_WARNINGS_BEGIN + + namespace JSC { namespace Wasm { + ++// macro(Name, ID, OrderingNumber, Description). + #define FOR_EACH_KNOWN_WASM_SECTION(macro) \ +- macro(Type, 1, "Function signature declarations") \ +- macro(Import, 2, "Import declarations") \ +- macro(Function, 3, "Function declarations") \ +- macro(Table, 4, "Indirect function table and other tables") \ +- macro(Memory, 5, "Memory attributes") \ +- macro(Global, 6, "Global declarations") \ +- macro(Export, 7, "Exports") \ +- macro(Start, 8, "Start function declaration") \ +- macro(Element, 9, "Elements section") \ +- macro(Code, 10, "Function bodies (code)") \ +- macro(Data, 11, "Data segments") \ +- macro(DataCount, 12, "Data count") \ +- macro(Exception, 13, "Exception declarations") \ ++ macro(Type, 1, 1, "Function signature declarations") \ ++ macro(Import, 2, 2, "Import declarations") \ ++ macro(Function, 3, 3, "Function declarations") \ ++ macro(Table, 4, 4, "Indirect function table and other tables") \ ++ macro(Memory, 5, 5, "Memory attributes") \ ++ macro(Global, 6, 7, "Global declarations") \ ++ macro(Export, 7, 8, "Exports") \ ++ macro(Start, 8, 9, "Start function declaration") \ ++ macro(Element, 9, 10, "Elements section") \ ++ macro(Code, 10, 12, "Function bodies (code)") \ ++ macro(Data, 11, 13, "Data segments") \ ++ macro(DataCount, 12, 11, "Data count") \ ++ macro(Exception, 13, 6, "Exception declarations") \ + + enum class Section : uint8_t { + // It's important that Begin is less than every other section number and that Custom is greater. +@@ -54,18 +55,29 @@ enum class Section : uint8_t { + // Also, Begin is not a real section but is used as a marker for validating the ordering + // of sections. + Begin = 0, +-#define DEFINE_WASM_SECTION_ENUM(NAME, ID, DESCRIPTION) NAME = ID, ++#define DEFINE_WASM_SECTION_ENUM(NAME, ID, ORDERING, DESCRIPTION) NAME = ID, + FOR_EACH_KNOWN_WASM_SECTION(DEFINE_WASM_SECTION_ENUM) + #undef DEFINE_WASM_SECTION_ENUM + Custom + }; + static_assert(static_cast(Section::Begin) < static_cast(Section::Type), "Begin should come before the first known section."); + ++inline unsigned orderingNumber(Section section) ++{ ++ switch (section) { ++#define ORDERING_OF_SECTION(NAME, ID, ORDERING, DESCRIPTION) case Section::NAME: return ORDERING; ++ FOR_EACH_KNOWN_WASM_SECTION(ORDERING_OF_SECTION) ++#undef VALIDATE_SECTION ++ default: ++ return static_cast(section); ++ } ++} ++ + template + inline bool isKnownSection(Int section) + { + switch (section) { +-#define VALIDATE_SECTION(NAME, ID, DESCRIPTION) case static_cast(Section::NAME): return true; ++#define VALIDATE_SECTION(NAME, ID, ORDERING, DESCRIPTION) case static_cast(Section::NAME): return true; + FOR_EACH_KNOWN_WASM_SECTION(VALIDATE_SECTION) + #undef VALIDATE_SECTION + default: +@@ -89,13 +101,7 @@ inline bool decodeSection(uint8_t sectionByte, Section& section) + inline bool validateOrder(Section previousKnown, Section next) + { + ASSERT(isKnownSection(previousKnown) || previousKnown == Section::Begin); +- if (previousKnown == Section::DataCount && next == Section::Code) +- return true; +- if (previousKnown == Section::Exception) +- return next >= Section::Global; +- if (next == Section::Exception) +- return previousKnown <= Section::Memory; +- return static_cast(previousKnown) < static_cast(next); ++ return orderingNumber(previousKnown) < orderingNumber(next); + } + + inline const char* makeString(Section section) +@@ -105,7 +111,7 @@ inline const char* makeString(Section section) + return "Begin"; + case Section::Custom: + return "Custom"; +-#define STRINGIFY_SECTION_NAME(NAME, ID, DESCRIPTION) case Section::NAME: return #NAME; ++#define STRINGIFY_SECTION_NAME(NAME, ID, ORDERING, DESCRIPTION) case Section::NAME: return #NAME; + FOR_EACH_KNOWN_WASM_SECTION(STRINGIFY_SECTION_NAME) + #undef STRINGIFY_SECTION_NAME + } +diff --git a/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp b/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp +index fa552eff..25e7e32d 100644 +--- a/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp ++++ b/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp +@@ -161,7 +161,7 @@ auto StreamingParser::parseSectionPayload(Vector&& data) -> State + { + SectionParser parser(data.data(), data.size(), m_offset, m_info.get()); + switch (m_section) { +-#define WASM_SECTION_PARSE(NAME, ID, DESCRIPTION) \ ++#define WASM_SECTION_PARSE(NAME, ID, ORDERING, DESCRIPTION) \ + case Section::NAME: { \ + WASM_STREAMING_PARSER_FAIL_IF_HELPER_FAILS(parser.parse ## NAME()); \ + break; \ +@@ -393,9 +393,18 @@ auto StreamingParser::finalize() -> State + m_state = fail("Number of functions parsed (", m_functionCount, ") does not match the number of declared functions (", m_info->functions.size(), ")"); + break; + } ++ ++ if (m_info->numberOfDataSegments) { ++ if (UNLIKELY(m_info->data.size() != m_info->numberOfDataSegments.value())) { ++ m_state = fail("Data section's count ", m_info->data.size(), " is different from Data Count section's count ", m_info->numberOfDataSegments.value()); ++ break; ++ } ++ } ++ + if (m_remaining.isEmpty()) { + if (UNLIKELY(Options::useEagerWebAssemblyModuleHashing())) + m_info->nameSection->setHash(m_hasher.computeHexDigest()); ++ + m_state = State::Finished; + m_client.didFinishParsing(); + } else +-- +2.40.0 diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-23529.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-23529.patch new file mode 100644 index 0000000..f2e9808 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-23529.patch @@ -0,0 +1,65 @@ +CVE: CVE-2023-23529 +Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/6cc943c] + +With the help from webkit maillist, backport and rebase patch to fix +CVE-2023-23529. + +https://lists.webkit.org/pipermail/webkit-gtk/2023-August/003931.html + +Signed-off-by: Kai Kang + +From 6cc943c3323a1a1368934c812e5e8ec08f54dcd4 Mon Sep 17 00:00:00 2001 +From: Yusuke Suzuki +Date: Fri, 17 Feb 2023 10:39:19 -0800 +Subject: [PATCH] Cherry-pick 259548.63@safari-7615-branch (1b2eb138ef92). + rdar://105598149 + + [JSC] ToThis object folding should check if AbstractValue is always an object + https://bugs.webkit.org/show_bug.cgi?id=251944 + rdar://105175786 + + Reviewed by Geoffrey Garen and Mark Lam. + + ToThis can become Identity for strict mode if it is just primitive values or its object does not have toThis function overriding. + This is correct, but folding ToThis to Undefined etc. (not Identity) needs to check that an input only contains objects. + This patch adds appropriate checks to prevent from converting ToThis(GlobalObject | Int32) to Undefined for example. + + * Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h: + (JSC::DFG::isToThisAnIdentity): + + Canonical link: https://commits.webkit.org/259548.63@safari-7615-branch + +Canonical link: https://commits.webkit.org/260455@main +--- + .../JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h +index 928328ffab826..82481455e651d 100644 +--- a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h ++++ b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h +@@ -209,7 +209,8 @@ inline ToThisResult isToThisAnIdentity(VM& vm, ECMAMode ecmaMode, AbstractValue& + } + } + +- if ((ecmaMode.isStrict() || (valueForNode.m_type && !(valueForNode.m_type & ~SpecObject))) && valueForNode.m_structure.isFinite()) { ++ bool onlyObjects = valueForNode.m_type && !(valueForNode.m_type & ~SpecObject); ++ if ((ecmaMode.isStrict() || onlyObjects) && valueForNode.m_structure.isFinite()) { + bool allStructuresAreJSScope = !valueForNode.m_structure.isClear(); + bool overridesToThis = false; + valueForNode.m_structure.forEach([&](RegisteredStructure structure) { +@@ -226,9 +227,13 @@ inline ToThisResult isToThisAnIdentity(VM& vm, ECMAMode ecmaMode, AbstractValue& + // If all the structures are JSScope's ones, we know the details of JSScope::toThis() operation. + allStructuresAreJSScope &= structure->classInfo()->methodTable.toThis == JSScope::info()->methodTable.toThis; + }); ++ ++ // This is correct for strict mode even if this can have non objects, since the right semantics is Identity. + if (!overridesToThis) + return ToThisResult::Identity; +- if (allStructuresAreJSScope) { ++ ++ // But this folding is available only if input is always an object. ++ if (onlyObjects && allStructuresAreJSScope) { + if (ecmaMode.isStrict()) + return ToThisResult::Undefined; + return ToThisResult::GlobalThis; diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-32439.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-32439.patch new file mode 100644 index 0000000..f8d7b61 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2023-32439.patch @@ -0,0 +1,127 @@ +From ebefb9e6b7e7440ab6bb29452f4ac6350bd8b975 Mon Sep 17 00:00:00 2001 +From: Yijia Huang +Date: Tue, 26 Sep 2023 09:23:31 +0000 +Subject: [PATCH] Cherry-pick 263909@main (52fe95e5805c). + https://bugs.webkit.org/show_bug.cgi?id=256567 + + EnumeratorNextUpdateIndexAndMode and HasIndexedProperty should have different heap location kinds + https://bugs.webkit.org/show_bug.cgi?id=256567 + rdar://109089013 + + Reviewed by Yusuke Suzuki. + + EnumeratorNextUpdateIndexAndMode and HasIndexedProperty are different DFG nodes. However, + they might introduce the same heap location kind in DFGClobberize.h which might lead to + hash collision. We should introduce a new locationn kind for EnumeratorNextUpdateIndexAndMode. + + * JSTests/stress/heap-location-collision-dfg-clobberize.js: Added. + (foo): + * Source/JavaScriptCore/dfg/DFGClobberize.h: + (JSC::DFG::clobberize): + * Source/JavaScriptCore/dfg/DFGHeapLocation.cpp: + (WTF::printInternal): + * Source/JavaScriptCore/dfg/DFGHeapLocation.h: + + Canonical link: https://commits.webkit.org/263909@main + +Canonical link: https://commits.webkit.org/260527.376@webkitglib/2.40 + +CVE: CVE-2023-32439 + +Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/ebefb9e] + +Signed-off-by: Yogita Urade +--- + .../stress/heap-location-collision-dfg-clobberize.js | 12 ++++++++++++ + Source/JavaScriptCore/dfg/DFGClobberize.h | 7 ++++--- + Source/JavaScriptCore/dfg/DFGHeapLocation.cpp | 4 ++++ + Source/JavaScriptCore/dfg/DFGHeapLocation.h | 1 + + 4 files changed, 21 insertions(+), 3 deletions(-) + create mode 100644 JSTests/stress/heap-location-collision-dfg-clobberize.js + +diff --git a/JSTests/stress/heap-location-collision-dfg-clobberize.js b/JSTests/stress/heap-location-collision-dfg-clobberize.js +new file mode 100644 +index 00000000..ed40601e +--- /dev/null ++++ b/JSTests/stress/heap-location-collision-dfg-clobberize.js +@@ -0,0 +1,12 @@ ++//@ runDefault("--watchdog=300", "--watchdog-exception-ok") ++const arr = [0]; ++ ++function foo() { ++ for (let _ in arr) { ++ 0 in arr; ++ while(1); ++ } ++} ++ ++ ++foo(); +diff --git a/Source/JavaScriptCore/dfg/DFGClobberize.h b/Source/JavaScriptCore/dfg/DFGClobberize.h +index f96e21d2..af3e864b 100644 +--- a/Source/JavaScriptCore/dfg/DFGClobberize.h ++++ b/Source/JavaScriptCore/dfg/DFGClobberize.h +@@ -371,6 +371,7 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu + + read(JSObject_butterfly); + ArrayMode mode = node->arrayMode(); ++ LocationKind locationKind = node->op() == EnumeratorNextUpdateIndexAndMode ? EnumeratorNextUpdateIndexAndModeLoc : HasIndexedPropertyLoc; + switch (mode.type()) { + case Array::ForceExit: { + write(SideState); +@@ -380,7 +381,7 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu + if (mode.isInBounds()) { + read(Butterfly_publicLength); + read(IndexedInt32Properties); +- def(HeapLocation(HasIndexedPropertyLoc, IndexedInt32Properties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); ++ def(HeapLocation(locationKind, IndexedInt32Properties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); + return; + } + break; +@@ -390,7 +391,7 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu + if (mode.isInBounds()) { + read(Butterfly_publicLength); + read(IndexedDoubleProperties); +- def(HeapLocation(HasIndexedPropertyLoc, IndexedDoubleProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); ++ def(HeapLocation(locationKind, IndexedDoubleProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); + return; + } + break; +@@ -400,7 +401,7 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu + if (mode.isInBounds()) { + read(Butterfly_publicLength); + read(IndexedContiguousProperties); +- def(HeapLocation(HasIndexedPropertyLoc, IndexedContiguousProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); ++ def(HeapLocation(locationKind, IndexedContiguousProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); + return; + } + break; +diff --git a/Source/JavaScriptCore/dfg/DFGHeapLocation.cpp b/Source/JavaScriptCore/dfg/DFGHeapLocation.cpp +index 0661e5b8..698a6d4b 100644 +--- a/Source/JavaScriptCore/dfg/DFGHeapLocation.cpp ++++ b/Source/JavaScriptCore/dfg/DFGHeapLocation.cpp +@@ -134,6 +134,10 @@ void printInternal(PrintStream& out, LocationKind kind) + out.print("HasIndexedPorpertyLoc"); + return; + ++ case EnumeratorNextUpdateIndexAndModeLoc: ++ out.print("EnumeratorNextUpdateIndexAndModeLoc"); ++ return; ++ + case IndexedPropertyDoubleLoc: + out.print("IndexedPropertyDoubleLoc"); + return; +diff --git a/Source/JavaScriptCore/dfg/DFGHeapLocation.h b/Source/JavaScriptCore/dfg/DFGHeapLocation.h +index 40fb7167..7238491b 100644 +--- a/Source/JavaScriptCore/dfg/DFGHeapLocation.h ++++ b/Source/JavaScriptCore/dfg/DFGHeapLocation.h +@@ -46,6 +46,7 @@ enum LocationKind { + DirectArgumentsLoc, + GetterLoc, + GlobalVariableLoc, ++ EnumeratorNextUpdateIndexAndModeLoc, + HasIndexedPropertyLoc, + IndexedPropertyDoubleLoc, + IndexedPropertyDoubleSaneChainLoc, +-- +2.40.0 diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40776.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40776.patch new file mode 100644 index 0000000..60f1816 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40776.patch @@ -0,0 +1,141 @@ +From b951404ea74ae432312a83138f5c8945a0d09e1b Mon Sep 17 00:00:00 2001 +From: Jean-Yves Avenard +Date: Wed, 24 Apr 2024 19:01:06 -0700 +Subject: [PATCH] CVE-2024-40776: Always copy all audio channels to the AudioBus +to guarantee data lifetime. + +Upstream-Status: Backport from https://github.com/WebKit/WebKit/commit/b951404ea74ae432312a83138f5c8945a0d09e1b +CVE: CVE-2024-40776 + +Signed-off-by: Rohini Sangam +--- + ...et-concurrent-resampler-crash-expected.txt | 1 + + ...dioworklet-concurrent-resampler-crash.html | 44 +++++++++++++++++++ + .../platform/audio/MultiChannelResampler.cpp | 21 ++------- + .../platform/audio/MultiChannelResampler.h | 2 - + 4 files changed, 48 insertions(+), 20 deletions(-) + create mode 100644 LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash-expected.txt + create mode 100644 LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash.html + +diff --git a/LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash-expected.txt b/LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash-expected.txt +new file mode 100644 +index 00000000..654ddf7f +--- /dev/null ++++ b/LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash-expected.txt +@@ -0,0 +1 @@ ++This test passes if it does not crash. +diff --git a/LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash.html b/LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash.html +new file mode 100644 +index 00000000..b3ab181d +--- /dev/null ++++ b/LayoutTests/webaudio/crashtest/audioworklet-concurrent-resampler-crash.html +@@ -0,0 +1,44 @@ ++ ++ ++ ++ ++ ++

This test passes if it does not crash.

++ ++ ++ +diff --git a/Source/WebCore/platform/audio/MultiChannelResampler.cpp b/Source/WebCore/platform/audio/MultiChannelResampler.cpp +index 1dadc58c..13db6f26 100644 +--- a/Source/WebCore/platform/audio/MultiChannelResampler.cpp ++++ b/Source/WebCore/platform/audio/MultiChannelResampler.cpp +@@ -41,18 +41,8 @@ namespace WebCore { + MultiChannelResampler::MultiChannelResampler(double scaleFactor, unsigned numberOfChannels, unsigned requestFrames, Function&& provideInput) + : m_numberOfChannels(numberOfChannels) + , m_provideInput(WTFMove(provideInput)) +- , m_multiChannelBus(AudioBus::create(numberOfChannels, requestFrames, false)) ++ , m_multiChannelBus(AudioBus::create(numberOfChannels, requestFrames)) + { +- // As an optimization, we will use the buffer passed to provideInputForChannel() as channel memory for the first channel so we +- // only need to allocate memory if there is more than one channel. +- if (numberOfChannels > 1) { +- m_channelsMemory.reserveInitialCapacity(numberOfChannels - 1); +- for (unsigned channelIndex = 1; channelIndex < numberOfChannels; ++channelIndex) { +- m_channelsMemory.uncheckedAppend(makeUnique(requestFrames)); +- m_multiChannelBus->setChannelMemory(channelIndex, m_channelsMemory.last()->data(), requestFrames); +- } +- } +- + // Create each channel's resampler. + for (unsigned channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) + m_kernels.append(makeUnique(scaleFactor, requestFrames, std::bind(&MultiChannelResampler::provideInputForChannel, this, std::placeholders::_1, std::placeholders::_2, channelIndex))); +@@ -89,15 +79,10 @@ void MultiChannelResampler::process(AudioBus* destination, size_t framesToProces + void MultiChannelResampler::provideInputForChannel(float* buffer, size_t framesToProcess, unsigned channelIndex) + { + ASSERT(channelIndex < m_multiChannelBus->numberOfChannels()); +- ASSERT(framesToProcess == m_multiChannelBus->length()); ++ ASSERT(framesToProcess <= m_multiChannelBus->length()); + +- if (!channelIndex) { +- // As an optimization, we use the provided buffer as memory for the first channel in the AudioBus. This avoids +- // having to memcpy() for the first channel. +- m_multiChannelBus->setChannelMemory(0, buffer, framesToProcess); ++ if (!channelIndex) + m_provideInput(m_multiChannelBus.get(), framesToProcess); +- return; +- } + + // Copy the channel data from what we received from m_multiChannelProvider. + memcpy(buffer, m_multiChannelBus->channel(channelIndex)->data(), sizeof(float) * framesToProcess); +diff --git a/Source/WebCore/platform/audio/MultiChannelResampler.h b/Source/WebCore/platform/audio/MultiChannelResampler.h +index e96cc56b..274fe364 100644 +--- a/Source/WebCore/platform/audio/MultiChannelResampler.h ++++ b/Source/WebCore/platform/audio/MultiChannelResampler.h +@@ -29,7 +29,6 @@ + #ifndef MultiChannelResampler_h + #define MultiChannelResampler_h + +-#include "AudioArray.h" + #include + #include + #include +@@ -62,7 +61,6 @@ private: + size_t m_outputFramesReady { 0 }; + Function m_provideInput; + RefPtr m_multiChannelBus; +- Vector> m_channelsMemory; + }; + + } // namespace WebCore +-- +2.35.7 + diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40779.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40779.patch new file mode 100644 index 0000000..6fac907 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40779.patch @@ -0,0 +1,91 @@ +From 2fe5ae29a5f6434ef456afe9673a4f400ec63848 Mon Sep 17 00:00:00 2001 +From: Jean-Yves Avenard +Date: Fri, 14 Jun 2024 16:08:19 -0700 +Subject: [PATCH] Cherry-pick 272448.1085@safari-7618.3.10-branch + (ff52ff7cb64e). https://bugs.webkit.org/show_bug.cgi?id=275431 + +HeapBufferOverflow in computeSampleUsingLinearInterpolation +https://bugs.webkit.org/show_bug.cgi?id=275431 +rdar://125617812 + +Reviewed by Youenn Fablet. + +Add boundary check. +This is a copy of blink code for that same function. +https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/webaudio/audio_buffer_source_handler.cc;l=336-341 + +* LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash-expected.txt: Added. +* LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash.html: Added. +* Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp: +(WebCore::AudioBufferSourceNode::renderFromBuffer): + +Canonical link: https://commits.webkit.org/274313.347@webkitglib/2.44 + +Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/2fe5ae29a5f6434ef456afe9673a4f400ec63848] +CVE: CVE-2024-40779 +Signed-off-by: Vivek Kumbhar +--- + ...er-sourcenode-resampler-crash-expected.txt | 1 + + ...udiobuffer-sourcenode-resampler-crash.html | 25 +++++++++++++++++++ + .../webaudio/AudioBufferSourceNode.cpp | 6 +++++ + 3 files changed, 32 insertions(+) + create mode 100644 LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash-expected.txt + create mode 100644 LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash.html + +diff --git a/LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash-expected.txt b/LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash-expected.txt +new file mode 100644 +index 00000000..654ddf7f +--- /dev/null ++++ b/LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash-expected.txt +@@ -0,0 +1 @@ ++This test passes if it does not crash. +diff --git a/LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash.html b/LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash.html +new file mode 100644 +index 00000000..5fb2dd8c +--- /dev/null ++++ b/LayoutTests/webaudio/crashtest/audiobuffer-sourcenode-resampler-crash.html +@@ -0,0 +1,25 @@ ++ ++ ++ ++ ++ ++

This test passes if it does not crash.

++ ++ ++ +diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp +index 35b8c818..689d37a1 100644 +--- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp ++++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp +@@ -342,6 +342,12 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination + if (readIndex2 >= maxFrame) + readIndex2 = m_isLooping ? minFrame : readIndex; + ++ // Final sanity check on buffer access. ++ // FIXME: as an optimization, try to get rid of this inner-loop check and ++ // put assertions and guards before the loop. ++ if (readIndex >= bufferLength || readIndex2 >= bufferLength) ++ break; ++ + // Linear interpolation. + for (unsigned i = 0; i < numberOfChannels; ++i) { + float* destination = destinationChannels[i]; +-- +2.34.1 diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40780.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40780.patch new file mode 100644 index 0000000..ab41213 --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/CVE-2024-40780.patch @@ -0,0 +1,94 @@ +From e83e4c7460972898dc06a5f5ab36eed7c6b101b5 Mon Sep 17 00:00:00 2001 +From: Jer Noble +Date: Tue, 11 Jun 2024 11:54:06 -0700 +Subject: [PATCH] CVE-2024-40780: Add check in AudioBufferSourceNode::renderFromBuffer() +when detune is set to large negative value + +Upstream-Status: Backport from https://github.com/WebKit/WebKit/commit/e83e4c7460972898dc06a5f5ab36eed7c6b101b5 +CVE: CVE-2024-40780 + +Signed-off-by: Rohini Sangam +--- + ...buffersourcenode-detune-crash-expected.txt | 10 +++++++ + .../audiobuffersourcenode-detune-crash.html | 30 +++++++++++++++++++ + .../webaudio/AudioBufferSourceNode.cpp | 7 +++++ + 3 files changed, 47 insertions(+) + create mode 100644 LayoutTests/webaudio/audiobuffersourcenode-detune-crash-expected.txt + create mode 100644 LayoutTests/webaudio/audiobuffersourcenode-detune-crash.html + +diff --git a/LayoutTests/webaudio/audiobuffersourcenode-detune-crash-expected.txt b/LayoutTests/webaudio/audiobuffersourcenode-detune-crash-expected.txt +new file mode 100644 +index 00000000..914ba0b1 +--- /dev/null ++++ b/LayoutTests/webaudio/audiobuffersourcenode-detune-crash-expected.txt +@@ -0,0 +1,10 @@ ++Attempting to create a AudioBufferSourceNode with a large negative detune value should not crash. ++ ++On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". ++ ++ ++PASS Test passed because it did not crash. ++PASS successfullyParsed is true ++ ++TEST COMPLETE ++ +diff --git a/LayoutTests/webaudio/audiobuffersourcenode-detune-crash.html b/LayoutTests/webaudio/audiobuffersourcenode-detune-crash.html +new file mode 100644 +index 00000000..e8af579d +--- /dev/null ++++ b/LayoutTests/webaudio/audiobuffersourcenode-detune-crash.html +@@ -0,0 +1,30 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp +index 689d37a1..f68e7ff5 100644 +--- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp ++++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp +@@ -327,9 +327,16 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination + virtualReadIndex = readIndex; + } else if (!pitchRate) { + unsigned readIndex = static_cast(virtualReadIndex); ++ int deltaFrames = static_cast(virtualDeltaFrames); ++ maxFrame = static_cast(virtualMaxFrame); ++ ++ if (readIndex >= maxFrame) ++ readIndex -= deltaFrames; + + for (unsigned i = 0; i < numberOfChannels; ++i) + std::fill_n(destinationChannels[i] + writeIndex, framesToProcess, sourceChannels[i][readIndex]); ++ ++ virtualReadIndex = readIndex; + } else if (reverse) { + unsigned maxFrame = static_cast(virtualMaxFrame); + unsigned minFrame = static_cast(floorf(virtualMinFrame)); +-- +2.35.7 + diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk/reproducibility.patch b/meta-bsp/recipes-sato/webkit/webkitgtk/reproducibility.patch new file mode 100644 index 0000000..e866a1a --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk/reproducibility.patch @@ -0,0 +1,22 @@ +Injection a year based on the current date isn't reproducible. Hack this +to a specific year for now for reproducibilty and to avoid autobuilder failures. + +The correct fix would be to use SOURCE_DATE_EPOCH from the environment and +then this could be submitted upstream, sadly my ruby isn't up to that. + +Upstream-Status: Pending [could be reworked] +Signed-off-by: Richard Purdie + +Index: webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb +=================================================================== +--- webkitgtk-2.34.2.orig/Source/JavaScriptCore/generator/GeneratedFile.rb ++++ webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb +@@ -25,7 +25,7 @@ require 'date' + require 'digest' + + $LICENSE = <<-EOF +-Copyright (C) #{Date.today.year} Apple Inc. All rights reserved. ++Copyright (C) 2021 Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions diff --git a/meta-bsp/recipes-sato/webkit/webkitgtk_%.bbappend b/meta-bsp/recipes-sato/webkit/webkitgtk_%.bbappend new file mode 100644 index 0000000..fba995c --- /dev/null +++ b/meta-bsp/recipes-sato/webkit/webkitgtk_%.bbappend @@ -0,0 +1,22 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI = "https://www.webkitgtk.org/releases/${BP}.tar.xz \ + file://0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch \ + file://0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch \ + file://0001-Fix-build-without-opengl-or-es.patch \ + file://reproducibility.patch \ + file://0001-When-building-introspection-files-do-not-quote-CFLAG.patch \ + file://CVE-2022-32888.patch \ + file://CVE-2022-32923.patch \ + file://CVE-2022-46691.patch \ + file://CVE-2022-46699.patch \ + file://CVE-2022-42867.patch \ + file://CVE-2022-46700.patch \ + file://CVE-2023-23529.patch \ + file://CVE-2022-48503.patch \ + file://CVE-2023-32439.patch \ + file://CVE-2024-40779.patch \ + file://0d3344e17d258106617b0e6d783d073b188a2548.patch \ + file://CVE-2024-40776.patch \ + file://CVE-2024-40780.patch \ + " + diff --git a/meta-bsp/recipes-security/optee-phytium/optee-os-tadevkit_4.0.0.bb b/meta-bsp/recipes-security/optee-phytium/optee-os-tadevkit_4.6.0.bb similarity index 94% rename from meta-bsp/recipes-security/optee-phytium/optee-os-tadevkit_4.0.0.bb rename to meta-bsp/recipes-security/optee-phytium/optee-os-tadevkit_4.6.0.bb index 167a942..e882a78 100644 --- a/meta-bsp/recipes-security/optee-phytium/optee-os-tadevkit_4.0.0.bb +++ b/meta-bsp/recipes-security/optee-phytium/optee-os-tadevkit_4.6.0.bb @@ -1,4 +1,4 @@ -require optee-phytium-os_4.0.0.bb +require optee-phytium-os_4.6.0.bb SUMMARY = "OP-TEE Trusted OS TA devkit" DESCRIPTION = "OP-TEE TA devkit for build TAs" diff --git a/meta-bsp/recipes-security/optee-phytium/optee-phytium-client_4.0.0.bb b/meta-bsp/recipes-security/optee-phytium/optee-phytium-client_4.6.0.bb similarity index 89% rename from meta-bsp/recipes-security/optee-phytium/optee-phytium-client_4.0.0.bb rename to meta-bsp/recipes-security/optee-phytium/optee-phytium-client_4.6.0.bb index c15a3ab..3215d86 100644 --- a/meta-bsp/recipes-security/optee-phytium/optee-phytium-client_4.0.0.bb +++ b/meta-bsp/recipes-security/optee-phytium/optee-phytium-client_4.6.0.bb @@ -8,11 +8,11 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" inherit systemd update-rc.d cmake pkgconfig SRC_URI = " \ - git://gitee.com/phytium_embedded/phytium-optee.git;protocol=https;nobranch=1 \ + git://git@gitlab.phytium.com.cn:12022/embedded/optee/optee-4.0e.git;protocol=ssh;nobranch=1 \ file://tee-supplicant.service \ file://tee-supplicant.sh \ " -SRCREV = "100060dd4bda6caf9230b277886bd19f796e6881" +SRCREV = "583dba9b9e78e21cb63ea7003ffcafc3e6d94343" DEPENDS += "util-linux" EXTRA_OEMAKE += "PKG_CONFIG=pkg-config" diff --git a/meta-bsp/recipes-security/optee-phytium/optee-phytium-examples_4.0.0.bb b/meta-bsp/recipes-security/optee-phytium/optee-phytium-examples_4.6.0.bb similarity index 100% rename from meta-bsp/recipes-security/optee-phytium/optee-phytium-examples_4.0.0.bb rename to meta-bsp/recipes-security/optee-phytium/optee-phytium-examples_4.6.0.bb diff --git a/meta-bsp/recipes-security/optee-phytium/optee-phytium-os_4.0.0.bb b/meta-bsp/recipes-security/optee-phytium/optee-phytium-os_4.6.0.bb similarity index 100% rename from meta-bsp/recipes-security/optee-phytium/optee-phytium-os_4.0.0.bb rename to meta-bsp/recipes-security/optee-phytium/optee-phytium-os_4.6.0.bb diff --git a/meta-bsp/recipes-security/optee-phytium/optee-phytium-test_4.0.0.bb b/meta-bsp/recipes-security/optee-phytium/optee-phytium-test_4.0.0.bb deleted file mode 100644 index 71e7afe..0000000 --- a/meta-bsp/recipes-security/optee-phytium/optee-phytium-test_4.0.0.bb +++ /dev/null @@ -1,59 +0,0 @@ -SUMMARY = "OP-TEE sanity testsuite" -DESCRIPTION = "Open Portable Trusted Execution Environment - Test suite" -HOMEPAGE = "https://gitee.com/phytium_embedded/phytium-optee" - -LICENSE = "BSD-2-Clause & GPL-2.0-only" -LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" - -inherit python3native ptest -inherit deploy -require optee.inc - -DEPENDS = "optee-phytium-client optee-os-tadevkit python3-cryptography-native" - -S = "${WORKDIR}/git/ext/optee_test" -B = "${WORKDIR}/build" - -EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ - CROSS_COMPILE_HOST=${HOST_PREFIX} \ - CROSS_COMPILE_TA=${HOST_PREFIX} \ - O=${B} \ - " - -do_compile() { - cd ${S} - # Top level makefile doesn't seem to handle parallel make gracefully - oe_runmake xtest - oe_runmake ta - oe_runmake test_plugin -} -do_compile[cleandirs] = "${B}" - -do_install () { - install -D -p -m0755 ${B}/xtest/xtest ${D}${bindir}/xtest - - # install path should match the value set in optee-client/tee-supplicant - # default TEEC_LOAD_PATH is /lib - mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/ - install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ - mkdir -p ${D}${libdir}/tee-supplicant/plugins - install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/ -} - -do_deploy () { - install -d ${DEPLOYDIR}/${MLPREFIX}optee/ta - install -m 644 ${B}/ta/*/*.elf ${DEPLOYDIR}/${MLPREFIX}optee/ta -} - -addtask deploy before do_build after do_install - -FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/ \ - ${libdir}/tee-supplicant/plugins/ \ - " - -# Imports machine specific configs from staging to build -PACKAGE_ARCH = "${MACHINE_ARCH}" - -EXTRA_OEMAKE:append = " OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}" -DEPENDS:append = " openssl" -CFLAGS:append = " -Wno-error=deprecated-declarations" diff --git a/meta-bsp/recipes-security/optee-phytium/optee.inc b/meta-bsp/recipes-security/optee-phytium/optee.inc index aad4505..f06ee68 100644 --- a/meta-bsp/recipes-security/optee-phytium/optee.inc +++ b/meta-bsp/recipes-security/optee-phytium/optee.inc @@ -7,7 +7,7 @@ OPTEE_ARCH = "arm64" TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta" SRC_URI = "git://gitee.com/phytium_embedded/phytium-optee.git;protocol=https;nobranch=1" -SRCREV = "4d1942c7627a6a2ef0af0f379452496f740b2cdc" +SRCREV = "f3c36a1d77d9f5cf402585b584c3a4b344711494" EXTRA_OEMAKE += "V=1 \ LIBGCC_LOCATE_CFLAGS='${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}' \ diff --git a/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_4.19.bb b/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_4.19.bb index ddd2f70..bb42083 100644 --- a/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_4.19.bb +++ b/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_4.19.bb @@ -5,5 +5,5 @@ SRC_URI:append = " file://0001-perf-bench-Share-some-global-variables-to-fix-bui file://0001-perf-tests-bp_account-Make-global-variable-static.patch \ file://0001-libtraceevent-Fix-build-with-binutils-2.35.patch \ " -SRCREV = "c2c05b35b29f83444071e41eda6dc6ae6880fc21" +SRCREV = "62e2da7f646fc9424f64c3138cf47ccbd43e5477" KERNEL_DEVICETREE ?= "phytium/e2000d-chillipi-edu-board.dtb phytium/e2000d-demo-board.dtb phytium/e2000d-miniitx-board.dtb phytium/e2000d-power-board.dtb phytium/e2000q-come-board.dtb phytium/e2000q-demo-board-xenomai-uart2.dtb phytium/e2000q-demo-board.dtb phytium/e2000q-edu-board.dtb phytium/e2000q-hanwei-board.dtb phytium/e2000q-miniitx-board.dtb phytium/e2000q-vpx-board.dtb phytium/e2000s-demo-board.dtb phytium/pd1904-devboard-d4-dsk.dtb phytium/pd1904c-devboard-d4-dsk.dtb phytium/pd2008-devboard-dsk.dtb phytium/phytiumpi_firefly.dtb" diff --git a/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_5.10.bb b/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_5.10.bb index 5803f86..bea17f2 100644 --- a/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_5.10.bb +++ b/meta-xenomai/recipes-kernel/linux/linux-xenomai-phytium_5.10.bb @@ -1,6 +1,5 @@ require linux-xenomai.inc LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" -KERNEL_BRANCH ?= "master" -SRCREV = "a3354e6d12ec4263315d0cd33dcabd95036fd2bf" -SRC_URI:append = " file://0001-Makefile-fix-cannot-find-.h.patch" +KERNEL_BRANCH ?= "5.10.209-dovetail1" +SRCREV = "c326dd201ea3af77542370ca3c81e2791db14429" KERNEL_DEVICETREE ?= "phytium/e2000d-chillipi-edu-board.dtb phytium/e2000d-demo-board.dtb phytium/e2000d-miniitx-board.dtb phytium/e2000d-power-board.dtb phytium/e2000q-come-board.dtb phytium/e2000q-demo-board.dtb phytium/e2000q-edu-board.dtb phytium/e2000q-hanwei-board.dtb phytium/e2000q-miniitx-board.dtb phytium/e2000q-vpx-board.dtb phytium/e2000s-demo-board.dtb phytium/pd1904-devboard-d4-dsk.dtb phytium/pd1904c-devboard-d4-dsk.dtb phytium/pd2008-devboard-dsk.dtb phytium/phytiumpi_firefly.dtb" diff --git a/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.1.3.bb b/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.1.5.bb similarity index 87% rename from meta-xenomai/recipes-xenomai/xenomai/xenomai_3.1.3.bb rename to meta-xenomai/recipes-xenomai/xenomai/xenomai_3.1.5.bb index ecb16f2..885a80c 100644 --- a/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.1.3.bb +++ b/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.1.5.bb @@ -5,8 +5,8 @@ LIC_FILES_CHKSUM = "file://README;md5=d804868a35cdacf02fc7ec9fc0d016a7" SECTION = "xenomai" HOMEPAGE = "http://www.xenomai.org/" -XENOMAI_SRC = "xenomai-v3.1.3" -SRC_URI = "https://source.denx.de/Xenomai/xenomai/-/archive/v3.1.3/${XENOMAI_SRC}.tar.bz2" +XENOMAI_SRC = "xenomai-v3.1.5" +SRC_URI = "https://source.denx.de/Xenomai/xenomai/-/archive/v3.1.5/${XENOMAI_SRC}.tar.bz2" S = "${WORKDIR}/xenomai-v${PV}" @@ -14,7 +14,7 @@ inherit autotools pkgconfig includedir = "/usr/include/xenomai" -SRC_URI[md5sum] = "38ba82b70180c2c7a95cdae1767c6de2" +SRC_URI[md5sum] = "7ed9b0bda5e72e04fc0164d37244dcfe" PACKAGES += "${PN}-demos" diff --git a/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.2.4.bb b/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.2.6.bb similarity index 88% rename from meta-xenomai/recipes-xenomai/xenomai/xenomai_3.2.4.bb rename to meta-xenomai/recipes-xenomai/xenomai/xenomai_3.2.6.bb index bffc868..d1fd642 100644 --- a/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.2.4.bb +++ b/meta-xenomai/recipes-xenomai/xenomai/xenomai_3.2.6.bb @@ -5,8 +5,8 @@ LIC_FILES_CHKSUM = "file://README;md5=d804868a35cdacf02fc7ec9fc0d016a7" SECTION = "xenomai" HOMEPAGE = "http://www.xenomai.org/" -XENOMAI_SRC = "xenomai-v3.2.4" -SRC_URI = "https://source.denx.de/Xenomai/xenomai/-/archive/v3.2.4/${XENOMAI_SRC}.tar.bz2" +XENOMAI_SRC = "xenomai-v3.2.6" +SRC_URI = "https://source.denx.de/Xenomai/xenomai/-/archive/v3.2.6/${XENOMAI_SRC}.tar.bz2" S = "${WORKDIR}/xenomai-v${PV}" @@ -14,7 +14,7 @@ inherit autotools pkgconfig includedir = "/usr/xenomai" -SRC_URI[md5sum] = "8a1be4adb61a937d80360675187879a9" +SRC_URI[md5sum] = "90267599c58a84e372aae172338ec44c" do_install:append() { install -d ${D}/usr/xenomai/include/ diff --git a/phyt_yocto_setenv.sh b/phyt_yocto_setenv.sh new file mode 100644 index 0000000..6be531c --- /dev/null +++ b/phyt_yocto_setenv.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# Copyright 2025 PHYTIUM + +toolchain=phytium-glibc-x86_64-meta-toolchain-aarch64-toolchain-4.0.6.sh + +host_pkg="build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 liblz4-tool locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd \ +" + +check_host_env() { + for pkg in $host_pkg; do + if ! dpkg-query -l $pkg | grep -q ii; then + echo installing $pkg ... && sudo apt install -y $pkg + fi + done +} + + +if [ ! -f pre-toolchain/$toolchain ]; then + echo "Download pre-built toolchains for yocto " + git clone --depth=1 --branch=develop https://gitee.com/phytium_embedded/phytium-rogue-umlibs.git toolchain + cd toolchain && git archive --format=tar.gz HEAD pre-toolchain/phytium-glibc-x86_64-meta-toolchain-aarch64-toolchain-4.0.6.sh > ../output.tar.gz + cd ../ && tar zxvf output.tar.gz && rm -rf toolchain && rm -rf output.tar.gz +fi + +check_host_env + +if [ -f /tmp/var.tmp ]; then + target_sdk_dir=$(cat /tmp/var.tmp) +fi + +if [ -d $target_sdk_dir ] && [ -n "$target_sdk_dir" ]; then + echo "Toolchain toolchain is already installed " +else + echo "Installing toolchain in host" + sh pre-toolchain/$toolchain + target_sdk_dir=$(cat /tmp/var.tmp) +fi + +if [ ! -d $HOME/bin ]; then + mkdir -p $HOME/bin +fi +curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo +export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo' +chmod a+x ~/bin/repo +PATH=~/bin:${PATH} +if [ ! -d yocto-sdk ]; then + mkdir yocto-sdk + cd yocto-sdk + repo init -u ssh://git@gitlab.phytium.com.cn:12022/embedded/linux/phytium-linux-yocto -m default.xml + repo sync --force-sync + . ./setup-env -m phytium + + echo $target_sdk_dir + echo 'EXTERNAL_TOOLCHAIN = "'$target_sdk_dir'"' >>conf/local.conf + echo 'TCMODE = "external-oe-sdk"' >>conf/local.conf + echo 'PREFERRED_PROVIDER_virtual/crypt = "libxcrypt"' >>conf/local.conf + echo 'PREFERRED_PROVIDER_linux-libc-headers = "glibc-external"' >>conf/local.conf + echo 'PREFERRED_PROVIDER_linux-libc-headers-dev = "glibc-external"' >>conf/local.conf + echo 'PREFERRED_PROVIDER_virtual/linux-libc-headers = "glibc-external"' >>conf/local.conf + echo 'CONNECTIVITY_CHECK_URIS = "https://gitee.com/"' >>conf/local.conf +fi diff --git a/tools/setup-env b/tools/setup-env index 2f6def6..b8eddea 100644 --- a/tools/setup-env +++ b/tools/setup-env @@ -170,8 +170,7 @@ LAYER_LIST=" \ meta-openembedded/meta-initramfs \ meta-anaconda \ meta-phytium/meta-xenomai \ - meta-clang \ - meta-virtualization \ + meta-external-toolchain \ " DISTRO="phytium" -- Gitee