All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class
@ 2022-02-06 21:53 Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 2/8] gdb: update 11.1 -> 11.2 Alexander Kanavin
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

This reduces friction in version updates and allows fully automated ones.

There was a concern that using mcextend this way may clash with proper
multiconfig setups; I have tweaked the multiconfig selftest to include
mesa packages in both multiconfig images, and ran the test with
preferred provider set to mesa, and then to mesa-gl - all passed.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/recipes-graphics/mesa/mesa-gl_21.3.5.bb |  16 -
 meta/recipes-graphics/mesa/mesa.inc          | 316 -----------------
 meta/recipes-graphics/mesa/mesa_21.3.5.bb    | 337 ++++++++++++++++++-
 3 files changed, 336 insertions(+), 333 deletions(-)
 delete mode 100644 meta/recipes-graphics/mesa/mesa-gl_21.3.5.bb
 delete mode 100644 meta/recipes-graphics/mesa/mesa.inc

diff --git a/meta/recipes-graphics/mesa/mesa-gl_21.3.5.bb b/meta/recipes-graphics/mesa/mesa-gl_21.3.5.bb
deleted file mode 100644
index 142bb743b1..0000000000
--- a/meta/recipes-graphics/mesa/mesa-gl_21.3.5.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-require mesa.inc
-
-SUMMARY += " (OpenGL only, no EGL/GLES)"
-
-PROVIDES = "virtual/libgl virtual/mesa"
-
-S = "${WORKDIR}/mesa-${PV}"
-
-# At least one DRI rendering engine is required to build mesa.
-# When no X11 is available, use osmesa for the rendering engine.
-PACKAGECONFIG ??= "opengl dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}"
-PACKAGECONFIG:class-target = "opengl dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}"
-
-# 21.0.0 version fails to build when any driver is enabled in DRIDRIVERS
-# ./mesa-21.0.0/meson.build:519:4: ERROR: Problem encountered: building dri drivers require at least one windowing system
-DRIDRIVERS ?= ""
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
deleted file mode 100644
index e8093f5665..0000000000
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ /dev/null
@@ -1,316 +0,0 @@
-SUMMARY = "A free implementation of the OpenGL API"
-DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \
-a system for rendering interactive 3D graphics.  \
-A variety of device drivers allows Mesa to be used in many different environments \
-ranging from software emulation to complete hardware acceleration for modern GPUs. \
-Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \
-environment."
-
-HOMEPAGE = "http://mesa3d.org"
-BUGTRACKER = "https://bugs.freedesktop.org"
-SECTION = "x11"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://docs/license.rst;md5=17a4ea65de7a9ab42437f3131e616a7f"
-
-PE = "2"
-
-SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
-           file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
-           file://0002-meson.build-make-TLS-ELF-optional.patch \
-           file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
-           file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
-           file://0001-util-format-Check-for-NEON-before-using-it.patch \
-           file://0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch \
-           "
-
-SRC_URI[sha256sum] = "d93b2a9d2464ee856d7637a07dff6b7cd950f295ad58518bb959f76882cf4a4c"
-
-UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
-
-#because we cannot rely on the fact that all apps will use pkgconfig,
-#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
-do_install:append() {
-    if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
-        sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
-    fi
-}
-
-DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"
-EXTRANATIVEPATH += "chrpath-native"
-PROVIDES = " \
-    ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
-    virtual/mesa \
-    "
-
-inherit meson pkgconfig python3native gettext features_check
-
-BBCLASSEXTEND = "native nativesdk"
-
-ANY_OF_DISTRO_FEATURES:class-target = "opengl vulkan"
-
-PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}"
-
-export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config"
-export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}"
-export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}"
-export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
-
-MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
-
-# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
-# by default the upstream mesa sources build a debug release
-# here we assume the user will want a release build by default
-MESA_BUILD_TYPE ?= "release"
-def check_buildtype(d):
-    _buildtype = d.getVar('MESA_BUILD_TYPE')
-    if _buildtype not in ['release', 'debug']:
-        bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
-    if _buildtype == 'debug':
-        return 'debugoptimized'
-    return 'plain'
-MESON_BUILDTYPE = "${@check_buildtype(d)}"
-
-EXTRA_OEMESON = " \
-    -Dshared-glapi=enabled \
-    -Dgallium-opencl=disabled \
-    -Dglx-read-only-text=true \
-    -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
-"
-
-def strip_comma(s):
-    return s.strip(',')
-
-PACKAGECONFIG:class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri gallium virgl', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
-                   elf-tls \
-		   "
-PACKAGECONFIG:class-native ?= "gbm gallium egl opengl elf-tls x11"
-PACKAGECONFIG:class-nativesdk ?= "gbm gallium egl opengl elf-tls x11"
-
-PACKAGECONFIG:remove:libc-musl = "elf-tls"
-
-# "gbm" requires "dri", "opengl"
-PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled"
-
-X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr"
-# "x11" requires "opengl"
-PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}"
-PACKAGECONFIG[elf-tls] = "-Delf-tls=true, -Delf-tls=false"
-PACKAGECONFIG[xvmc] = "-Dgallium-xvmc=enabled,-Dgallium-xvmc=disabled,libxvmc"
-PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
-
-# "dri" requires "opengl"
-PACKAGECONFIG[dri] = "-Ddri-drivers=${@strip_comma('${DRIDRIVERS}')}, -Ddri-drivers='', xorgproto libdrm"
-PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"
-
-# Vulkan drivers need dri3 enabled
-# amd could be enabled as well but requires gallium-llvm with llvm >= 3.9
-VULKAN_DRIVERS = ""
-VULKAN_DRIVERS:append:x86:class-target = ",intel"
-VULKAN_DRIVERS:append:x86-64:class-target = ",intel"
-VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
-VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}"
-PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',"
-
-PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
-
-# "gles" requires "opengl"
-PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled"
-
-# "egl" requires "dri", "opengl"
-PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
-
-PACKAGECONFIG[broadcom] = ""
-PACKAGECONFIG[etnaviv] = ""
-PACKAGECONFIG[freedreno] = ""
-PACKAGECONFIG[kmsro] = ""
-PACKAGECONFIG[vc4] = ""
-PACKAGECONFIG[v3d] = ""
-
-GALLIUMDRIVERS = "swrast"
-# gallium swrast was found to crash Xorg on startup in x32 qemu
-GALLIUMDRIVERS:x86-x32 = ""
-GALLIUMDRIVERS:append:x86:class-target = ",i915,iris,crocus"
-GALLIUMDRIVERS:append:x86-64:class-target = ",i915,iris,crocus"
-
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}"
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}"
-
-# radeonsi requires LLVM
-GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
-GALLIUMDRIVERS_LLVM = "r300,nouveau${GALLIUMDRIVERS_RADEONSI}"
-GALLIUMDRIVERS_LLVM:append:x86:class-target = ",svga"
-GALLIUMDRIVERS_LLVM:append:x86-64:class-target = ",svga"
-
-PACKAGECONFIG[r600] = ""
-PACKAGECONFIG[virgl] = ""
-
-GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
-GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}"
-GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}"
-
-PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm"
-PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm${MESA_LLVM_RELEASE} llvm-native \
-                               elfutils"
-PACKAGECONFIG[xa]  = "-Dgallium-xa=enabled, -Dgallium-xa=disabled"
-PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial"
-
-PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau"
-
-PACKAGECONFIG[lima] = ""
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}"
-
-PACKAGECONFIG[panfrost] = ""
-GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}"
-
-PACKAGECONFIG[osmesa] = "-Dosmesa=true,-Dosmesa=false"
-
-PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
-
-PACKAGECONFIG[lmsensors] = "-Dlmsensors=enabled,-Dlmsensors=disabled,lmsensors"
-
-# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
-FULL_OPTIMIZATION:append = " -fno-omit-frame-pointer"
-
-CFLAGS:append:armv5 = " -DMISSING_64BIT_ATOMICS"
-CFLAGS:append:armv6 = " -DMISSING_64BIT_ATOMICS"
-
-# Remove the mesa dependency on mesa-dev, as mesa is empty
-RDEPENDS:${PN}-dev = ""
-
-# Khronos documentation says that include/GLES2/gl2ext.h can be used for
-# OpenGL ES 3 specification as well as for OpenGL ES 2.
-# There can be applications including GLES2/gl2ext.h instead of GLES3/gl3ext.h
-# meaning we should probably bring in GLES2/gl2ext.h if someone asks for
-# development package of libgles3.
-RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
-
-PACKAGES =+ "libegl-mesa libegl-mesa-dev \
-             libosmesa libosmesa-dev \
-             libgl-mesa libgl-mesa-dev \
-             libglapi libglapi-dev \
-             libgbm libgbm-dev \
-             libgles1-mesa libgles1-mesa-dev \
-             libgles2-mesa libgles2-mesa-dev \
-             libgles3-mesa libgles3-mesa-dev \
-             libxatracker libxatracker-dev \
-             mesa-megadriver mesa-vulkan-drivers \
-             mesa-vdpau-drivers \
-            "
-
-do_install:append () {
-    # Drivers never need libtool .la files
-    rm -f ${D}${libdir}/dri/*.la
-    rm -f ${D}${libdir}/egl/*.la
-    rm -f ${D}${libdir}/gallium-pipe/*.la
-    rm -f ${D}${libdir}/gbm/*.la
-
-    # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used 
-    chrpath --delete ${D}${libdir}/dri/*_dri.so || true
-
-    # libwayland-egl has been moved to wayland 1.15+
-    rm -f ${D}${libdir}/libwayland-egl*
-    rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
-}
-
-# For the packages that make up the OpenGL interfaces, inject variables so that
-# they don't get Debian-renamed (which would remove the -mesa suffix), and
-# RPROVIDEs/RCONFLICTs on the generic libgl name.
-python __anonymous() {
-    pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
-    suffix = ""
-    if "-native" in d.getVar("PN"):
-        suffix = "-native"
-    for p in (("egl", "libegl", "libegl1"),
-              ("dri", "libgl", "libgl1"),
-              ("gles", "libgles1", "libglesv1-cm1"),
-              ("gles", "libgles2", "libglesv2-2"),
-              ("gles", "libgles3",)):
-        if not p[0] in pkgconfig:
-            continue
-        mlprefix = d.getVar("MLPREFIX")
-        fullp = mlprefix + p[1] + "-mesa" + suffix
-        mlprefix = d.getVar("MLPREFIX")
-        pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:])
-        d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
-        d.appendVar("RREPLACES:" + fullp, pkgs)
-        d.appendVar("RPROVIDES:" + fullp, pkgs)
-        d.appendVar("RCONFLICTS:" + fullp, pkgs)
-
-        d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}mesa-megadriver" + suffix)
-
-        # For -dev, the first element is both the Debian and original name
-        fullp = mlprefix + p[1] + "-mesa-dev" + suffix
-        pkgs = " " + mlprefix + p[1] + "-dev" + suffix
-        d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
-        d.appendVar("RREPLACES:" + fullp, pkgs)
-        d.appendVar("RPROVIDES:" + fullp, pkgs)
-        d.appendVar("RCONFLICTS:" + fullp, pkgs)
-}
-
-python mesa_populate_packages() {
-    pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
-    for pkg in pkgs:
-        d.setVar("RPROVIDES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
-        d.setVar("RCONFLICTS:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
-        d.setVar("RREPLACES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
-
-    import re
-    dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri")
-    if os.path.isdir(dri_drivers_root):
-        dri_pkgs = sorted(os.listdir(dri_drivers_root))
-        lib_name = d.expand("${MLPREFIX}mesa-megadriver")
-        for p in dri_pkgs:
-            m = re.match(r'^(.*)_dri\.so$', p)
-            if m:
-                pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
-                d.appendVar("RPROVIDES:%s" % lib_name, pkg_name)
-                d.appendVar("RCONFLICTS:%s" % lib_name, pkg_name)
-                d.appendVar("RREPLACES:%s" % lib_name, pkg_name)
-
-    pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe")
-    do_split_packages(d, pipe_drivers_root, r'^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
-}
-
-PACKAGESPLITFUNCS:prepend = "mesa_populate_packages "
-
-PACKAGES_DYNAMIC += "^mesa-driver-.*"
-PACKAGES_DYNAMIC:class-native = "^mesa-driver-.*-native"
-
-FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d/00-mesa-defaults.conf"
-FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
-FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
-FILES:libegl-mesa = "${libdir}/libEGL.so.*"
-FILES:libgbm = "${libdir}/libgbm.so.*"
-FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
-FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
-FILES:libgl-mesa = "${libdir}/libGL.so.*"
-FILES:libglapi = "${libdir}/libglapi.so.*"
-FILES:libosmesa = "${libdir}/libOSMesa.so.*"
-FILES:libxatracker = "${libdir}/libxatracker.so.*"
-
-FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so"
-FILES:libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
-FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
-FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
-FILES:libglapi-dev = "${libdir}/libglapi.*"
-FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
-FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
-FILES:libgles3-mesa-dev = "${includedir}/GLES3"
-FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
-FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
-                          ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
-                          ${libdir}/pkgconfig/xatracker.pc"
-
-# Fix upgrade path from mesa to mesa-megadriver
-RREPLACES:mesa-megadriver = "mesa"
-RCONFLICTS:mesa-megadriver = "mesa"
-RPROVIDES:mesa-megadriver = "mesa"
diff --git a/meta/recipes-graphics/mesa/mesa_21.3.5.bb b/meta/recipes-graphics/mesa/mesa_21.3.5.bb
index 4cb7e80eb5..e4f20f6e24 100644
--- a/meta/recipes-graphics/mesa/mesa_21.3.5.bb
+++ b/meta/recipes-graphics/mesa/mesa_21.3.5.bb
@@ -1,5 +1,340 @@
-require ${BPN}.inc
+SUMMARY = "A free implementation of the OpenGL API"
+DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \
+a system for rendering interactive 3D graphics.  \
+A variety of device drivers allows Mesa to be used in many different environments \
+ranging from software emulation to complete hardware acceleration for modern GPUs. \
+Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \
+environment."
+
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=17a4ea65de7a9ab42437f3131e616a7f"
+
+PE = "2"
+
+SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
+           file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
+           file://0002-meson.build-make-TLS-ELF-optional.patch \
+           file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
+           file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
+           file://0001-util-format-Check-for-NEON-before-using-it.patch \
+           file://0001-v3dv-account-for-64bit-time_t-on-32bit-arches.patch \
+           "
+
+SRC_URI[sha256sum] = "d93b2a9d2464ee856d7637a07dff6b7cd950f295ad58518bb959f76882cf4a4c"
+
+UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install:append() {
+    if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+        sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+    fi
+}
+
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"
+EXTRANATIVEPATH += "chrpath-native"
+PROVIDES = " \
+    ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
+    virtual/mesa \
+    "
+
+inherit meson pkgconfig python3native gettext features_check
+
+BBCLASSEXTEND = "native nativesdk"
+
+ANY_OF_DISTRO_FEATURES:class-target = "opengl vulkan"
+
+PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}"
+
+export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config"
+export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}"
+export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}"
+export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
+
+MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
+
+# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
+# by default the upstream mesa sources build a debug release
+# here we assume the user will want a release build by default
+MESA_BUILD_TYPE ?= "release"
+def check_buildtype(d):
+    _buildtype = d.getVar('MESA_BUILD_TYPE')
+    if _buildtype not in ['release', 'debug']:
+        bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
+    if _buildtype == 'debug':
+        return 'debugoptimized'
+    return 'plain'
+MESON_BUILDTYPE = "${@check_buildtype(d)}"
+
+EXTRA_OEMESON = " \
+    -Dshared-glapi=enabled \
+    -Dgallium-opencl=disabled \
+    -Dglx-read-only-text=true \
+    -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
+"
+
+def strip_comma(s):
+    return s.strip(',')
+
+PACKAGECONFIG:class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri gallium virgl', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
+                   elf-tls \
+		   "
+PACKAGECONFIG:class-native ?= "gbm gallium egl opengl elf-tls x11"
+PACKAGECONFIG:class-nativesdk ?= "gbm gallium egl opengl elf-tls x11"
+
+PACKAGECONFIG:remove:libc-musl = "elf-tls"
+
+# "gbm" requires "dri", "opengl"
+PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled"
+
+X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr"
+# "x11" requires "opengl"
+PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}"
+PACKAGECONFIG[elf-tls] = "-Delf-tls=true, -Delf-tls=false"
+PACKAGECONFIG[xvmc] = "-Dgallium-xvmc=enabled,-Dgallium-xvmc=disabled,libxvmc"
+PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
+
+# "dri" requires "opengl"
+PACKAGECONFIG[dri] = "-Ddri-drivers=${@strip_comma('${DRIDRIVERS}')}, -Ddri-drivers='', xorgproto libdrm"
+PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"
+
+# Vulkan drivers need dri3 enabled
+# amd could be enabled as well but requires gallium-llvm with llvm >= 3.9
+VULKAN_DRIVERS = ""
+VULKAN_DRIVERS:append:x86:class-target = ",intel"
+VULKAN_DRIVERS:append:x86-64:class-target = ",intel"
+VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
+VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}"
+PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',"
+
+PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
+
+# "gles" requires "opengl"
+PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled"
+
+# "egl" requires "dri", "opengl"
+PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
+
+PACKAGECONFIG[broadcom] = ""
+PACKAGECONFIG[etnaviv] = ""
+PACKAGECONFIG[freedreno] = ""
+PACKAGECONFIG[kmsro] = ""
+PACKAGECONFIG[vc4] = ""
+PACKAGECONFIG[v3d] = ""
+
+GALLIUMDRIVERS = "swrast"
+# gallium swrast was found to crash Xorg on startup in x32 qemu
+GALLIUMDRIVERS:x86-x32 = ""
+GALLIUMDRIVERS:append:x86:class-target = ",i915,iris,crocus"
+GALLIUMDRIVERS:append:x86-64:class-target = ",i915,iris,crocus"
+
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}"
+
+# radeonsi requires LLVM
+GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
+GALLIUMDRIVERS_LLVM = "r300,nouveau${GALLIUMDRIVERS_RADEONSI}"
+GALLIUMDRIVERS_LLVM:append:x86:class-target = ",svga"
+GALLIUMDRIVERS_LLVM:append:x86-64:class-target = ",svga"
+
+PACKAGECONFIG[r600] = ""
+PACKAGECONFIG[virgl] = ""
+
+GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
+GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}"
+GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}"
+
+PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm"
+PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm${MESA_LLVM_RELEASE} llvm-native \
+                               elfutils"
+PACKAGECONFIG[xa]  = "-Dgallium-xa=enabled, -Dgallium-xa=disabled"
+PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial"
+
+PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau"
+
+PACKAGECONFIG[lima] = ""
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}"
+
+PACKAGECONFIG[panfrost] = ""
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}"
+
+PACKAGECONFIG[osmesa] = "-Dosmesa=true,-Dosmesa=false"
+
+PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
+
+PACKAGECONFIG[lmsensors] = "-Dlmsensors=enabled,-Dlmsensors=disabled,lmsensors"
+
+# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
+FULL_OPTIMIZATION:append = " -fno-omit-frame-pointer"
+
+CFLAGS:append:armv5 = " -DMISSING_64BIT_ATOMICS"
+CFLAGS:append:armv6 = " -DMISSING_64BIT_ATOMICS"
+
+# Remove the mesa dependency on mesa-dev, as mesa is empty
+RDEPENDS:${PN}-dev = ""
+
+# Khronos documentation says that include/GLES2/gl2ext.h can be used for
+# OpenGL ES 3 specification as well as for OpenGL ES 2.
+# There can be applications including GLES2/gl2ext.h instead of GLES3/gl3ext.h
+# meaning we should probably bring in GLES2/gl2ext.h if someone asks for
+# development package of libgles3.
+RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
+
+PACKAGES =+ "libegl-mesa libegl-mesa-dev \
+             libosmesa libosmesa-dev \
+             libgl-mesa libgl-mesa-dev \
+             libglapi libglapi-dev \
+             libgbm libgbm-dev \
+             libgles1-mesa libgles1-mesa-dev \
+             libgles2-mesa libgles2-mesa-dev \
+             libgles3-mesa libgles3-mesa-dev \
+             libxatracker libxatracker-dev \
+             mesa-megadriver mesa-vulkan-drivers \
+             mesa-vdpau-drivers \
+            "
+
+do_install:append () {
+    # Drivers never need libtool .la files
+    rm -f ${D}${libdir}/dri/*.la
+    rm -f ${D}${libdir}/egl/*.la
+    rm -f ${D}${libdir}/gallium-pipe/*.la
+    rm -f ${D}${libdir}/gbm/*.la
+
+    # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used 
+    chrpath --delete ${D}${libdir}/dri/*_dri.so || true
+
+    # libwayland-egl has been moved to wayland 1.15+
+    rm -f ${D}${libdir}/libwayland-egl*
+    rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
+}
+
+# For the packages that make up the OpenGL interfaces, inject variables so that
+# they don't get Debian-renamed (which would remove the -mesa suffix), and
+# RPROVIDEs/RCONFLICTs on the generic libgl name.
+python __anonymous() {
+    pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
+    suffix = ""
+    if "-native" in d.getVar("PN"):
+        suffix = "-native"
+    for p in (("egl", "libegl", "libegl1"),
+              ("dri", "libgl", "libgl1"),
+              ("gles", "libgles1", "libglesv1-cm1"),
+              ("gles", "libgles2", "libglesv2-2"),
+              ("gles", "libgles3",)):
+        if not p[0] in pkgconfig:
+            continue
+        mlprefix = d.getVar("MLPREFIX")
+        fullp = mlprefix + p[1] + "-mesa" + suffix
+        mlprefix = d.getVar("MLPREFIX")
+        pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:])
+        d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
+        d.appendVar("RREPLACES:" + fullp, pkgs)
+        d.appendVar("RPROVIDES:" + fullp, pkgs)
+        d.appendVar("RCONFLICTS:" + fullp, pkgs)
+
+        d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}mesa-megadriver" + suffix)
+
+        # For -dev, the first element is both the Debian and original name
+        fullp = mlprefix + p[1] + "-mesa-dev" + suffix
+        pkgs = " " + mlprefix + p[1] + "-dev" + suffix
+        d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
+        d.appendVar("RREPLACES:" + fullp, pkgs)
+        d.appendVar("RPROVIDES:" + fullp, pkgs)
+        d.appendVar("RCONFLICTS:" + fullp, pkgs)
+}
+
+python mesa_populate_packages() {
+    pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
+    for pkg in pkgs:
+        d.setVar("RPROVIDES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+        d.setVar("RCONFLICTS:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+        d.setVar("RREPLACES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+
+    import re
+    dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri")
+    if os.path.isdir(dri_drivers_root):
+        dri_pkgs = sorted(os.listdir(dri_drivers_root))
+        lib_name = d.expand("${MLPREFIX}mesa-megadriver")
+        for p in dri_pkgs:
+            m = re.match(r'^(.*)_dri\.so$', p)
+            if m:
+                pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
+                d.appendVar("RPROVIDES:%s" % lib_name, pkg_name)
+                d.appendVar("RCONFLICTS:%s" % lib_name, pkg_name)
+                d.appendVar("RREPLACES:%s" % lib_name, pkg_name)
+
+    pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe")
+    do_split_packages(d, pipe_drivers_root, r'^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
+}
+
+PACKAGESPLITFUNCS:prepend = "mesa_populate_packages "
+
+PACKAGES_DYNAMIC += "^mesa-driver-.*"
+PACKAGES_DYNAMIC:class-native = "^mesa-driver-.*-native"
+
+FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d/00-mesa-defaults.conf"
+FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
+FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
+FILES:libegl-mesa = "${libdir}/libEGL.so.*"
+FILES:libgbm = "${libdir}/libgbm.so.*"
+FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
+FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
+FILES:libgl-mesa = "${libdir}/libGL.so.*"
+FILES:libglapi = "${libdir}/libglapi.so.*"
+FILES:libosmesa = "${libdir}/libOSMesa.so.*"
+FILES:libxatracker = "${libdir}/libxatracker.so.*"
+
+FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so"
+FILES:libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
+FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
+FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
+FILES:libglapi-dev = "${libdir}/libglapi.*"
+FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
+FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
+FILES:libgles3-mesa-dev = "${includedir}/GLES3"
+FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
+FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
+                          ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
+                          ${libdir}/pkgconfig/xatracker.pc"
+
+# Fix upgrade path from mesa to mesa-megadriver
+RREPLACES:mesa-megadriver = "mesa"
+RCONFLICTS:mesa-megadriver = "mesa"
+RPROVIDES:mesa-megadriver = "mesa"
+
+# basic mesa recipe
 DRIDRIVERS ??= ""
 DRIDRIVERS:append:x86:class-target = ",r100,r200,nouveau,i965"
 DRIDRIVERS:append:x86-64:class-target = ",r100,r200,nouveau,i965"
 
+# mesa-gl variant
+inherit mcextend
+
+BBCLASSEXTEND += "mcextend:gl"
+
+S:virtclass-mcextend-gl = "${WORKDIR}/mesa-${PV}"
+
+SUMMARY:append:virtclass-mcextend-gl = " (OpenGL only, no EGL/GLES)"
+
+PROVIDES:virtclass-mcextend-gl = "virtual/libgl virtual/mesa"
+
+# At least one DRI rendering engine is required to build mesa.
+# When no X11 is available, use osmesa for the rendering engine.
+PACKAGECONFIG:virtclass-mcextend-gl = "opengl dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}"
+
+# 21.0.0 version fails to build when any driver is enabled in DRIDRIVERS
+# ./mesa-21.0.0/meson.build:519:4: ERROR: Problem encountered: building dri drivers require at least one windowing system
+DRIDRIVERS:virtclass-mcextend-gl = ""
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/8] gdb: update 11.1 -> 11.2
  2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
@ 2022-02-06 21:53 ` Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 3/8] insane.bbclass: use multiprocessing for collecting 'objdump -p' output Alexander Kanavin
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

Simplyfy .inc structure: merge gdb.inc into gdb_11.2.bb, rename
gdb-${PV}.inc to gdb.inc. This will allow easier automatic updates.

Drop upstreamed patch.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/recipes-devtools/gdb/gdb-11.1.inc        |  19 --
 ...ian_11.1.bb => gdb-cross-canadian_11.2.bb} |   2 +-
 .../{gdb-cross_11.1.bb => gdb-cross_11.2.bb}  |   2 +-
 meta/recipes-devtools/gdb/gdb.inc             |  27 +-
 ...erver-register-set-selection-dynamic.patch | 317 ------------------
 .../gdb/{gdb_11.1.bb => gdb_11.2.bb}          |  13 +-
 6 files changed, 31 insertions(+), 349 deletions(-)
 delete mode 100644 meta/recipes-devtools/gdb/gdb-11.1.inc
 rename meta/recipes-devtools/gdb/{gdb-cross-canadian_11.1.bb => gdb-cross-canadian_11.2.bb} (71%)
 rename meta/recipes-devtools/gdb/{gdb-cross_11.1.bb => gdb-cross_11.2.bb} (50%)
 delete mode 100644 meta/recipes-devtools/gdb/gdb/0011-AArch64-Make-gdbserver-register-set-selection-dynamic.patch
 rename meta/recipes-devtools/gdb/{gdb_11.1.bb => gdb_11.2.bb} (80%)

diff --git a/meta/recipes-devtools/gdb/gdb-11.1.inc b/meta/recipes-devtools/gdb/gdb-11.1.inc
deleted file mode 100644
index 5364a880e3..0000000000
--- a/meta/recipes-devtools/gdb/gdb-11.1.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
-		    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
-		    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
-		    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
-
-SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \
-           file://0001-make-man-install-relative-to-DESTDIR.patch \
-           file://0002-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
-           file://0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
-           file://0005-Dont-disable-libreadline.a-when-using-disable-static.patch \
-           file://0006-use-asm-sgidefs.h.patch \
-           file://0007-Change-order-of-CFLAGS.patch \
-           file://0008-resolve-restrict-keyword-conflict.patch \
-           file://0009-Fix-invalid-sigprocmask-call.patch \
-           file://0010-gdbserver-ctrl-c-handling.patch \
-           file://0011-AArch64-Make-gdbserver-register-set-selection-dynamic.patch \
-           "
-SRC_URI[sha256sum] = "cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94"
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian_11.1.bb b/meta/recipes-devtools/gdb/gdb-cross-canadian_11.2.bb
similarity index 71%
rename from meta/recipes-devtools/gdb/gdb-cross-canadian_11.1.bb
rename to meta/recipes-devtools/gdb/gdb-cross-canadian_11.2.bb
index 301035940c..4ab2b7156d 100644
--- a/meta/recipes-devtools/gdb/gdb-cross-canadian_11.1.bb
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian_11.2.bb
@@ -1,3 +1,3 @@
 require gdb-common.inc
 require gdb-cross-canadian.inc
-require gdb-${PV}.inc
+require gdb.inc
diff --git a/meta/recipes-devtools/gdb/gdb-cross_11.1.bb b/meta/recipes-devtools/gdb/gdb-cross_11.2.bb
similarity index 50%
rename from meta/recipes-devtools/gdb/gdb-cross_11.1.bb
rename to meta/recipes-devtools/gdb/gdb-cross_11.2.bb
index 50cf159fdb..3b654a2f0d 100644
--- a/meta/recipes-devtools/gdb/gdb-cross_11.1.bb
+++ b/meta/recipes-devtools/gdb/gdb-cross_11.2.bb
@@ -1,2 +1,2 @@
 require gdb-cross.inc
-require gdb-${PV}.inc
+require gdb.inc
diff --git a/meta/recipes-devtools/gdb/gdb.inc b/meta/recipes-devtools/gdb/gdb.inc
index 2c95ed3ca0..cf801b192b 100644
--- a/meta/recipes-devtools/gdb/gdb.inc
+++ b/meta/recipes-devtools/gdb/gdb.inc
@@ -1,11 +1,18 @@
-require gdb-common.inc
-
-inherit gettext pkgconfig
-
-#LDFLAGS:append = " -s"
-#export CFLAGS:append=" -L${STAGING_LIBDIR}"
-
-# cross-canadian must not see this
-PACKAGES =+ "gdbserver"
-FILES:gdbserver = "${bindir}/gdbserver"
+LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+		    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+		    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+		    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
 
+SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \
+           file://0001-make-man-install-relative-to-DESTDIR.patch \
+           file://0002-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
+           file://0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
+           file://0005-Dont-disable-libreadline.a-when-using-disable-static.patch \
+           file://0006-use-asm-sgidefs.h.patch \
+           file://0007-Change-order-of-CFLAGS.patch \
+           file://0008-resolve-restrict-keyword-conflict.patch \
+           file://0009-Fix-invalid-sigprocmask-call.patch \
+           file://0010-gdbserver-ctrl-c-handling.patch \
+           "
+SRC_URI[sha256sum] = "1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32"
diff --git a/meta/recipes-devtools/gdb/gdb/0011-AArch64-Make-gdbserver-register-set-selection-dynamic.patch b/meta/recipes-devtools/gdb/gdb/0011-AArch64-Make-gdbserver-register-set-selection-dynamic.patch
deleted file mode 100644
index 6fc1859391..0000000000
--- a/meta/recipes-devtools/gdb/gdb/0011-AArch64-Make-gdbserver-register-set-selection-dynamic.patch
+++ /dev/null
@@ -1,317 +0,0 @@
-From eb79b2318066cafb75ffdce310e3bbd44f7c79e3 Mon Sep 17 00:00:00 2001
-From: Luis Machado <luis.machado@linaro.org>
-Date: Fri, 29 Oct 2021 14:54:36 -0300
-Subject: [PATCH] [AArch64] Make gdbserver register set selection dynamic
-
-The current register set selection mechanism for AArch64 is static, based
-on a pre-populated array of register sets.
-
-This means that we might potentially probe register sets that are not
-available. This is OK if the kernel errors out during ptrace, but probing the
-tag_ctl register, for example, does not result in a ptrace error if the kernel
-supports the tagged address ABI but not MTE (PR 28355).
-
-Making the register set selection dynamic, based on feature checks, solves
-this and simplifies the code a bit. It allows us to list all of the register
-sets only once, and pick and choose based on HWCAP/HWCAP2 or other properties.
-
-gdb/ChangeLog:
-
-2021-11-03  Luis Machado  <luis.machado@linaro.org>
-
-	PR gdb/28355
-
-	* arch/aarch64.h (struct aarch64_features): New struct.
-
-gdbserver/ChangeLog:
-
-2021-11-03  Luis Machado  <luis.machado@linaro.org>
-
-	PR gdb/28355
-
-	* linux-aarch64-low.cc (is_sve_tdesc): Remove.
-	(aarch64_target::low_arch_setup): Rework to adjust the register sets.
-	(aarch64_regsets): Update to list all register sets.
-	(aarch64_regsets_info, regs_info_aarch64): Replace NULL with nullptr.
-	(aarch64_sve_regsets, aarch64_sve_regsets_info)
-	(regs_info_aarch64_sve): Remove.
-	(aarch64_adjust_register_sets): New.
-	(aarch64_target::get_regs_info): Remove references to removed structs.
-	(initialize_low_arch): Likewise.
-
-[ChangeLog entry stripped so that patch applies cleanly]
-Upstream-Status: Accepted
----
-
-diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h
-index 0eb702c5b5e..95edb664b55 100644
---- a/gdb/arch/aarch64.h
-+++ b/gdb/arch/aarch64.h
-@@ -22,6 +22,15 @@
- 
- #include "gdbsupport/tdesc.h"
- 
-+/* Holds information on what architectural features are available.  This is
-+   used to select register sets.  */
-+struct aarch64_features
-+{
-+  bool sve = false;
-+  bool pauth = false;
-+  bool mte = false;
-+};
-+
- /* Create the aarch64 target description.  A non zero VQ value indicates both
-    the presence of SVE and the Vector Quotient - the number of 128bit chunks in
-    an SVE Z register.  HAS_PAUTH_P indicates the presence of the PAUTH
-diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
-index daccfef746e..9a8cb4169a7 100644
---- a/gdbserver/linux-aarch64-low.cc
-+++ b/gdbserver/linux-aarch64-low.cc
-@@ -196,16 +196,6 @@ is_64bit_tdesc (void)
-   return register_size (regcache->tdesc, 0) == 8;
- }
- 
--/* Return true if the regcache contains the number of SVE registers.  */
--
--static bool
--is_sve_tdesc (void)
--{
--  struct regcache *regcache = get_thread_regcache (current_thread, 0);
--
--  return tdesc_contains_feature (regcache->tdesc, "org.gnu.gdb.aarch64.sve");
--}
--
- static void
- aarch64_fill_gregset (struct regcache *regcache, void *buf)
- {
-@@ -680,40 +670,6 @@ aarch64_target::low_new_fork (process_info *parent,
-   *child->priv->arch_private = *parent->priv->arch_private;
- }
- 
--/* Matches HWCAP_PACA in kernel header arch/arm64/include/uapi/asm/hwcap.h.  */
--#define AARCH64_HWCAP_PACA (1 << 30)
--
--/* Implementation of linux target ops method "low_arch_setup".  */
--
--void
--aarch64_target::low_arch_setup ()
--{
--  unsigned int machine;
--  int is_elf64;
--  int tid;
--
--  tid = lwpid_of (current_thread);
--
--  is_elf64 = linux_pid_exe_is_elf_64_file (tid, &machine);
--
--  if (is_elf64)
--    {
--      uint64_t vq = aarch64_sve_get_vq (tid);
--      unsigned long hwcap = linux_get_hwcap (8);
--      unsigned long hwcap2 = linux_get_hwcap2 (8);
--      bool pauth_p = hwcap & AARCH64_HWCAP_PACA;
--      /* MTE is AArch64-only.  */
--      bool mte_p = hwcap2 & HWCAP2_MTE;
--
--      current_process ()->tdesc
--	= aarch64_linux_read_description (vq, pauth_p, mte_p);
--    }
--  else
--    current_process ()->tdesc = aarch32_linux_read_description ();
--
--  aarch64_linux_get_debug_reg_capacity (lwpid_of (current_thread));
--}
--
- /* Wrapper for aarch64_sve_regs_copy_to_reg_buf.  */
- 
- static void
-@@ -730,21 +686,36 @@ aarch64_sve_regs_copy_from_regcache (struct regcache *regcache, void *buf)
-   return aarch64_sve_regs_copy_from_reg_buf (regcache, buf);
- }
- 
-+/* Array containing all the possible register sets for AArch64/Linux.  During
-+   architecture setup, these will be checked against the HWCAP/HWCAP2 bits for
-+   validity and enabled/disabled accordingly.
-+
-+   Their sizes are set to 0 here, but they will be adjusted later depending
-+   on whether each register set is available or not.  */
- static struct regset_info aarch64_regsets[] =
- {
-+  /* GPR registers.  */
-   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PRSTATUS,
--    sizeof (struct user_pt_regs), GENERAL_REGS,
-+    0, GENERAL_REGS,
-     aarch64_fill_gregset, aarch64_store_gregset },
-+  /* Floating Point (FPU) registers.  */
-   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_FPREGSET,
--    sizeof (struct user_fpsimd_state), FP_REGS,
-+    0, FP_REGS,
-     aarch64_fill_fpregset, aarch64_store_fpregset
-   },
-+  /* Scalable Vector Extension (SVE) registers.  */
-+  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_SVE,
-+    0, EXTENDED_REGS,
-+    aarch64_sve_regs_copy_from_regcache, aarch64_sve_regs_copy_to_regcache
-+  },
-+  /* PAC registers.  */
-   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_PAC_MASK,
--    AARCH64_PAUTH_REGS_SIZE, OPTIONAL_REGS,
--    NULL, aarch64_store_pauthregset },
-+    0, OPTIONAL_REGS,
-+    nullptr, aarch64_store_pauthregset },
-+  /* Tagged address control / MTE registers.  */
-   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_TAGGED_ADDR_CTRL,
--    AARCH64_LINUX_SIZEOF_MTE, OPTIONAL_REGS, aarch64_fill_mteregset,
--    aarch64_store_mteregset },
-+    0, OPTIONAL_REGS,
-+    aarch64_fill_mteregset, aarch64_store_mteregset },
-   NULL_REGSET
- };
- 
-@@ -752,47 +723,95 @@ static struct regsets_info aarch64_regsets_info =
-   {
-     aarch64_regsets, /* regsets */
-     0, /* num_regsets */
--    NULL, /* disabled_regsets */
-+    nullptr, /* disabled_regsets */
-   };
- 
- static struct regs_info regs_info_aarch64 =
-   {
--    NULL, /* regset_bitmap */
--    NULL, /* usrregs */
-+    nullptr, /* regset_bitmap */
-+    nullptr, /* usrregs */
-     &aarch64_regsets_info,
-   };
- 
--static struct regset_info aarch64_sve_regsets[] =
-+/* Given FEATURES, adjust the available register sets by setting their
-+   sizes.  A size of 0 means the register set is disabled and won't be
-+   used.  */
-+
-+static void
-+aarch64_adjust_register_sets (const struct aarch64_features &features)
- {
--  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PRSTATUS,
--    sizeof (struct user_pt_regs), GENERAL_REGS,
--    aarch64_fill_gregset, aarch64_store_gregset },
--  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_SVE,
--    SVE_PT_SIZE (AARCH64_MAX_SVE_VQ, SVE_PT_REGS_SVE), EXTENDED_REGS,
--    aarch64_sve_regs_copy_from_regcache, aarch64_sve_regs_copy_to_regcache
--  },
--  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_PAC_MASK,
--    AARCH64_PAUTH_REGS_SIZE, OPTIONAL_REGS,
--    NULL, aarch64_store_pauthregset },
--  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_TAGGED_ADDR_CTRL,
--    AARCH64_LINUX_SIZEOF_MTE, OPTIONAL_REGS, aarch64_fill_mteregset,
--    aarch64_store_mteregset },
--  NULL_REGSET
--};
-+  struct regset_info *regset;
- 
--static struct regsets_info aarch64_sve_regsets_info =
--  {
--    aarch64_sve_regsets, /* regsets.  */
--    0, /* num_regsets.  */
--    NULL, /* disabled_regsets.  */
--  };
-+  for (regset = aarch64_regsets; regset->size >= 0; regset++)
-+    {
-+      switch (regset->nt_type)
-+	{
-+	case NT_PRSTATUS:
-+	  /* General purpose registers are always present.  */
-+	  regset->size = sizeof (struct user_pt_regs);
-+	  break;
-+	case NT_FPREGSET:
-+	  /* This is unavailable when SVE is present.  */
-+	  if (!features.sve)
-+	    regset->size = sizeof (struct user_fpsimd_state);
-+	  break;
-+	case NT_ARM_SVE:
-+	  if (features.sve)
-+	    regset->size = SVE_PT_SIZE (AARCH64_MAX_SVE_VQ, SVE_PT_REGS_SVE);
-+	  break;
-+	case NT_ARM_PAC_MASK:
-+	  if (features.pauth)
-+	    regset->size = AARCH64_PAUTH_REGS_SIZE;
-+	  break;
-+	case NT_ARM_TAGGED_ADDR_CTRL:
-+	  if (features.mte)
-+	    regset->size = AARCH64_LINUX_SIZEOF_MTE;
-+	  break;
-+	default:
-+	  gdb_assert_not_reached ("Unknown register set found.");
-+	}
-+    }
-+}
- 
--static struct regs_info regs_info_aarch64_sve =
--  {
--    NULL, /* regset_bitmap.  */
--    NULL, /* usrregs.  */
--    &aarch64_sve_regsets_info,
--  };
-+/* Matches HWCAP_PACA in kernel header arch/arm64/include/uapi/asm/hwcap.h.  */
-+#define AARCH64_HWCAP_PACA (1 << 30)
-+
-+/* Implementation of linux target ops method "low_arch_setup".  */
-+
-+void
-+aarch64_target::low_arch_setup ()
-+{
-+  unsigned int machine;
-+  int is_elf64;
-+  int tid;
-+
-+  tid = lwpid_of (current_thread);
-+
-+  is_elf64 = linux_pid_exe_is_elf_64_file (tid, &machine);
-+
-+  if (is_elf64)
-+    {
-+      struct aarch64_features features;
-+
-+      uint64_t vq = aarch64_sve_get_vq (tid);
-+      features.sve = (vq > 0);
-+      /* A-profile PAC is 64-bit only.  */
-+      features.pauth = linux_get_hwcap (8) & AARCH64_HWCAP_PACA;
-+      /* A-profile MTE is 64-bit only.  */
-+      features.mte = linux_get_hwcap2 (8) & HWCAP2_MTE;
-+
-+      current_process ()->tdesc
-+	= aarch64_linux_read_description (vq, features.pauth, features.mte);
-+
-+      /* Adjust the register sets we should use for this particular set of
-+	 features.  */
-+      aarch64_adjust_register_sets (features);
-+    }
-+  else
-+    current_process ()->tdesc = aarch32_linux_read_description ();
-+
-+  aarch64_linux_get_debug_reg_capacity (lwpid_of (current_thread));
-+}
- 
- /* Implementation of linux target ops method "get_regs_info".  */
- 
-@@ -802,9 +821,7 @@ aarch64_target::get_regs_info ()
-   if (!is_64bit_tdesc ())
-     return &regs_info_aarch32;
- 
--  if (is_sve_tdesc ())
--    return &regs_info_aarch64_sve;
--
-+  /* AArch64 64-bit registers.  */
-   return &regs_info_aarch64;
- }
- 
-@@ -3294,5 +3311,4 @@ initialize_low_arch (void)
-   initialize_low_arch_aarch32 ();
- 
-   initialize_regsets_info (&aarch64_regsets_info);
--  initialize_regsets_info (&aarch64_sve_regsets_info);
- }
--- 
-2.27.0
-
diff --git a/meta/recipes-devtools/gdb/gdb_11.1.bb b/meta/recipes-devtools/gdb/gdb_11.2.bb
similarity index 80%
rename from meta/recipes-devtools/gdb/gdb_11.1.bb
rename to meta/recipes-devtools/gdb/gdb_11.2.bb
index e73e3a2c5c..9c6db4ca2c 100644
--- a/meta/recipes-devtools/gdb/gdb_11.1.bb
+++ b/meta/recipes-devtools/gdb/gdb_11.2.bb
@@ -1,5 +1,15 @@
+require gdb-common.inc
+
+inherit gettext pkgconfig
+
+#LDFLAGS:append = " -s"
+#export CFLAGS:append=" -L${STAGING_LIBDIR}"
+
+# cross-canadian must not see this
+PACKAGES =+ "gdbserver"
+FILES:gdbserver = "${bindir}/gdbserver"
+
 require gdb.inc
