Skip to contentSkip to conversation

pkcs11-helper: Update to latest tip of trunk

PATCH New Khem Raj 1 participant 5 messages Mar 2, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/5 pkcs11-helper: Update to latest tip of trunk

This helps fixing build with clang16

---
 meta-oe/recipes-crypto/pkcs11-helper/pkcs11-helper_1.29.0.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta-oe/recipes-crypto/pkcs11-helper/pkcs11-helper_1.29.0.bb +3 -2
index a34a4b9140..d17ac1e7e1 100644
@@ -18,8 +18,9 @@ LIC_FILES_CHKSUM = " \
 SRC_URI = "git://github.com/OpenSC/${BPN}.git;branch=master;protocol=https"
 
 S = "${WORKDIR}/git"
-# v1.27
-SRCREV = "2306f896c2f3c147792300155316fd65825aabad"
+# master
+SRCREV = "f23911037d9790a3f3a3447a78d31a6362358e21"
+PV .= "+1.30.0+git${SRCPV}"
 
 UPSTREAM_CHECK_GITTAGREGEX = "pkcs11-helper-(?P<pver>\d+(\.\d+)+)"
 
Signature · 1 line
2.39.2
author
#1 lore raw

PATCH 2/5 glm: Update to tip of trunk

Do not use -Werror on clang

---
 .../0001-Do-not-use-Werror-with-clang.patch   | 30 +++++++++++++++++++
 .../glm/glm/0001-Silence-clang-warnings.patch | 20 -------------
 meta-oe/recipes-graphics/glm/glm_0.9.9.8.bb   |  6 ++--
 3 files changed, 33 insertions(+), 23 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/glm/glm/0001-Do-not-use-Werror-with-clang.patch
meta-oe/recipes-graphics/glm/glm/0001-Do-not-use-Werror-with-clang.patch new file +30 -0
new file mode 100644
index 0000000000..7b3e005ff9
@@ -0,0 +1,30 @@
+From ee405855bca7d6399ff1a1aef952010056c84ff6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 1 Mar 2023 21:08:09 -0800
+Subject: [PATCH] Do not use -Werror with clang
+
+Too many warnings to handle for a distro build
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ test/CMakeLists.txt | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index e7f85f19..0b6fd980 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -197,10 +197,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ 		message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler")
+ 	endif()
+ 
+-	add_compile_options(-Werror -Weverything)
+-	add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types)
+-	add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral)
+-
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ 	if(NOT GLM_QUIET)
+ 		message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler")
+-- 
+2.39.2
+
meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch +0 -20
index 3a62fffe3a..10692dd423 100644
@@ -26,8 +26,6 @@ Signed-off-by: Khem Raj <[email protected]>
  test/gtx/gtx_fast_trigonometry.cpp | 30 ++++++++++++------------------
  3 files changed, 14 insertions(+), 20 deletions(-)
 
-diff --git a/glm/ext/quaternion_common.inl b/glm/ext/quaternion_common.inl
-index 0e4a3bb2..6f99f52d 100644
 --- a/glm/ext/quaternion_common.inl
 +++ b/glm/ext/quaternion_common.inl
 @@ -104,7 +104,7 @@ namespace glm
@@ -39,21 +37,6 @@ index 0e4a3bb2..6f99f52d 100644
              return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle);
          }
      }
-diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl
-index 70485098..a4af2a06 100644
---- a/glm/gtc/random.inl
-+++ b/glm/gtc/random.inl
-@@ -22,7 +22,7 @@ namespace detail
- 		GLM_FUNC_QUALIFIER static vec<1, uint8, P> call()
- 		{
- 			return vec<1, uint8, P>(
--				std::rand() % std::numeric_limits<uint8>::max());
-+				static_cast<uint8>(std::rand()) % std::numeric_limits<uint8>::max());
- 		}
- 	};
- 
-diff --git a/test/gtx/gtx_fast_trigonometry.cpp b/test/gtx/gtx_fast_trigonometry.cpp
-index 8bf86ba0..ddaa708b 100644
 --- a/test/gtx/gtx_fast_trigonometry.cpp
 +++ b/test/gtx/gtx_fast_trigonometry.cpp
 @@ -19,15 +19,14 @@ namespace fastCos
@@ -160,6 +143,3 @@ index 8bf86ba0..ddaa708b 100644
  		const std::clock_t timestamp3 = std::clock();
  		const std::clock_t time_fast = timestamp2 - timestamp1;
  		const std::clock_t time_default = timestamp3 - timestamp2;
