diff mbox series

[meta-openembedded,18/20] microsoft-gsl: Upgrade 4.0.0 -> 4.2.0 to allow CMake 4+ compatibility

Message ID 20250708195636.1678606-18-alperyasinak1@gmail.com
State Accepted
Headers show
Series [meta-openembedded,01/20] cannelloni: Upgrade 1.1.0 -> 2.0.0 to allow CMake 4+ compatibility | expand

Commit Message

Alper Ak July 8, 2025, 7:56 p.m. UTC
- Drop patches because already fixed in newer version

Changelog:

https://github.com/microsoft/GSL/compare/v4.0.0...v4.2.0
https://github.com/microsoft/GSL/releases/tag/v4.2.0
https://github.com/microsoft/GSL/releases/tag/v4.1.0

Fix:

| CMake Error at tests/CMakeLists.txt:1 (cmake_minimum_required):
|   Compatibility with CMake < 3.5 has been removed from CMake.
|
|   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
|   to tell CMake that the project requires at least <min> but has been updated
|   to work with policies introduced by <max> or earlier.
|
|   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
|
|
| -- Configuring incomplete, errors occurred!

Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
---
 ...0001-Fix-initialization-in-test-1140.patch | 113 ------------------
 .../0002-Fix-gcc-build-problem.patch          |  82 -------------
 ...eck_cxx_compiler_flag-to-cmake-3.0.2.patch |  53 --------
 ...ft-gsl_4.0.0.bb => microsoft-gsl_4.2.0.bb} |   8 +-
 4 files changed, 2 insertions(+), 254 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
 delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
 delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
 rename meta-oe/recipes-devtools/microsoft-gsl/{microsoft-gsl_4.0.0.bb => microsoft-gsl_4.2.0.bb} (87%)

Comments

Khem Raj July 9, 2025, 4:08 p.m. UTC | #1
this fails to build with clang

https://errors.yoctoproject.org/Errors/Details/869560/