-require gdb-${PV}.inc
 
 inherit python3-dir
 
@@ -26,3 +36,4 @@ EOF
 		chmod +x ${WORKDIR}/python
 	fi
 }
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/8] insane.bbclass: use multiprocessing for collecting 'objdump -p' output
  2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 2/8] gdb: update 11.1 -> 11.2 Alexander Kanavin
@ 2022-02-06 21:53 ` Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 4/8] llvm: update 12.0.1 -> 13.0.1 Alexander Kanavin
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

This was prompted by ltp's unreasonably long package_qa times; it has
a massive amount of executables and insane runs objdump for all of
them, serially.

This reduces the time from 4 minutes to 1m20s on my machine.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes/insane.bbclass | 22 ++++++++++++++++++++--
 meta/lib/oe/qa.py           |  6 ++++++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 11532ecd08..a13a947bcf 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -684,6 +684,10 @@ def package_qa_recipe(warnfuncs, errorfuncs, pn, d):
 
     return len(errors) == 0
 
+def prepopulate_objdump_p(elf, d):
+    output = elf.run_objdump("-p", d)
+    return (elf.name, output)
+
 # Walk over all files in a directory and call func
 def package_qa_walk(warnfuncs, errorfuncs, package, d):
     #if this will throw an exception, then fix the dict above
@@ -692,18 +696,32 @@ def package_qa_walk(warnfuncs, errorfuncs, package, d):
 
     warnings = {}
     errors = {}
+    elves = {}
     for path in pkgfiles[package]:
             elf = None
             if os.path.isfile(path):
                 elf = oe.qa.ELFFile(path)
                 try:
                     elf.open()
+                    elf.close()
                 except oe.qa.NotELFFileError:
                     elf = None
+            if elf:
+                elves[path] = elf
+
+    results = oe.utils.multiprocess_launch(prepopulate_objdump_p, elves.values(), d, extraargs=(d,))
+    for item in results:
+        elves[item[0]].set_objdump("-p", item[1])
+
+    for path in pkgfiles[package]:
+            if path in elves:
+                elves[path].open()
             for func in warnfuncs:
-                func(path, package, d, elf, warnings)
+                func(path, package, d, elves.get(path), warnings)
             for func in errorfuncs:
-                func(path, package, d, elf, errors)
+                func(path, package, d, elves.get(path), errors)
+            if path in elves:
+                elves[path].close()
 
     for w in warnings:
         oe.qa.handle_error(w, warnings[w], d)
diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py
index efab7e8564..89acd3ead0 100644
--- a/meta/lib/oe/qa.py
+++ b/meta/lib/oe/qa.py
@@ -48,6 +48,9 @@ class ELFFile:
         return self
 
     def __exit__(self, exc_type, exc_value, traceback):
+        self.close()
+
+    def close(self):
         if self.data:
             self.data.close()
 
@@ -128,6 +131,9 @@ class ELFFile:
         """
         return self.getShort(ELFFile.E_MACHINE)
 
+    def set_objdump(self, cmd, output):
+        self.objdump_output[cmd] = output
+
     def run_objdump(self, cmd, d):
         import bb.process
         import sys
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/8] llvm: update 12.0.1 -> 13.0.1
  2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 2/8] gdb: update 11.1 -> 11.2 Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 3/8] insane.bbclass: use multiprocessing for collecting 'objdump -p' output Alexander Kanavin
@ 2022-02-06 21:53 ` Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 5/8] python3-numpy: update 1.22.1 -> 1.22.2 Alexander Kanavin
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/conf/distro/include/tcmode-default.inc | 2 +-
 meta/recipes-devtools/llvm/llvm_git.bb      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index 161142cec5..372f8fe59a 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -26,7 +26,7 @@ QEMUVERSION ?= "6.2%"
 GOVERSION ?= "1.17%"
 # This can not use wildcards like 8.0.% since it is also used in mesa to denote
 # llvm version being used, so always bump it with llvm recipe version bump