--- 
-2.31.1
-
meta-oe/recipes-graphics/glm/glm_0.9.9.8.bb +3 -3
index 9edcb2b6e1..3797314b47 100644
@@ -11,19 +11,19 @@ LIC_FILES_CHKSUM = "file://copying.txt;md5=462e4b97f73ef12f8171c3c546ce4e8d"
 SRC_URI = " \
     git://github.com/g-truc/glm;branch=master;protocol=https \
     file://0001-Silence-clang-warnings.patch \
+    file://0001-Do-not-use-Werror-with-clang.patch \
     file://glmConfig.cmake.in \
     file://glmConfigVersion.cmake.in \
     file://glm.pc.in \
     file://glmTargets.cmake \
 "
-SRCREV = "bf71a834948186f4097caa076cd2663c69a10e1e"
+SRCREV = "efec5db081e3aad807d0731e172ac597f6a39447"
+PV .= "+0.9.9.9+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
 inherit cmake
 
-CXXFLAGS:append:toolchain-clang = " -Wno-error=invalid-utf8 -Wno-error=disabled-macro-expansion -Wno-error=reserved-identifier"
-
 do_install() {
     install -d ${D}${includedir} ${D}${docdir}/glm ${D}${libdir}/pkgconfig ${D}${libdir}/cmake/glm
     cp -R --no-dereference --preserve=mode,links ${S}/glm ${D}${includedir}
Signature · 1 line
2.39.2
author
#2 lore raw

PATCH 3/5 libsdl2-ttf: Upgrade to 2.20.2

In reply to Khem Raj

Fix build with clang16 while here

---
 ...ction-signatures-to-match-without-ca.patch | 69 +++++++++++++++++++
 ...l2-ttf_2.20.1.bb => libsdl2-ttf_2.20.2.bb} |  7 +-
 2 files changed, 73 insertions(+), 3 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/libsdl/libsdl2-ttf/0001-freetype-Fix-function-signatures-to-match-without-ca.patch
 rename meta-oe/recipes-graphics/libsdl/{libsdl2-ttf_2.20.1.bb => libsdl2-ttf_2.20.2.bb} (76%)
meta-oe/recipes-graphics/libsdl/libsdl2-ttf/0001-freetype-Fix-function-signatures-to-match-without-ca.patch new file +69 -0
new file mode 100644
index 0000000000..8cb76c35d6
@@ -0,0 +1,69 @@
+From 6c52693d264ca3dc8e15a92f56cf3a636639bb6c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <[email protected]>
+Date: Fri, 28 Oct 2022 22:17:15 +0300
+Subject: [PATCH] freetype: Fix function signatures to match without casts
+
+Clang 16 has got a new stricter warning for casts of function types
+(see https://github.com/llvm/llvm-project/commit/1aad641c793090b4d036c03e737df2ebe2c32c57).
+
+This new warning gets included as part of the existing error
+diagnostic setting of -Wcast-function-type.
+
+This fixes errors like these:
+
+../src/hb-ft.cc:1011:34: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
+    ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
+                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Backport [https://github.com/harfbuzz/harfbuzz/commit/d88269c827895b38f99f7cf741fa60210d4d5169]
+---
+ src/hb-ft.cc | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/hb-ft.cc b/src/hb-ft.cc
+index a6beb9f0f..a35e75b18 100644
+--- a/src/hb-ft.cc
++++ b/src/hb-ft.cc
+@@ -729,8 +729,9 @@ hb_ft_face_create_referenced (FT_Face ft_face)
+ }
+ 
+ static void
+-hb_ft_face_finalize (FT_Face ft_face)
++hb_ft_face_finalize (void *arg)
+ {
++  FT_Face ft_face = (FT_Face) arg;
+   hb_face_destroy ((hb_face_t *) ft_face->generic.data);
+ }
+ 
+@@ -762,7 +763,7 @@ hb_ft_face_create_cached (FT_Face ft_face)
+       ft_face->generic.finalizer (ft_face);
+ 
+     ft_face->generic.data = hb_ft_face_create (ft_face, nullptr);
+-    ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
++    ft_face->generic.finalizer = hb_ft_face_finalize;
+   }
+ 
+   return hb_face_reference ((hb_face_t *) ft_face->generic.data);
+@@ -949,8 +950,9 @@ get_ft_library ()
+ }
+ 
+ static void
+-_release_blob (FT_Face ft_face)
++_release_blob (void *arg)
+ {
++  FT_Face ft_face = (FT_Face) arg;
+   hb_blob_destroy ((hb_blob_t *) ft_face->generic.data);
+ }
+ 
+@@ -1032,7 +1034,7 @@ hb_ft_font_set_funcs (hb_font_t *font)
+ #endif
+ 
+   ft_face->generic.data = blob;
+-  ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob;
++  ft_face->generic.finalizer = _release_blob;
+ 
+   _hb_ft_font_set_funcs (font, ft_face, true);
+   hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING);
+-- 
+2.39.2
+
meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.2.bb renamed from meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.1.bb +4 -3
similarity index 76%
rename from meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.1.bb
rename to meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.2.bb
index b8732b4c86..7d352f4218 100644
@@ -2,17 +2,18 @@ SUMMARY = "Simple DirectMedia Layer truetype font library"
 SECTION = "libs"
 DEPENDS = "libsdl2 freetype virtual/egl"
 LICENSE = "Zlib"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771dca8728b18d39b130e19b36514371"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a41cbf59bdea749fe34c1af6d3615f68"
 
 SRC_URI = " \
     git://github.com/libsdl-org/SDL_ttf.git;branch=release-2.20.x;protocol=https \
     git://github.com/libsdl-org/freetype.git;branch=VER-2-12-1-SDL;destsuffix=git/external/freetype;name=freetype;protocol=https \
     git://github.com/libsdl-org/harfbuzz.git;branch=2.9.1-SDL;destsuffix=git/external/harfbuzz;name=harfbuzz;protocol=https \
+    file://0001-freetype-Fix-function-signatures-to-match-without-ca.patch;patchdir=external/harfbuzz \
     file://automake_foreign.patch \
 "