On 7/8/25 12:56 PM, Alper Ak via lists.openembedded.org wrote:
> - Drop patches because already fixed in newer version
> 
> Changelog:
> 
> https://github.com/microsoft/GSL/compare/v4.0.0...v4.2.0
> https://github.com/microsoft/GSL/releases/tag/v4.2.0
> https://github.com/microsoft/GSL/releases/tag/v4.1.0
> 
> Fix:
> 
> | CMake Error at tests/CMakeLists.txt:1 (cmake_minimum_required):
> |   Compatibility with CMake < 3.5 has been removed from CMake.
> |
> |   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
> |   to tell CMake that the project requires at least <min> but has been updated
> |   to work with policies introduced by <max> or earlier.
> |
> |   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
> |
> |
> | -- Configuring incomplete, errors occurred!
> 
> Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
> ---
>   ...0001-Fix-initialization-in-test-1140.patch | 113 ------------------
>   .../0002-Fix-gcc-build-problem.patch          |  82 -------------
>   ...eck_cxx_compiler_flag-to-cmake-3.0.2.patch |  53 --------
>   ...ft-gsl_4.0.0.bb => microsoft-gsl_4.2.0.bb} |   8 +-
>   4 files changed, 2 insertions(+), 254 deletions(-)
>   delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
>   delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
>   delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
>   rename meta-oe/recipes-devtools/microsoft-gsl/{microsoft-gsl_4.0.0.bb => microsoft-gsl_4.2.0.bb} (87%)
> 
> diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
> deleted file mode 100644
> index 84a585d3c5..0000000000
> --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
> +++ /dev/null
> @@ -1,113 +0,0 @@
> -From 1b4d42ca2e97061042ec44a0b34ceb176c78c7e1 Mon Sep 17 00:00:00 2001
> -From: d-winsor <danwin@microsoft.com>
> -Date: Mon, 26 Feb 2024 13:17:12 -0800
> -Subject: [PATCH] Fix initialization in test (#1140)
> -
> -* Suppress unsafe-buffer-usage
> -
> -Upstream-Status: Backport [https://github.com/microsoft/GSL/commit/1b4d42ca2e97061042ec44a0b34ceb176c78c7e1]
> -
> -Signed-off-by: Peter Marko <peter.marko@siemens.com>
> ----
> - include/gsl/span     | 10 ++++++++++
> - include/gsl/util     | 10 ++++++++++
> - tests/CMakeLists.txt | 10 ++++++++++
> - tests/span_tests.cpp |  2 +-
> - 4 files changed, 31 insertions(+), 1 deletion(-)
> -
> -diff --git a/include/gsl/span b/include/gsl/span
> -index cc8a7b9..d254e4d 100644
> ---- a/include/gsl/span
> -+++ b/include/gsl/span
> -@@ -58,6 +58,12 @@
> - #pragma GCC diagnostic ignored "-Wsign-conversion"
> - #endif
> -
> -+// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#pragma clang diagnostic push
> -+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> -+#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+
> - namespace gsl
> - {
> -
> -@@ -818,4 +824,8 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
> - #pragma GCC diagnostic pop
> - #endif // __GNUC__ > 6
> -
> -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#pragma clang diagnostic pop
> -+#endif
> -+
> - #endif // GSL_SPAN_H
> -diff --git a/include/gsl/util b/include/gsl/util
> -index a215bad..11735a8 100644
> ---- a/include/gsl/util
> -+++ b/include/gsl/util
> -@@ -39,6 +39,12 @@
> -
> - #endif // _MSC_VER
> -
> -+// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#pragma clang diagnostic push
> -+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> -+#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+
> - #if defined(__cplusplus) && (__cplusplus >= 201703L)
> - #define GSL_NODISCARD [[nodiscard]]
> - #else
> -@@ -157,4 +163,8 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
> -
> - #endif // _MSC_VER
> -
> -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#pragma clang diagnostic pop
> -+#endif
> -+
> - #endif // GSL_UTIL_H
> -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> -index cab4e56..20de9e1 100644
> ---- a/tests/CMakeLists.txt
> -+++ b/tests/CMakeLists.txt
> -@@ -167,6 +167,11 @@ else()
> -         >
> -     )
> - endif(MSVC)
> -+check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> -+if (WARN_UNSAFE_BUFFER)
> -+  # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> -+  target_compile_options(gsl_tests_config INTERFACE "-Wno-unsafe-buffer-usage")
> -+endif()
> -
> - # for tests to find the gtest header
> - target_include_directories(gsl_tests_config SYSTEM INTERFACE
> -@@ -267,6 +272,11 @@ else()
> -         >
> -     )
> - endif(MSVC)
> -+check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> -+if (WARN_UNSAFE_BUFFER)
> -+  # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> -+  target_compile_options(gsl_tests_config_noexcept INTERFACE "-Wno-unsafe-buffer-usage")
> -+endif()
> -
> - add_executable(gsl_noexcept_tests no_exception_ensure_tests.cpp)
> - target_link_libraries(gsl_noexcept_tests
> -diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
> -index 33ccf56..3c1dfe5 100644
> ---- a/tests/span_tests.cpp
> -+++ b/tests/span_tests.cpp
> -@@ -330,7 +330,7 @@ TEST(span_test, from_array_constructor)
> -         EXPECT_TRUE(s.data() == std::addressof(arr2d[0]));
> -     }
> -
> --    int arr3d[2][3][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
> -+    int arr3d[2][3][2] = { { {1, 2}, {3, 4}, {5, 6} }, { {7, 8}, {9, 10}, {11, 12} } };
> -
> - #ifdef CONFIRM_COMPILATION_ERRORS
> -     {
> ---
> -2.30.2
> -
> diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
> deleted file mode 100644
> index 2f7542c62c..0000000000
> --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -From aa4fd1f57794964640005900c2b47af1a0940b7b Mon Sep 17 00:00:00 2001
> -From: Werner Henze <w.henze@avm.de>
> -Date: Fri, 1 Mar 2024 15:53:50 +0100
> -Subject: [PATCH] Fix gcc build problem
> -
> -Closes issue #1148 by fixing problems introduced in PR #1140.
> -
> -Upstream-Status: Submitted [https://github.com/microsoft/GSL/pull/1149]
> -
> -Signed-off-by: Peter Marko <peter.marko@siemens.com>
> ----
> - include/gsl/span | 12 ++++++++----
> - include/gsl/util | 12 ++++++++----
> - 2 files changed, 16 insertions(+), 8 deletions(-)
> -
> -diff --git a/include/gsl/span b/include/gsl/span
> -index 0de2932..d2ef9f7 100644
> ---- a/include/gsl/span
> -+++ b/include/gsl/span
> -@@ -59,10 +59,12 @@
> - #endif
> -
> - // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#if defined(__clang__)
> -+#if __has_warning("-Wunsafe-buffer-usage")
> - #pragma clang diagnostic push
> - #pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> --#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#endif // __has_warning("-Wunsafe-buffer-usage")
> -+#endif // defined(__clang__)
> -
> - namespace gsl
> - {
> -@@ -824,8 +826,10 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
> - #pragma GCC diagnostic pop
> - #endif // __GNUC__ > 6
> -
> --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#if defined(__clang__)
> -+#if __has_warning("-Wunsafe-buffer-usage")
> - #pragma clang diagnostic pop
> --#endif
> -+#endif // __has_warning("-Wunsafe-buffer-usage")
> -+#endif // defined(__clang__)
> -
> - #endif // GSL_SPAN_H
> -diff --git a/include/gsl/util b/include/gsl/util
> -index b853017..26b2f5f 100644
> ---- a/include/gsl/util
> -+++ b/include/gsl/util
> -@@ -40,10 +40,12 @@
> - #endif // _MSC_VER
> -
> - // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#if defined(__clang__)
> -+#if __has_warning("-Wunsafe-buffer-usage")
> - #pragma clang diagnostic push
> - #pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> --#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#endif // __has_warning("-Wunsafe-buffer-usage")
> -+#endif // defined(__clang__)
> -
> - #if defined(__cplusplus) && (__cplusplus >= 201703L)
> - #define GSL_NODISCARD [[nodiscard]]
> -@@ -163,8 +165,10 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
> -
> - #endif // _MSC_VER
> -
> --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> -+#if defined(__clang__)
> -+#if __has_warning("-Wunsafe-buffer-usage")
> - #pragma clang diagnostic pop
> --#endif
> -+#endif // __has_warning("-Wunsafe-buffer-usage")
> -+#endif // defined(__clang__)
> -
> - #endif // GSL_UTIL_H
> ---
> -2.30.2
> -
> diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
> deleted file mode 100644
> index ed057f5243..0000000000
> --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -From 85e1c38bcf84bd4e2ce63ef74f0cfa1f5e92261e Mon Sep 17 00:00:00 2001
> -From: Peter Marko <peter.marko@siemens.com>
> -Date: Wed, 27 Mar 2024 23:46:31 +0100
> -Subject: [PATCH] Adapt check_cxx_compiler_flag to cmake 3.0.2
> -
> -Backporting commits which are upgrading cmake_minimum_required and
> -include check_cxx_compiler_flag have too many additional changes.
> -
> -Let's just do a simple adaptation of our backported patch so
> -it works with older cmake version instead.
> -
> -This can be safely removed when recipe version is upgraded.
> -
> -Upstream-Status: Inappropriate
> -
> -Signed-off-by: Peter Marko <peter.marko@siemens.com>
> ----
> - tests/CMakeLists.txt | 5 +++--
> - 1 file changed, 3 insertions(+), 2 deletions(-)
> -
> -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> -index 20de9e1..54c3ac5 100644
> ---- a/tests/CMakeLists.txt
> -+++ b/tests/CMakeLists.txt
> -@@ -5,6 +5,7 @@ enable_testing()  # again, for support standalone testing
> -
> - include(FindPkgConfig)
> - include(ExternalProject)
> -+include(CheckCXXCompilerFlag)
> -
> - # will make visual studio generated project group files
> - set_property(GLOBAL PROPERTY USE_FOLDERS ON)
> -@@ -167,7 +168,7 @@ else()
> -         >
> -     )
> - endif(MSVC)
> --check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> -+CHECK_CXX_COMPILER_FLAG("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> - if (WARN_UNSAFE_BUFFER)
> -   # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> -   target_compile_options(gsl_tests_config INTERFACE "-Wno-unsafe-buffer-usage")
> -@@ -272,7 +273,7 @@ else()
> -         >
> -     )
> - endif(MSVC)
> --check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> -+CHECK_CXX_COMPILER_FLAG("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> - if (WARN_UNSAFE_BUFFER)
> -   # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> -   target_compile_options(gsl_tests_config_noexcept INTERFACE "-Wno-unsafe-buffer-usage")
> ---
> -2.30.2
> -
> diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
> similarity index 87%
> rename from meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb
> rename to meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
> index 2fbbf8f06a..610c45a298 100644
> --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb
> +++ b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
> @@ -9,13 +9,9 @@ LICENSE = "MIT"
>   LIC_FILES_CHKSUM = "file://LICENSE;md5=363055e71e77071107ba2bb9a54bd9a7"
>   
>   SRC_URI = "git://github.com/microsoft/GSL.git;protocol=https;branch=main \
> -    file://run-ptest \
> -    file://0001-Fix-initialization-in-test-1140.patch \
> -    file://0002-Fix-gcc-build-problem.patch \
> -    file://0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch \
> +        file://run-ptest \
>   "
> -SRCREV = "a3534567187d2edc428efd3f13466ff75fe5805c"
> -
> +SRCREV = "2828399820ef4928cc89b65605dca5dc68efca6e"
>   
>   inherit cmake pkgconfig ptest
>   
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#118340): https://lists.openembedded.org/g/openembedded-devel/message/118340
> Mute This Topic: https://lists.openembedded.org/mt/114053267/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alper Ak July 9, 2025, 8:46 p.m. UTC | #2
Sent a v2 patch ->
https://lists.openembedded.org/g/openembedded-devel/message/118383

Khem Raj <raj.khem@gmail.com>, 9 Tem 2025 Çar, 19:08 tarihinde şunu yazdı:
>
> this fails to build with clang
>
> https://errors.yoctoproject.org/Errors/Details/869560/
>
> On 7/8/25 12:56 PM, Alper Ak via lists.openembedded.org wrote:
> > - Drop patches because already fixed in newer version
> >
> > Changelog:
> >
> > https://github.com/microsoft/GSL/compare/v4.0.0...v4.2.0
> > https://github.com/microsoft/GSL/releases/tag/v4.2.0
> > https://github.com/microsoft/GSL/releases/tag/v4.1.0
> >
> > Fix:
> >
> > | CMake Error at tests/CMakeLists.txt:1 (cmake_minimum_required):
> > |   Compatibility with CMake < 3.5 has been removed from CMake.
> > |
> > |   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
> > |   to tell CMake that the project requires at least <min> but has been updated
> > |   to work with policies introduced by <max> or earlier.
> > |
> > |   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
> > |
> > |
> > | -- Configuring incomplete, errors occurred!
> >
> > Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
> > ---
> >   ...0001-Fix-initialization-in-test-1140.patch | 113 ------------------
> >   .../0002-Fix-gcc-build-problem.patch          |  82 -------------
> >   ...eck_cxx_compiler_flag-to-cmake-3.0.2.patch |  53 --------
> >   ...ft-gsl_4.0.0.bb => microsoft-gsl_4.2.0.bb} |   8 +-
> >   4 files changed, 2 insertions(+), 254 deletions(-)
> >   delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
> >   delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
> >   delete mode 100644 meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
> >   rename meta-oe/recipes-devtools/microsoft-gsl/{microsoft-gsl_4.0.0.bb => microsoft-gsl_4.2.0.bb} (87%)
> >
> > diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
> > deleted file mode 100644
> > index 84a585d3c5..0000000000
> > --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
> > +++ /dev/null
> > @@ -1,113 +0,0 @@
> > -From 1b4d42ca2e97061042ec44a0b34ceb176c78c7e1 Mon Sep 17 00:00:00 2001
> > -From: d-winsor <danwin@microsoft.com>
> > -Date: Mon, 26 Feb 2024 13:17:12 -0800
> > -Subject: [PATCH] Fix initialization in test (#1140)
> > -
> > -* Suppress unsafe-buffer-usage
> > -
> > -Upstream-Status: Backport [https://github.com/microsoft/GSL/commit/1b4d42ca2e97061042ec44a0b34ceb176c78c7e1]
> > -
> > -Signed-off-by: Peter Marko <peter.marko@siemens.com>
> > ----
> > - include/gsl/span     | 10 ++++++++++
> > - include/gsl/util     | 10 ++++++++++
> > - tests/CMakeLists.txt | 10 ++++++++++
> > - tests/span_tests.cpp |  2 +-
> > - 4 files changed, 31 insertions(+), 1 deletion(-)
> > -
> > -diff --git a/include/gsl/span b/include/gsl/span
> > -index cc8a7b9..d254e4d 100644
> > ---- a/include/gsl/span
> > -+++ b/include/gsl/span
> > -@@ -58,6 +58,12 @@
> > - #pragma GCC diagnostic ignored "-Wsign-conversion"
> > - #endif
> > -
> > -+// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> > -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#pragma clang diagnostic push
> > -+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> > -+#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+
> > - namespace gsl
> > - {
> > -
> > -@@ -818,4 +824,8 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
> > - #pragma GCC diagnostic pop
> > - #endif // __GNUC__ > 6
> > -
> > -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#pragma clang diagnostic pop
> > -+#endif
> > -+
> > - #endif // GSL_SPAN_H
> > -diff --git a/include/gsl/util b/include/gsl/util
> > -index a215bad..11735a8 100644
> > ---- a/include/gsl/util
> > -+++ b/include/gsl/util
> > -@@ -39,6 +39,12 @@
> > -
> > - #endif // _MSC_VER
> > -
> > -+// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> > -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#pragma clang diagnostic push
> > -+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> > -+#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+
> > - #if defined(__cplusplus) && (__cplusplus >= 201703L)
> > - #define GSL_NODISCARD [[nodiscard]]
> > - #else
> > -@@ -157,4 +163,8 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
> > -
> > - #endif // _MSC_VER
> > -
> > -+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#pragma clang diagnostic pop
> > -+#endif
> > -+
> > - #endif // GSL_UTIL_H
> > -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> > -index cab4e56..20de9e1 100644
> > ---- a/tests/CMakeLists.txt
> > -+++ b/tests/CMakeLists.txt
> > -@@ -167,6 +167,11 @@ else()
> > -         >
> > -     )
> > - endif(MSVC)
> > -+check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> > -+if (WARN_UNSAFE_BUFFER)
> > -+  # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> > -+  target_compile_options(gsl_tests_config INTERFACE "-Wno-unsafe-buffer-usage")
> > -+endif()
> > -
> > - # for tests to find the gtest header
> > - target_include_directories(gsl_tests_config SYSTEM INTERFACE
> > -@@ -267,6 +272,11 @@ else()
> > -         >
> > -     )
> > - endif(MSVC)
> > -+check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> > -+if (WARN_UNSAFE_BUFFER)
> > -+  # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> > -+  target_compile_options(gsl_tests_config_noexcept INTERFACE "-Wno-unsafe-buffer-usage")
> > -+endif()
> > -
> > - add_executable(gsl_noexcept_tests no_exception_ensure_tests.cpp)
> > - target_link_libraries(gsl_noexcept_tests
> > -diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
> > -index 33ccf56..3c1dfe5 100644
> > ---- a/tests/span_tests.cpp
> > -+++ b/tests/span_tests.cpp
> > -@@ -330,7 +330,7 @@ TEST(span_test, from_array_constructor)
> > -         EXPECT_TRUE(s.data() == std::addressof(arr2d[0]));
> > -     }
> > -
> > --    int arr3d[2][3][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
> > -+    int arr3d[2][3][2] = { { {1, 2}, {3, 4}, {5, 6} }, { {7, 8}, {9, 10}, {11, 12} } };
> > -
> > - #ifdef CONFIRM_COMPILATION_ERRORS
> > -     {
> > ---
> > -2.30.2
> > -
> > diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
> > deleted file mode 100644
> > index 2f7542c62c..0000000000
> > --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
> > +++ /dev/null
> > @@ -1,82 +0,0 @@
> > -From aa4fd1f57794964640005900c2b47af1a0940b7b Mon Sep 17 00:00:00 2001
> > -From: Werner Henze <w.henze@avm.de>
> > -Date: Fri, 1 Mar 2024 15:53:50 +0100
> > -Subject: [PATCH] Fix gcc build problem
> > -
> > -Closes issue #1148 by fixing problems introduced in PR #1140.
> > -
> > -Upstream-Status: Submitted [https://github.com/microsoft/GSL/pull/1149]
> > -
> > -Signed-off-by: Peter Marko <peter.marko@siemens.com>
> > ----
> > - include/gsl/span | 12 ++++++++----
> > - include/gsl/util | 12 ++++++++----
> > - 2 files changed, 16 insertions(+), 8 deletions(-)
> > -
> > -diff --git a/include/gsl/span b/include/gsl/span
> > -index 0de2932..d2ef9f7 100644
> > ---- a/include/gsl/span
> > -+++ b/include/gsl/span
> > -@@ -59,10 +59,12 @@
> > - #endif
> > -
> > - // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> > --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#if defined(__clang__)
> > -+#if __has_warning("-Wunsafe-buffer-usage")
> > - #pragma clang diagnostic push
> > - #pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> > --#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#endif // __has_warning("-Wunsafe-buffer-usage")
> > -+#endif // defined(__clang__)
> > -
> > - namespace gsl
> > - {
> > -@@ -824,8 +826,10 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
> > - #pragma GCC diagnostic pop
> > - #endif // __GNUC__ > 6
> > -
> > --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#if defined(__clang__)
> > -+#if __has_warning("-Wunsafe-buffer-usage")
> > - #pragma clang diagnostic pop
> > --#endif
> > -+#endif // __has_warning("-Wunsafe-buffer-usage")
> > -+#endif // defined(__clang__)
> > -
> > - #endif // GSL_SPAN_H
> > -diff --git a/include/gsl/util b/include/gsl/util
> > -index b853017..26b2f5f 100644
> > ---- a/include/gsl/util
> > -+++ b/include/gsl/util
> > -@@ -40,10 +40,12 @@
> > - #endif // _MSC_VER
> > -
> > - // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
> > --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#if defined(__clang__)
> > -+#if __has_warning("-Wunsafe-buffer-usage")
> > - #pragma clang diagnostic push
> > - #pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
> > --#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#endif // __has_warning("-Wunsafe-buffer-usage")
> > -+#endif // defined(__clang__)
> > -
> > - #if defined(__cplusplus) && (__cplusplus >= 201703L)
> > - #define GSL_NODISCARD [[nodiscard]]
> > -@@ -163,8 +165,10 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
> > -
> > - #endif // _MSC_VER
> > -
> > --#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
> > -+#if defined(__clang__)
> > -+#if __has_warning("-Wunsafe-buffer-usage")
> > - #pragma clang diagnostic pop
> > --#endif
> > -+#endif // __has_warning("-Wunsafe-buffer-usage")
> > -+#endif // defined(__clang__)
> > -
> > - #endif // GSL_UTIL_H
> > ---
> > -2.30.2
> > -
> > diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
> > deleted file mode 100644
> > index ed057f5243..0000000000
> > --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
> > +++ /dev/null
> > @@ -1,53 +0,0 @@
> > -From 85e1c38bcf84bd4e2ce63ef74f0cfa1f5e92261e Mon Sep 17 00:00:00 2001
> > -From: Peter Marko <peter.marko@siemens.com>
> > -Date: Wed, 27 Mar 2024 23:46:31 +0100
> > -Subject: [PATCH] Adapt check_cxx_compiler_flag to cmake 3.0.2
> > -
> > -Backporting commits which are upgrading cmake_minimum_required and
> > -include check_cxx_compiler_flag have too many additional changes.
> > -
> > -Let's just do a simple adaptation of our backported patch so
> > -it works with older cmake version instead.
> > -
> > -This can be safely removed when recipe version is upgraded.
> > -
> > -Upstream-Status: Inappropriate
> > -
> > -Signed-off-by: Peter Marko <peter.marko@siemens.com>
> > ----
> > - tests/CMakeLists.txt | 5 +++--
> > - 1 file changed, 3 insertions(+), 2 deletions(-)
> > -
> > -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> > -index 20de9e1..54c3ac5 100644
> > ---- a/tests/CMakeLists.txt
> > -+++ b/tests/CMakeLists.txt
> > -@@ -5,6 +5,7 @@ enable_testing()  # again, for support standalone testing
> > -
> > - include(FindPkgConfig)
> > - include(ExternalProject)
> > -+include(CheckCXXCompilerFlag)
> > -
> > - # will make visual studio generated project group files
> > - set_property(GLOBAL PROPERTY USE_FOLDERS ON)
> > -@@ -167,7 +168,7 @@ else()
> > -         >
> > -     )
> > - endif(MSVC)
> > --check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> > -+CHECK_CXX_COMPILER_FLAG("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> > - if (WARN_UNSAFE_BUFFER)
> > -   # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> > -   target_compile_options(gsl_tests_config INTERFACE "-Wno-unsafe-buffer-usage")
> > -@@ -272,7 +273,7 @@ else()
> > -         >
> > -     )
> > - endif(MSVC)
> > --check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> > -+CHECK_CXX_COMPILER_FLAG("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
> > - if (WARN_UNSAFE_BUFFER)
> > -   # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
> > -   target_compile_options(gsl_tests_config_noexcept INTERFACE "-Wno-unsafe-buffer-usage")
> > ---
> > -2.30.2
> > -
> > diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
> > similarity index 87%
> > rename from meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb
> > rename to meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
> > index 2fbbf8f06a..610c45a298 100644
> > --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb
> > +++ b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
> > @@ -9,13 +9,9 @@ LICENSE = "MIT"
> >   LIC_FILES_CHKSUM = "file://LICENSE;md5=363055e71e77071107ba2bb9a54bd9a7"
> >
> >   SRC_URI = "git://github.com/microsoft/GSL.git;protocol=https;branch=main \
> > -    file://run-ptest \
> > -    file://0001-Fix-initialization-in-test-1140.patch \
> > -    file://0002-Fix-gcc-build-problem.patch \
> > -    file://0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch \
> > +        file://run-ptest \
> >   "
> > -SRCREV = "a3534567187d2edc428efd3f13466ff75fe5805c"
> > -
> > +SRCREV = "2828399820ef4928cc89b65605dca5dc68efca6e"
> >
> >   inherit cmake pkgconfig ptest
> >
> >
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#118340): https://lists.openembedded.org/g/openembedded-devel/message/118340
> > Mute This Topic: https://lists.openembedded.org/mt/114053267/1997914
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
deleted file mode 100644
index 84a585d3c5..0000000000
--- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0001-Fix-initialization-in-test-1140.patch
+++ /dev/null
@@ -1,113 +0,0 @@ 
-From 1b4d42ca2e97061042ec44a0b34ceb176c78c7e1 Mon Sep 17 00:00:00 2001
-From: d-winsor <danwin@microsoft.com>
-Date: Mon, 26 Feb 2024 13:17:12 -0800
-Subject: [PATCH] Fix initialization in test (#1140)
-
-* Suppress unsafe-buffer-usage
-
-Upstream-Status: Backport [https://github.com/microsoft/GSL/commit/1b4d42ca2e97061042ec44a0b34ceb176c78c7e1]
-
-Signed-off-by: Peter Marko <peter.marko@siemens.com>
----
- include/gsl/span     | 10 ++++++++++
- include/gsl/util     | 10 ++++++++++
- tests/CMakeLists.txt | 10 ++++++++++
- tests/span_tests.cpp |  2 +-
- 4 files changed, 31 insertions(+), 1 deletion(-)
-
-diff --git a/include/gsl/span b/include/gsl/span
-index cc8a7b9..d254e4d 100644
---- a/include/gsl/span
-+++ b/include/gsl/span
-@@ -58,6 +58,12 @@
- #pragma GCC diagnostic ignored "-Wsign-conversion"
- #endif
- 
-+// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
-+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
-+#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+
- namespace gsl
- {
- 
-@@ -818,4 +824,8 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
- #pragma GCC diagnostic pop
- #endif // __GNUC__ > 6
- 
-+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#pragma clang diagnostic pop
-+#endif
-+
- #endif // GSL_SPAN_H
-diff --git a/include/gsl/util b/include/gsl/util
-index a215bad..11735a8 100644
---- a/include/gsl/util
-+++ b/include/gsl/util
-@@ -39,6 +39,12 @@
- 
- #endif // _MSC_VER
- 
-+// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
-+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
-+#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+
- #if defined(__cplusplus) && (__cplusplus >= 201703L)
- #define GSL_NODISCARD [[nodiscard]]
- #else
-@@ -157,4 +163,8 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
- 
- #endif // _MSC_VER
- 
-+#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#pragma clang diagnostic pop
-+#endif
-+
- #endif // GSL_UTIL_H
-diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
-index cab4e56..20de9e1 100644
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -167,6 +167,11 @@ else()
-         >
-     )
- endif(MSVC)
-+check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
-+if (WARN_UNSAFE_BUFFER)
-+  # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
-+  target_compile_options(gsl_tests_config INTERFACE "-Wno-unsafe-buffer-usage")
-+endif()
- 
- # for tests to find the gtest header
- target_include_directories(gsl_tests_config SYSTEM INTERFACE
-@@ -267,6 +272,11 @@ else()
-         >
-     )
- endif(MSVC)
-+check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
-+if (WARN_UNSAFE_BUFFER)
-+  # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
-+  target_compile_options(gsl_tests_config_noexcept INTERFACE "-Wno-unsafe-buffer-usage")
-+endif()
- 
- add_executable(gsl_noexcept_tests no_exception_ensure_tests.cpp)
- target_link_libraries(gsl_noexcept_tests
-diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
-index 33ccf56..3c1dfe5 100644
---- a/tests/span_tests.cpp
-+++ b/tests/span_tests.cpp
-@@ -330,7 +330,7 @@ TEST(span_test, from_array_constructor)
-         EXPECT_TRUE(s.data() == std::addressof(arr2d[0]));
-     }
- 
--    int arr3d[2][3][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
-+    int arr3d[2][3][2] = { { {1, 2}, {3, 4}, {5, 6} }, { {7, 8}, {9, 10}, {11, 12} } };
- 
- #ifdef CONFIRM_COMPILATION_ERRORS
-     {
--- 
-2.30.2
-
diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
deleted file mode 100644
index 2f7542c62c..0000000000
--- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch
+++ /dev/null
@@ -1,82 +0,0 @@ 
-From aa4fd1f57794964640005900c2b47af1a0940b7b Mon Sep 17 00:00:00 2001
-From: Werner Henze <w.henze@avm.de>
-Date: Fri, 1 Mar 2024 15:53:50 +0100
-Subject: [PATCH] Fix gcc build problem
-
-Closes issue #1148 by fixing problems introduced in PR #1140.
-
-Upstream-Status: Submitted [https://github.com/microsoft/GSL/pull/1149]
-
-Signed-off-by: Peter Marko <peter.marko@siemens.com>
----
- include/gsl/span | 12 ++++++++----
- include/gsl/util | 12 ++++++++----
- 2 files changed, 16 insertions(+), 8 deletions(-)
-
-diff --git a/include/gsl/span b/include/gsl/span
-index 0de2932..d2ef9f7 100644
---- a/include/gsl/span
-+++ b/include/gsl/span
-@@ -59,10 +59,12 @@
- #endif
- 
- // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
--#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#if defined(__clang__)
-+#if __has_warning("-Wunsafe-buffer-usage")
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
--#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#endif // __has_warning("-Wunsafe-buffer-usage")
-+#endif // defined(__clang__)
- 
- namespace gsl
- {
-@@ -824,8 +826,10 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
- #pragma GCC diagnostic pop
- #endif // __GNUC__ > 6
- 
--#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#if defined(__clang__)
-+#if __has_warning("-Wunsafe-buffer-usage")
- #pragma clang diagnostic pop
--#endif
-+#endif // __has_warning("-Wunsafe-buffer-usage")
-+#endif // defined(__clang__)
- 
- #endif // GSL_SPAN_H
-diff --git a/include/gsl/util b/include/gsl/util
-index b853017..26b2f5f 100644
---- a/include/gsl/util
-+++ b/include/gsl/util
-@@ -40,10 +40,12 @@
- #endif // _MSC_VER
- 
- // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
--#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#if defined(__clang__)
-+#if __has_warning("-Wunsafe-buffer-usage")
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
--#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#endif // __has_warning("-Wunsafe-buffer-usage")
-+#endif // defined(__clang__)
- 
- #if defined(__cplusplus) && (__cplusplus >= 201703L)
- #define GSL_NODISCARD [[nodiscard]]
-@@ -163,8 +165,10 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
- 
- #endif // _MSC_VER
- 
--#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
-+#if defined(__clang__)
-+#if __has_warning("-Wunsafe-buffer-usage")
- #pragma clang diagnostic pop
--#endif
-+#endif // __has_warning("-Wunsafe-buffer-usage")
-+#endif // defined(__clang__)
- 
- #endif // GSL_UTIL_H
--- 
-2.30.2
-
diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
deleted file mode 100644
index ed057f5243..0000000000
--- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch
+++ /dev/null
@@ -1,53 +0,0 @@ 
-From 85e1c38bcf84bd4e2ce63ef74f0cfa1f5e92261e Mon Sep 17 00:00:00 2001
-From: Peter Marko <peter.marko@siemens.com>
-Date: Wed, 27 Mar 2024 23:46:31 +0100
-Subject: [PATCH] Adapt check_cxx_compiler_flag to cmake 3.0.2
-
-Backporting commits which are upgrading cmake_minimum_required and
-include check_cxx_compiler_flag have too many additional changes.
-
-Let's just do a simple adaptation of our backported patch so
-it works with older cmake version instead.
-
-This can be safely removed when recipe version is upgraded.
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Peter Marko <peter.marko@siemens.com>
----
- tests/CMakeLists.txt | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
-index 20de9e1..54c3ac5 100644
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -5,6 +5,7 @@ enable_testing()  # again, for support standalone testing
- 
- include(FindPkgConfig)
- include(ExternalProject)
-+include(CheckCXXCompilerFlag)
- 
- # will make visual studio generated project group files
- set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-@@ -167,7 +168,7 @@ else()
-         >
-     )
- endif(MSVC)
--check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
-+CHECK_CXX_COMPILER_FLAG("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
- if (WARN_UNSAFE_BUFFER)
-   # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
-   target_compile_options(gsl_tests_config INTERFACE "-Wno-unsafe-buffer-usage")
-@@ -272,7 +273,7 @@ else()
-         >
-     )
- endif(MSVC)
--check_cxx_compiler_flag("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
-+CHECK_CXX_COMPILER_FLAG("-Wno-unsafe-buffer-usage" WARN_UNSAFE_BUFFER)
- if (WARN_UNSAFE_BUFFER)
-   # This test uses very greedy heuristics such as "no pointer arithmetic on raw buffer"
-   target_compile_options(gsl_tests_config_noexcept INTERFACE "-Wno-unsafe-buffer-usage")
--- 
-2.30.2
-
diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
similarity index 87%
rename from meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb
rename to meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
index 2fbbf8f06a..610c45a298 100644
--- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.0.0.bb
+++ b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.0.bb
@@ -9,13 +9,9 @@  LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=363055e71e77071107ba2bb9a54bd9a7"
 
 SRC_URI = "git://github.com/microsoft/GSL.git;protocol=https;branch=main \
-    file://run-ptest \
-    file://0001-Fix-initialization-in-test-1140.patch \
-    file://0002-Fix-gcc-build-problem.patch \
-    file://0003-Adapt-check_cxx_compiler_flag-to-cmake-3.0.2.patch \
+        file://run-ptest \
 "
-SRCREV = "a3534567187d2edc428efd3f13466ff75fe5805c"
-
+SRCREV = "2828399820ef4928cc89b65605dca5dc68efca6e"
 
 inherit cmake pkgconfig ptest