-LLVMVERSION ?= "12.0.1"
+LLVMVERSION ?= "13.0.1"
 RUSTVERSION ?= "1.58%"
 
 PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
diff --git a/meta/recipes-devtools/llvm/llvm_git.bb b/meta/recipes-devtools/llvm/llvm_git.bb
index d9efa53499..9400bf0821 100644
--- a/meta/recipes-devtools/llvm/llvm_git.bb
+++ b/meta/recipes-devtools/llvm/llvm_git.bb
@@ -19,7 +19,7 @@ inherit cmake pkgconfig
 
 PROVIDES += "llvm${PV}"
 
-PV = "12.0.1"
+PV = "13.0.1"
 
 MAJOR_VERSION = "${@oe.utils.trim_version("${PV}", 1)}"
 
@@ -27,7 +27,7 @@ LLVM_RELEASE = "${PV}"
 LLVM_DIR = "llvm${LLVM_RELEASE}"
 
 BRANCH = "release/${MAJOR_VERSION}.x"
-SRCREV = "fed41342a82f5a3a9201819a82bf7a48313e296b"
+SRCREV = "75e33f71c2dae584b13a7d1186ae0a038ba98838"
 SRC_URI = "git://github.com/llvm/llvm-project.git;branch=${BRANCH};protocol=https \
            file://0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch;striplevel=2 \
            file://0007-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/8] python3-numpy: update 1.22.1 -> 1.22.2
  2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
                   ` (2 preceding siblings ...)
  2022-02-06 21:53 ` [PATCH 4/8] llvm: update 12.0.1 -> 13.0.1 Alexander Kanavin