-SRCREV = "0a652b598625d16ea7016665095cb1e9bce9ef4f"
+SRCREV = "89d1692fd8fe91a679bb943d377bfbd709b52c23"
 SRCREV_freetype = "6fc77cee03e078e97afcee0c0e06a2d3274b9a29"
-SRCREV_harfbuzz = "6022fe2f68d028ee178284f297b3902ffdf65b03"
+SRCREV_harfbuzz = "43931e3e596c04044861770b831c8f9452e2d3b0"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.39.2
author
#3 lore raw

PATCH 4/5 libsdl-image: Fix build with clang16

In reply to Khem Raj
---
 ...-png-img-Fix-prototypes-of-callbacks.patch | 52 +++++++++++++++++++
 .../libsdl/libsdl-image_1.2.12.bb             |  2 +-
 2 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-graphics/libsdl/libsdl-image/0001-png-img-Fix-prototypes-of-callbacks.patch
meta-oe/recipes-graphics/libsdl/libsdl-image/0001-png-img-Fix-prototypes-of-callbacks.patch new file +52 -0
new file mode 100644
index 0000000000..1bbfa99210
@@ -0,0 +1,52 @@
+From 41791738221fdb7574fc8e23f84214910cdce098 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 1 Mar 2023 21:51:40 -0800
+Subject: [PATCH] png-img: Fix prototypes of callbacks
+
+Clang-16 is flagging function pointer mismatches
+
+Upstream-Status: Inappropriate [No upstream]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ IMG_png.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/IMG_png.c b/IMG_png.c
+index 5f91f15..4d5bdb6 100644
+--- a/IMG_png.c
++++ b/IMG_png.c
+@@ -78,15 +78,15 @@
+ static struct {
+ 	int loaded;
+ 	void *handle;
+-	png_infop (*png_create_info_struct) (png_structp png_ptr);
++	png_infop (*png_create_info_struct) (png_const_structp png_ptr);
+ 	png_structp (*png_create_read_struct) (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn);
+ 	void (*png_destroy_read_struct) (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr);
+-	png_uint_32 (*png_get_IHDR) (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method);
+-	png_voidp (*png_get_io_ptr) (png_structp png_ptr);
+-	png_byte (*png_get_channels) (png_structp png_ptr, png_infop info_ptr);
+-	png_uint_32 (*png_get_PLTE) (png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette);
+-	png_uint_32 (*png_get_tRNS) (png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values);
+-	png_uint_32 (*png_get_valid) (png_structp png_ptr, png_infop info_ptr, png_uint_32 flag);
++	png_uint_32 (*png_get_IHDR) (png_const_structp png_ptr, png_const_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method);
++	png_voidp (*png_get_io_ptr) (png_const_structp png_ptr);
++	png_byte (*png_get_channels) (png_const_structp png_ptr, png_const_infop info_ptr);
++	png_uint_32 (*png_get_PLTE) (png_const_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette);
++	png_uint_32 (*png_get_tRNS) (png_const_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values);
++	png_uint_32 (*png_get_valid) (png_const_structp png_ptr, png_const_infop info_ptr, png_uint_32 flag);
+ 	void (*png_read_image) (png_structp png_ptr, png_bytepp image);
+ 	void (*png_read_info) (png_structp png_ptr, png_infop info_ptr);
+ 	void (*png_read_update_info) (png_structp png_ptr, png_infop info_ptr);
+@@ -95,7 +95,7 @@ static struct {
+ 	void (*png_set_packing) (png_structp png_ptr);
+ 	void (*png_set_read_fn) (png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn);
+ 	void (*png_set_strip_16) (png_structp png_ptr);
+-	int (*png_sig_cmp) (png_bytep sig, png_size_t start, png_size_t num_to_check);
++	int (*png_sig_cmp) (png_const_bytep sig, png_size_t start, png_size_t num_to_check);
+ #ifndef LIBPNG_VERSION_12
+ 	jmp_buf* (*png_set_longjmp_fn) (png_structp, png_longjmp_ptr, size_t);
+ #endif
+-- 
+2.39.2
+
meta-oe/recipes-graphics/libsdl/libsdl-image_1.2.12.bb +1 -1
index 5a93dc19a8..01137bb0ca 100644
@@ -7,8 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=613734b7586e1580ef944961c6d62227"
 DEPENDS = "tiff zlib libpng jpeg libsdl"
 
 SRC_URI = "http://www.libsdl.org/projects/SDL_image/release/SDL_image-${PV}.tar.gz \
+           file://0001-png-img-Fix-prototypes-of-callbacks.patch \
            file://configure.patch"
-SRC_URI[md5sum] = "a0f9098ebe5400f0bdc9b62e60797ecb"
 SRC_URI[sha256sum] = "0b90722984561004de84847744d566809dbb9daf732a9e503b91a1b5a84e5699"
 
 S = "${WORKDIR}/SDL_image-${PV}"
Signature · 1 line
2.39.2
author
#4 lore raw

PATCH 5/5 gphoto2: Fix build with clang16 + musl

In reply to Khem Raj
---
 ...ototypes-of-callbacks-with-libgphoto.patch | 50 +++++++++++++++++++
 .../gphoto2/gphoto2_2.5.28.bb                 |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/gphoto2/gphoto2/0001-Match-prototypes-of-callbacks-with-libgphoto.patch
meta-oe/recipes-graphics/gphoto2/gphoto2/0001-Match-prototypes-of-callbacks-with-libgphoto.patch new file +50 -0
new file mode 100644
index 0000000000..abe38e12ce
@@ -0,0 +1,50 @@
+From 366930ccc1a261c3eb883da2bf3c655162ccd75f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 1 Mar 2023 22:58:37 -0800
+Subject: [PATCH] Match prototypes of callbacks with libgphoto
+
+In https://github.com/gphoto/gphoto2/pull/535/commits/ccc4c1f092bd21ebc713f4d7b9be85be49f92f1e
+we tried to fix by using pthread_t but it also needs to make changes in
+libgphoto and these changes can be invasive, therefore lets revert to
+older types and to fix musl problem fix it via type casts
+
+Upstream-Status: Submitted [https://github.com/gphoto/gphoto2/pull/569]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ gphoto2/main.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gphoto2/main.c b/gphoto2/main.c
+index 0dac947..cd3c990 100644
+--- a/gphoto2/main.c
++++ b/gphoto2/main.c
+@@ -1198,7 +1198,7 @@ thread_func (void *data)
+ 	pthread_cleanup_pop (1);
+ }
+ 
+-static pthread_t
++static unsigned int
+ start_timeout_func (Camera *camera, unsigned int timeout,
+ 		    CameraTimeoutFunc func, void __unused__ *data)
+ {
+@@ -1215,14 +1215,14 @@ start_timeout_func (Camera *camera, unsigned int timeout,
+ 
+ 	pthread_create (&tid, NULL, thread_func, td);
+ 
+-	return (tid);
++	return (unsigned int)tid;
+ }
+ 
+ static void
+-stop_timeout_func (Camera __unused__ *camera, pthread_t id,
++stop_timeout_func (Camera __unused__ *camera, unsigned int id,
+ 		   void __unused__ *data)
+ {
+-	pthread_t tid = id;
++	pthread_t tid = (pthread_t)id;
+ 
+ 	pthread_cancel (tid);
+ 	pthread_join (tid, NULL);
+-- 
+2.39.2
+
meta-oe/recipes-graphics/gphoto2/gphoto2_2.5.28.bb +1 -0
index fe33940475..513845194d 100644
@@ -9,6 +9,7 @@ RDEPENDS:gphoto2 = "libgphoto2"
 SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/gphoto2-${PV}.tar.bz2;name=gphoto2 \
            file://0001-configure.ac-remove-AM_PO_SUBDIRS.patch \
            file://0001-gphoto2-Use-pthread_t-abstract-type-for-thead-IDs.patch \
+           file://0001-Match-prototypes-of-callbacks-with-libgphoto.patch \
 "
 SRC_URI[gphoto2.sha256sum] = "2a648dcdf12da19e208255df4ebed3e7d2a02f905be4165f2443c984cf887375"
 
Signature · 1 line
2.39.2