Skip to contentSkip to conversation

mongodb: enable hardware crc32 only with crc in TUNE_FEATURES

PATCH New Martin Jansa 1 participant 4 messages Sep 3, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 mongodb: enable hardware crc32 only with crc in TUNE_FEATURES

* see https://jira.mongodb.org/browse/SERVER-30893

* fixes:
aarch64-oe-linux-gcc -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type --sysroot=TOPDIR/BUILD/work/mach-oe-linux/mongodb/4.4.13-r0/recipe-sysroot -o build/opt/third_party/wiredtiger/src/checksum/arm64/crc32-arm64.o -c -std=c11 -fno-omit-frame-pointer -fno-strict-aliasing -fasynchronous-unwind-tables -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -Wno-missing-braces -Wno-exceptions -fstack-protector-strong -fPIE -DNDEBUG -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -DBOOST_THREAD_VERSION=5 -DBOOST_THREAD_USES_DATETIME -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -DBOOST_ENABLE_ASSERT_DEBUG_HANDLER -DBOOST_LOG_NO_SHORTHAND_NAMES -DBOOST_LOG_USE_NATIVE_SYSLOG -DBOOST_LOG_WITHOUT_THREAD_ATTR -DABSL_FORCE_ALIGNED_ACCESS -DHAVE_VERBOSE -DHAVE_FALLOCATE -DHAVE_SYNC_FILE_RANGE -DHAVE_ARM_NEON_INTRIN_H -D_GNU_SOURCE -DHAVE_BUILTIN_EXTENSION_ZLIB -DHAVE_BUILTIN_EXTENSION_SNAPPY -DHAVE_BUILTIN_EXTENSION_ZSTD -Isrc/third_party/zstandard-1.4.3/zstd/lib -Isrc/third_party/snappy-1.1.7 -Ibuild/opt/third_party/wiredtiger -Isrc/third_party/wiredtiger -Ibuild/opt/third_party/wiredtiger/src/include -Isrc/third_party/wiredtiger/src/include -Ibuild/opt/third_party/wiredtiger/build_linux -Isrc/third_party/wiredtiger/build_linux src/third_party/wiredtiger/src/checksum/arm64/crc32-arm64.c
cc1: warning: command-line option '-Wno-exceptions' is valid for C++/ObjC++ but not for C
/tmp/ccGvwFgu.s: Assembler messages:
/tmp/ccGvwFgu.s:45: Error: selected processor does not support `crc32cb w2,w2,w3'
/tmp/ccGvwFgu.s:77: Error: selected processor does not support `crc32cx w2,w2,x4'
/tmp/ccGvwFgu.s:103: Error: selected processor does not support `crc32cb w2,w2,w0'

---
 .../meta-python/recipes-dbs/mongodb/mongodb_git.bb               | 1 +
 1 file changed, 1 insertion(+)
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +1 -0
index 0ce58b13c4..21c3b10148 100644
@@ -91,6 +91,7 @@ EXTRA_OESCONS = "PREFIX=${prefix} \
                  --use-system-zlib \
                  --nostrip \
                  --endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
+                 --use-hardware-crc32=${@bb.utils.contains('TUNE_FEATURES', 'crc', 'on', 'off', d)} \
                  --wiredtiger='${WIREDTIGER}' \
                  --separate-debug \
                  ${PACKAGECONFIG_CONFARGS}"
Signature · 1 line
2.42.0
#1 lore raw

PATCH 2/4 libcyusbserial: fix installed-vs-shipped QA issue with multilib

* testing ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} existence doesn't really work in cross compilation and on some hosts was causing:

ERROR: QA Issue: libcyusbserial: Files/directories were installed but not shipped in any package:
/usr/lib/libcyusbserial.so.1
/usr/lib/libcyusbserial.so
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
libcyusbserial: 2 installed and not shipped files. [installed-vs-shipped]

with multilib using /usr/lib32 or /usr/lib64 when the same didn't exist on host.

---
 ...on-t-fall-back-CMAKE_INSTALL_LIBDIR-.patch | 43 +++++++++++++++++++
 .../libcyusbserial/libcyusbserial_git.bb      |  4 +-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/libcyusbserial/libcyusbserial/0001-CMakeLists.txt-don-t-fall-back-CMAKE_INSTALL_LIBDIR-.patch
meta-oe/recipes-support/libcyusbserial/libcyusbserial/0001-CMakeLists.txt-don-t-fall-back-CMAKE_INSTALL_LIBDIR-.patch new file +43 -0
new file mode 100644
index 0000000000..d9e10469d3
@@ -0,0 +1,43 @@
+From 655c5c32b37a2bea12389ed69c0869215fcf5abe Mon Sep 17 00:00:00 2001
+From: Martin Jansa <[email protected]>
+Date: Sun, 3 Sep 2023 11:22:35 +0200
+Subject: [PATCH] CMakeLists.txt: don't fall back CMAKE_INSTALL_LIBDIR to lib
+
+* testing ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} existence
+  doesn't really work in cross compilation and on some hosts was causing:
+
+  ERROR: QA Issue: libcyusbserial: Files/directories were installed but not shipped in any package:
+    /usr/lib/libcyusbserial.so.1
+    /usr/lib/libcyusbserial.so
+  Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
+  libcyusbserial: 2 installed and not shipped files. [installed-vs-shipped]
+
+  with multilib using /usr/lib32 or /usr/lib64 when the same didn't
+  exist on host.
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <[email protected]>
+---
+ lib/CMakeLists.txt | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index 2b031cb..53a7263 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -6,15 +6,6 @@ if (NOT CMAKE_INSTALL_LIBDIR)
+ include(GNUInstallDirs)
+ endif (NOT CMAKE_INSTALL_LIBDIR)
+ 
+-# Fall back to just "lib" if the item provided by GNUInstallDirs doesn't exist
+-# For example, on Ubuntu 13.10 with CMake 2.8.11.2,
+-# /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} doesn't exist.
+-if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+-    message(STATUS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} does not exist. Defaulting libcyusbserial install location to ${CMAKE_INSTALL_PREFIX}/lib.")
+-        set(CMAKE_INSTALL_LIBDIR lib)
+-endif()
+-
+-
+ ################################################################################
+ # Include paths
+ ################################################################################
meta-oe/recipes-support/libcyusbserial/libcyusbserial_git.bb +3 -1
index 81453fb888..a69194996b 100644
@@ -8,7 +8,9 @@ DEPENDS = "libusb udev"
 PV = "1.0.0+git${SRCPV}"
 
 SRCREV = "655e2d544183d094f0e2d119c7e0c6206a0ddb3f"
-SRC_URI = "git://github.com/cyrozap/${BPN}.git;branch=master;protocol=https"
+SRC_URI = "git://github.com/cyrozap/${BPN}.git;branch=master;protocol=https \
+    file://0001-CMakeLists.txt-don-t-fall-back-CMAKE_INSTALL_LIBDIR-.patch \
+"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.42.0
#2 lore raw

PATCH 3/4 khronos-cts.inc: respect MLPREFIX when appending DEPENDS with anonymous python

In reply to Martin Jansa

* this causes 2 issues:
lib32-opengl-es-cts depending on 64bit wayland and wayland-protocols:

  $ bitbake-getvar -r lib32-opengl-es-cts DEPENDS
  #
  # $DEPENDS [14 operations]
  #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:309
  #     ""
  #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:137
  #     [doc] "Lists a recipe's build-time dependencies (i.e. other recipe files)."
  #   :prepend /OE/build/oe-core/openembedded-core/meta/classes-global/base.bbclass:57
  #     "${BASEDEPENDS} "
  #   :prepend /OE/build/oe-core/openembedded-core/meta/classes-recipe/pkgconfig.bbclass:7
  #     "pkgconfig-native "
  #   :prepend /OE/build/oe-core/openembedded-core/meta/classes-recipe/cmake.bbclass:10
  #     "cmake-native "
  #   :append /OE/build/oe-core/openembedded-core/meta/classes-recipe/python3native.bbclass:11
  #     " python3-native "
  #   append /OE/build/oe-core/meta-openembedded/meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc:28
  #     "python3-lxml-native libpng zlib virtual/libgles2 qemu-native"
  #   :append[libc-musl] /OE/build/oe-core/meta-openembedded/meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc:38
  #     " libexecinfo"
  #   rename (to) classextend.py:108 [map_depends_variable]
  #     "DEPENDS_NONML"
  #   set classextend.py:109 [map_depends_variable]
  #     "${@oe.classextend.get_depends('DEPENDS', d)}"
  #   append classextend.py:110 [map_depends_variable]
  #     [vardeps] " DEPENDS_NONML"
  #   append cmake.bbclass:25 [__anon_30__OE_build_oe_core_openembedded_core_meta_classes_recipe_cmake_bbclass]
  #     " ninja-native"
  #   append khronos-cts.inc:77 [__anon_80__OE_build_oe_core_meta_openembedded_meta_oe_recipes_graphics_vk_gl_cts_khronos_cts_inc]
  #     " wayland-native wayland wayland-protocols"
  #   append khronos-cts.inc:79 [__anon_80__OE_build_oe_core_meta_openembedded_meta_oe_recipes_graphics_vk_gl_cts_khronos_cts_inc]
  #     " virtual/libx11 virtual/egl "
  # pre-expansion value:
  #   "${@oe.classextend.get_depends('DEPENDS', d)} ninja-native wayland-native wayland wayland-protocols virtual/libx11 virtual/egl "
  DEPENDS="cmake-native lib32-libpng pkgconfig-native python3-lxml-native python3-native qemu-native virtual/lib32-arm-oemllib32-linux-gnueabi-compilerlibs virtual/arm-oemllib32-linux-gnueabi-gcc virtual/lib32-libc virtual/lib32-libgles2 lib32-zlib ninja-native wayland-native wayland wayland-protocols virtual/libx11 virtual/egl "

* lib32-opengl-es-cts-dev runtime depending on 64bit wayland-dev wayland-protocols-dev as caught by multilib QA check:

ERROR: QA Issue: lib32-opengl-es-cts package lib32-opengl-es-cts-dev - suspicious values 'wayland-dev wayland-protocols-dev' in RRECOMMENDS [multilib]

---
 meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +2 -2
index 097acc1a0b..72005636ea 100644
@@ -74,9 +74,9 @@ python __anonymous() {
     distrofeatures = (d.getVar("DISTRO_FEATURES") or "")
     if not bb.utils.contains_any("PACKAGECONFIG", ["surfaceless", "wayland", "x11_egl", "x11_glx", "x11_egl_glx"], True, False, d):
         if "wayland" in distrofeatures:
-            d.appendVar("DEPENDS", " wayland-native wayland wayland-protocols")
+            d.appendVar("DEPENDS", " wayland-native ${MLPREFIX}wayland ${MLPREFIX}wayland-protocols")
         if "x11" in distrofeatures:
-            d.appendVar("DEPENDS", " virtual/libx11 virtual/egl ")
+            d.appendVar("DEPENDS", " virtual/${MLPREFIX}libx11 virtual/${MLPREFIX}egl ")
 }
 
 CTSDIR = "/usr/lib/${BPN}"
Signature · 1 line
2.42.0
#3 lore raw

PATCH 4/4 tcpreplay: fix pcap detection with /usr/lib32 multilib

In reply to Martin Jansa

* use BPN, BP where useful
* use prefix instead of hardcoding /usr
* add patch to search also in lib32 subdir of --with-libpcap value
to fix:
checking for libpcap... configure: error: "Unable to find matching library for header file in TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-tcpreplay/4.4.4-r0/lib32-recipe-sysroot/usr"

---
 ...fy-search-dirs-for-pcap-and-add-lib3.patch | 82 +++++++++++++++++++
 .../tcpreplay/tcpreplay_4.4.4.bb              |  9 +-
 2 files changed, 87 insertions(+), 4 deletions(-)
 create mode 100644 meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch
meta-networking/recipes-support/tcpreplay/tcpreplay/0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch new file +82 -0
new file mode 100644
index 0000000000..709d2cccbc
@@ -0,0 +1,82 @@
+From 5f8c78362b3b1e06f5adff2d4b140509c4799894 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <[email protected]>
+Date: Sun, 3 Sep 2023 12:31:59 +0200
+Subject: [PATCH] configure.ac: unify search dirs for pcap and add lib32
+
+* add lib32 because when building lib32-tcpreplay it's
+  impossible to set --with-libpcap so that it would find
+  both include files as well as the library in lib32 directory
+
+* maybe it would be beneficial to split --with-libpcap
+  into --with-libpcap-includedir --with-libpcap-libdir as this
+  already searches in the --with-libpcap value with and
+  without any "lib" prefix, but include files always expect
+  "include" dir there
+
+* most of this code was added in:
+  https://github.com/appneta/tcpreplay/commit/202b8e82f9fd3c84ce5804577caeb36a33baabe7#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R570
+
+* then search for
+  ${host_cpu} lib/${host_cpu} (without -${host_os} suffix)
+  and ${build_arch}-${host_os} lib/${build_arch}-${host_os}
+  was added, but only for search of dynamic library in:
+  https://github.com/appneta/tcpreplay/commit/c3d5236563985a99f8bb02c3f1bd6950e3929047
+
+* ${build_arch}-${host_os} lib/${build_arch}-${host_os}
+  was later replaced with:
+  lib/${MULTIARCH} ${MULTIARCH}
+  and it was added to static library search as well
+
+  but for dynamic library it was searching in reversed order:
+  ${MULTIARCH} lib/${MULTIARCH}
+  https://github.com/appneta/tcpreplay/commit/ed9e3a818bde04813144014561e62f018c9eb85f
+
+  I don't think this reversed order was intentional, just unify all 4 cases
+  to use the same directories in the same order
+
+Signed-off-by: Martin Jansa <[email protected]>
+Upstream-Status: Submitted [https://github.com/appneta/tcpreplay/pull/819]
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 387219de..26ba31a5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -671,7 +671,7 @@ AC_ARG_WITH(libpcap,
+         LPCAPINCDIR=${testdir}
+         if test $dynamic_link = yes; then
+             for ext in .dylib .so .tbd ; do
+-                for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
++                for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
+                     sharefile=$(ls ${testdir}/$dir/libpcap${ext}* 2> /dev/null | sort | head -n1)
+                     if test -n "${sharefile}"; then
+                         LPCAP_LD_LIBRARY_PATH="$(dirname ${sharefile})"
+@@ -690,7 +690,7 @@ AC_ARG_WITH(libpcap,
+             dnl If dynamic library not found, try static
+             dnl
+             for ext in ${libext} .a .A.tbd ; do
+-                for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
++                for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
+                     staticfile=$(ls ${testdir}/$dir/libpcap${ext} 2> /dev/null | sort | head -n1)
+                     if test -n "${staticfile}"; then
+                         LPCAPLIB="${staticfile}"
+@@ -771,7 +771,7 @@ AC_ARG_WITH(libpcap,
+                 LPCAPINCDIR="${testdir}/include"
+                 if test $dynamic_link = yes; then
+                     for ext in .dylib .so .tbd; do
+-                        for dir in . lib lib64 ${host_cpu} lib/${host_cpu} ${host_cpu}-${host_os} lib/${host_cpu}-${host_os} ${MULTIARCH} lib/${MULTIARCH}; do
++                        for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
+                             sharefile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1)
+                             if test -n "${sharefile}"; then
+                                 LPCAPLIB="-L$(dirname ${sharefile}) -lpcap"
+@@ -790,7 +790,7 @@ AC_ARG_WITH(libpcap,
+                     dnl If dynamic library not found, try static
+                     dnl
+                     for ext in ${libext} .a .A.tbd ; do
+-                        for dir in . lib lib64 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
++                        for dir in . lib lib64 lib32 lib/${host_cpu}-${host_os} ${host_cpu}-${host_os} lib/${MULTIARCH} ${MULTIARCH}; do
+                             staticfile=$(ls "${testdir}/$dir/libpcap${ext}" 2> /dev/null | sort | head -n1)
+                             if test -n "${staticfile}"; then
+                                 LPCAPLIB="${staticfile}"
meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb +5 -4
index c7d14e2ab6..53f17c9619 100644
@@ -7,9 +7,10 @@ SECTION = "net"
 LICENSE = "GPL-3.0-only"
 LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=10f0474a2f0e5dccfca20f69d6598ad8"
 
-SRC_URI = "https://github.com/appneta/tcpreplay/releases/download/v${PV}/tcpreplay-${PV}.tar.gz \
-           file://0001-libopts.m4-set-POSIX_SHELL-to-bin-sh.patch \
-          "
+SRC_URI = "https://github.com/appneta/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
+    file://0001-libopts.m4-set-POSIX_SHELL-to-bin-sh.patch \
+    file://0001-configure.ac-unify-search-dirs-for-pcap-and-add-lib3.patch \
+"
 
 SRC_URI[sha256sum] = "44f18fb6d3470ecaf77a51b901a119dae16da5be4d4140ffbb2785e37ad6d4bf"
 
@@ -17,7 +18,7 @@ UPSTREAM_CHECK_URI = "https://github.com/appneta/tcpreplay/releases"
 
 DEPENDS = "libpcap"
 
-EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}/usr"
+EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}${prefix}"
 
 inherit siteinfo autotools-brokensep
 
Signature · 1 line
2.42.0