@ 2022-02-06 21:53 ` Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 6/8] runqemu: preload uninative libraries when host gl drivers are in use Alexander Kanavin
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

Replace an ad hoc fix via patch with an upstream one.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 ...y-core-setup.py-disable-svml-for-now.patch | 29 -------------------
 ...umpy_1.22.1.bb => python3-numpy_1.22.2.bb} |  7 +++--
 2 files changed, 5 insertions(+), 31 deletions(-)
 delete mode 100644 meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch
 rename meta/recipes-devtools/python/{python3-numpy_1.22.1.bb => python3-numpy_1.22.2.bb} (93%)

diff --git a/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch b/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch
deleted file mode 100644
index 66e322116a..0000000000
--- a/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-setup.py-disable-svml-for-now.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 0f0601e79f9ce7614d157284523e6cd8af2259d5 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex@linutronix.de>
-Date: Wed, 5 Jan 2022 12:12:47 +0100
-Subject: [PATCH] numpy/core/setup.py: disable svml for now
-
-The check really doesn't work in cross compiling,
-as it is using host python to see what arch we're
-building on. Issue reported upstream:
-https://github.com/numpy/numpy/issues/20736
-
-Upstream-Status: Inappropriate [needs upstream fix]
-Signed-off-by: Alexander Kanavin <alex@linutronix.de>
----
- numpy/core/setup.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/numpy/core/setup.py b/numpy/core/setup.py
-index a5f423d..945f2dd 100644
---- a/numpy/core/setup.py
-+++ b/numpy/core/setup.py
-@@ -70,7 +70,7 @@ def can_link_svml():
-     """
-     machine = platform.machine()
-     system = platform.system()
--    return "x86_64" in machine and system == "Linux"
-+    return False
- 
- def check_svml_submodule(svmlpath):
-     if not os.path.exists(svmlpath + "/README.md"):
diff --git a/meta/recipes-devtools/python/python3-numpy_1.22.1.bb b/meta/recipes-devtools/python/python3-numpy_1.22.2.bb
similarity index 93%
rename from meta/recipes-devtools/python/python3-numpy_1.22.1.bb
rename to meta/recipes-devtools/python/python3-numpy_1.22.2.bb
index b79ce61fbf..ba0a777551 100644
--- a/meta/recipes-devtools/python/python3-numpy_1.22.1.bb
+++ b/meta/recipes-devtools/python/python3-numpy_1.22.2.bb
@@ -11,9 +11,8 @@ SRC_URI = "https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${S
            file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
            file://0001-numpy-core-Define-RISCV-32-support.patch \
            file://run-ptest \
-           file://0001-numpy-core-setup.py-disable-svml-for-now.patch \
            "
-SRC_URI[sha256sum] = "dd1968402ae20dfd59b34acd799b494be340c774f6295e9bf1c2b9842a5e416d"
+SRC_URI[sha256sum] = "093d513a460fd94f94c16193c3ef29b2d69a33e482071e3d6d6e561a700587a6"
 
 UPSTREAM_CHECK_URI = "https://github.com/numpy/numpy/releases"
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
@@ -26,6 +25,10 @@ S = "${WORKDIR}/numpy-${PV}"
 
 CLEANBROKEN = "1"
 
+do_compile:prepend() {
+    export NPY_DISABLE_SVML=1
+}
+
 FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a ${PYTHON_SITEPACKAGES_DIR}/numpy/random/lib/*.a"
 
 # install what is needed for numpy.test()
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/8] runqemu: preload uninative libraries when host gl drivers are in use
  2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
                   ` (3 preceding siblings ...)
  2022-02-06 21:53 ` [PATCH 5/8] python3-numpy: update 1.22.1 -> 1.22.2 Alexander Kanavin
@ 2022-02-06 21:53 ` Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 7/8] qemu: replace a gtk wrapper with directly setting environment from runqemu Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 8/8] sstate: additional debugging when fetch fails occur Alexander Kanavin
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

Some of the host distributions build the drivers in a way (RPATH/RUNPATH)
that tricks uninative loader into loading pieces of the host libc, if
the same pieces haven't been previously loaded by native binaries. Mixing
the two libc versions leads to failures.

This change ensures that the correct (uninative) versions are always in use.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes/qemuboot.bbclass | 2 +-
 scripts/runqemu               | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index cc1cbce69d..229bd88527 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -109,7 +109,7 @@ def qemuboot_vars(d):
     build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
                 'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME',
                 'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE',
-                'STAGING_DIR_HOST', 'SERIAL_CONSOLES']
+                'STAGING_DIR_HOST', 'SERIAL_CONSOLES', 'UNINATIVE_LOADER']
     return build_vars + [k for k in d.keys() if k.startswith('QB_')]
 
 do_write_qemuboot_conf[vardeps] += "${@' '.join(qemuboot_vars(d))}"
diff --git a/scripts/runqemu b/scripts/runqemu
index 4e05c1bb15..d60cb2e152 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -461,6 +461,14 @@ class BaseConfig(object):
             raise RunQemuError("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.")
         os.environ['LIBGL_DRIVERS_PATH'] = dripath.decode('utf-8').strip()
 
+        # This preloads uninative libc pieces and therefore ensures that RPATH/RUNPATH
+        # in host mesa drivers doesn't trick uninative into loading host libc.
+        preload_items = ['libdl.so.2', 'librt.so.1', 'libpthread.so.0']
+        uninative_path = os.path.dirname(self.get("UNINATIVE_LOADER"))
+        if os.path.exists(uninative_path):
+            preload_paths = [os.path.join(uninative_path, i) for i in preload_items]
+            os.environ['LD_PRELOAD'] = " ".join(preload_paths)
+
     def check_args(self):
         for debug in ("-d", "--debug"):
             if debug in sys.argv:
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 7/8] qemu: replace a gtk wrapper with directly setting environment from runqemu
  2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
                   ` (4 preceding siblings ...)
  2022-02-06 21:53 ` [PATCH 6/8] runqemu: preload uninative libraries when host gl drivers are in use Alexander Kanavin
@ 2022-02-06 21:53 ` Alexander Kanavin
  2022-02-06 21:53 ` [PATCH 8/8] sstate: additional debugging when fetch fails occur Alexander Kanavin
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

The wrapper is executed by host bash, and host bash refuses to run
when pseudo libc is preloaded via LD_PRELOAD (which is the case
when gl is enabled).

Only the fontconfig setting is carried over as local testing showed that
only that is necessary for the gui to look ok nowadays; adjust further
if necessary.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/recipes-devtools/qemu/qemu-native.inc |  4 ----
 meta/recipes-devtools/qemu/qemu.inc        | 11 -----------
 meta/recipes-devtools/qemu/qemu_6.2.0.bb   |  4 ----
 scripts/runqemu                            |  1 +
 4 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/meta/recipes-devtools/qemu/qemu-native.inc b/meta/recipes-devtools/qemu/qemu-native.inc
index 5d3ba3486c..d9acc613f9 100644
--- a/meta/recipes-devtools/qemu/qemu-native.inc
+++ b/meta/recipes-devtools/qemu/qemu-native.inc
@@ -5,7 +5,3 @@ inherit native
 EXTRA_OEMAKE:append = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
 
 LDFLAGS:append = " -fuse-ld=bfd"
-
-do_install:append() {
-     ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
-}
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 843de3337a..325118cfb3 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -138,17 +138,6 @@ do_install:append() {
 }
 # END of qemu-mips workaround
 
-make_qemu_wrapper() {
-        gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0`
-
-        for tool in `ls ${D}${bindir}/qemu-system-*`; do
-                create_wrapper $tool \
-                        GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \
-                        FONTCONFIG_PATH=/etc/fonts \
-                        GTK_THEME=Adwaita
-        done
-}
-
 # Disable kvm/virgl/mesa on targets that do not support it
 PACKAGECONFIG:remove:darwin = "kvm virglrenderer glx gtk+"
 PACKAGECONFIG:remove:mingw32 = "kvm virglrenderer glx gtk+"
diff --git a/meta/recipes-devtools/qemu/qemu_6.2.0.bb b/meta/recipes-devtools/qemu/qemu_6.2.0.bb
index c9a53e3b05..062ed32b01 100644
--- a/meta/recipes-devtools/qemu/qemu_6.2.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_6.2.0.bb
@@ -12,10 +12,6 @@ EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}"
 EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
 EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"
 
-do_install:append:class-nativesdk() {
-     ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
-}
-
 PACKAGECONFIG ??= " \
     fdt sdl kvm pie \
     ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
diff --git a/scripts/runqemu b/scripts/runqemu
index d60cb2e152..5c108ec23a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1377,6 +1377,7 @@ class BaseConfig(object):
                 if self.sdl == True:
                     self.qemu_opt += 'sdl,'
                 elif self.gtk == True:
+                    os.environ['FONTCONFIG_PATH'] = '/etc/fonts'
                     self.qemu_opt += 'gtk,'
 
                 if self.gl == True:
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 8/8] sstate: additional debugging when fetch fails occur
  2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
                   ` (5 preceding siblings ...)
  2022-02-06 21:53 ` [PATCH 7/8] qemu: replace a gtk wrapper with directly setting environment from runqemu Alexander Kanavin
@ 2022-02-06 21:53 ` Alexander Kanavin
  6 siblings, 0 replies; 8+ messages in thread
From: Alexander Kanavin @ 2022-02-06 21:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

Autobuilder has been showing things like:
Checking sstate mirror object availability...ERROR: SState: cannot test file://universal/d9/bc/sstate:xz-native:x86_64-linux:5.2.5:r0:x86_64:8:d9bced04b194d5fc8d778eb8a0d674fa7375a42c8c50a9237e6d7672e9e7a00c_deploy_source_date_epoch.tar.zst: TimeoutError('timed out')
ERROR: SState: cannot test file://37/a0/sstate:libgcc-initial:core2-64-poky-linux:11.2.0:r0:core2-64:8:37a0a5aec105a0822df098f15ff2b67d0e7220204742b5d2b1f7958dda6fa5ce_deploy_source_date_epoch.tar.zst: TimeoutError('timed out')
ERROR: SState: cannot test file://universal/11/a4/sstate:libpciaccess-native:x86_64-linux:0.16:r0:x86_64:8:11a4d6c3a2e147ef7dd5f31c0ff2a91271dad49b561d8aa24849115081cf1842_deploy_source_date_epoch.tar.zst: TimeoutError('timed out')
done.

which is not helpful. To find out what really happened and where, the original
traceback is needed too.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes/sstate.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 85d0ee2e6a..475ce40c6b 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -1000,9 +1000,9 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
                 found.add(tid)
                 missed.remove(tid)
             except bb.fetch2.FetchError as e:
-                bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)" % (srcuri, repr(e)))
+                bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)\n%s" % (srcuri, repr(e), e.__traceback__))
             except Exception as e:
-                bb.error("SState: cannot test %s: %s" % (srcuri, repr(e)))
+                bb.error("SState: cannot test %s: %s\n%s" % (srcuri, repr(e), e.__traceback__))
 
             if progress:
                 bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-06 21:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-06 21:53 [PATCH 1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class Alexander Kanavin
2022-02-06 21:53 ` [PATCH 2/8] gdb: update 11.1 -> 11.2 Alexander Kanavin
2022-02-06 21:53 ` [PATCH 3/8] insane.bbclass: use multiprocessing for collecting 'objdump -p' output Alexander Kanavin
2022-02-06 21:53 ` [PATCH 4/8] llvm: update 12.0.1 -> 13.0.1 Alexander Kanavin
2022-02-06 21:53 ` [PATCH 5/8] python3-numpy: update 1.22.1 -> 1.22.2 Alexander Kanavin
2022-02-06 21:53 ` [PATCH 6/8] runqemu: preload uninative libraries when host gl drivers are in use Alexander Kanavin
2022-02-06 21:53 ` [PATCH 7/8] qemu: replace a gtk wrapper with directly setting environment from runqemu Alexander Kanavin
2022-02-06 21:53 ` [PATCH 8/8] sstate: additional debugging when fetch fails occur Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.