From 1f47615e52af0df2929efceed25f8aef4b59cf96 Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Thu, 15 Jun 2023 10:39:13 -0700 Subject: [PATCH] [mdl-sdk] Workaround broken gcc-11 (#32008) --- ports/mdl-sdk/010-workaround-gcc-bit.patch | 13 +++++++++++++ ports/mdl-sdk/portfile.cmake | 20 ++++++++++++++++++++ ports/mdl-sdk/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/m-/mdl-sdk.json | 5 +++++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 ports/mdl-sdk/010-workaround-gcc-bit.patch diff --git a/ports/mdl-sdk/010-workaround-gcc-bit.patch b/ports/mdl-sdk/010-workaround-gcc-bit.patch new file mode 100644 index 0000000000..9583a46813 --- /dev/null +++ b/ports/mdl-sdk/010-workaround-gcc-bit.patch @@ -0,0 +1,13 @@ +diff --git a/include/mi/base/types.h b/include/mi/base/types.h +index a6faabe..47f836b 100644 +--- a/include/mi/base/types.h ++++ b/include/mi/base/types.h +@@ -349,7 +349,7 @@ namespace { + /// float fval( 0.0f ); + /// Uint32 uval( binary_cast(fval) ); + /// \endcode +-#if (defined(_WIN32) && defined(_HAS_CXX20) && _HAS_CXX20) || (defined(__GNUC__) && (__GNUC__ >= 11 )) ++#if (defined(_WIN32) && defined(_HAS_CXX20) && _HAS_CXX20) || (defined(__GNUC__) && (__GNUC__ >= 12 )) + #include + template constexpr T binary_cast(const S& src) noexcept { return std::bit_cast(src); } + #else diff --git a/ports/mdl-sdk/portfile.cmake b/ports/mdl-sdk/portfile.cmake index 316a78a273..4d342e856d 100644 --- a/ports/mdl-sdk/portfile.cmake +++ b/ports/mdl-sdk/portfile.cmake @@ -65,6 +65,25 @@ endif() # MDL-SDK +# The patch "workaround gcc bit" works around included with gcc included with Ubuntu 22.04 +# failing to compile as used here, with errors originating *inside* like: +# [156/1742] /usr/bin/c++ -DBIT64=1 -DDEBUG -DHAS_SSE -DMDL_SOURCE_RELEASE -DMI_PLATFORM=\"linux-x86-64-gcc\" -DMI_PLATFORM_UNIX -DX86=1 -D_DEBUG -I/home/bion/vcpkg/buildtrees/mdl-sdk/x64-linux-dbg/src/base/system/main -I/home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src/base/system/main -I/home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/include -I/home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src -fPIC -g -fPIC -fno-strict-aliasing -march=nocona -gdwarf-3 -gstrict-dwarf -Wall -Wvla -Wno-init-list-lifetime -Wno-placement-new -Wno-parentheses -Wno-sign-compare -Wno-narrowing -Wno-unused-but-set-variable -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-pragmas -std=gnu++17 -MD -MT src/base/system/main/CMakeFiles/base-system-main.dir/module_registration_entry.cpp.o -MF src/base/system/main/CMakeFiles/base-system-main.dir/module_registration_entry.cpp.o.d -o src/base/system/main/CMakeFiles/base-system-main.dir/module_registration_entry.cpp.o -c /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src/base/system/main/module_registration_entry.cpp +# FAILED: src/base/system/main/CMakeFiles/base-system-main.dir/module_registration_entry.cpp.o +# /usr/bin/c++ -DBIT64=1 -DDEBUG -DHAS_SSE -DMDL_SOURCE_RELEASE -DMI_PLATFORM=\"linux-x86-64-gcc\" -DMI_PLATFORM_UNIX -DX86=1 -D_DEBUG -I/home/bion/vcpkg/buildtrees/mdl-sdk/x64-linux-dbg/src/base/system/main -I/home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src/base/system/main -I/home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/include -I/home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src -fPIC -g -fPIC -fno-strict-aliasing -march=nocona -gdwarf-3 -gstrict-dwarf -Wall -Wvla -Wno-init-list-lifetime -Wno-placement-new -Wno-parentheses -Wno-sign-compare -Wno-narrowing -Wno-unused-but-set-variable -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-pragmas -std=gnu++17 -MD -MT src/base/system/main/CMakeFiles/base-system-main.dir/module_registration_entry.cpp.o -MF src/base/system/main/CMakeFiles/base-system-main.dir/module_registration_entry.cpp.o.d -o src/base/system/main/CMakeFiles/base-system-main.dir/module_registration_entry.cpp.o -c /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src/base/system/main/module_registration_entry.cpp +# In file included from /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src/base/system/main/types.h:37, +# from /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src/base/system/main/module_registration_entry.h:39, +# from /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/src/base/system/main/module_registration_entry.cpp:34: +# /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/include/mi/base/types.h: In function ‘constexpr T mi::base::binary_cast(const S&)’: +# /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/include/mi/base/types.h:356:89: error: ‘bit_cast’ is not a member of ‘mi::base::std’ +# 356 | template constexpr T binary_cast(const S& src) noexcept { return std::bit_cast(src); } +# | ^~~~~~~~ +# /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/include/mi/base/types.h:356:99: error: expected primary-expression before ‘,’ token +# 356 | template constexpr T binary_cast(const S& src) noexcept { return std::bit_cast(src); } +# | ^ +# /home/bion/vcpkg/buildtrees/mdl-sdk/src/830ab63109-115b19fca8/include/mi/base/types.h:356:101: error: expected primary-expression before ‘>’ token +# 356 | template constexpr T binary_cast(const S& src) noexcept { return std::bit_cast(src); } +# | ^ + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO NVIDIA/MDL-SDK @@ -81,6 +100,7 @@ vcpkg_from_github( 007-plugin-options.patch 008-build-static-llvm.patch 009-include-priority-vendored-llvm.patch + 010-workaround-gcc-bit.patch ) string(COMPARE NOTEQUAL "${VCPKG_CRT_LINKAGE}" "static" _MVSC_CRT_LINKAGE_OPTION) diff --git a/ports/mdl-sdk/vcpkg.json b/ports/mdl-sdk/vcpkg.json index 1b2b480939..514e56b984 100644 --- a/ports/mdl-sdk/vcpkg.json +++ b/ports/mdl-sdk/vcpkg.json @@ -1,6 +1,7 @@ { "name": "mdl-sdk", "version": "2021.1.2", + "port-version": 1, "description": "NVIDIA Material Definition Language SDK", "homepage": "https://github.com/NVIDIA/MDL-SDK", "license": "BSD-3-Clause", diff --git a/versions/baseline.json b/versions/baseline.json index 623f0f74bd..b96092b8f5 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5202,7 +5202,7 @@ }, "mdl-sdk": { "baseline": "2021.1.2", - "port-version": 0 + "port-version": 1 }, "mdns": { "baseline": "1.4.2", diff --git a/versions/m-/mdl-sdk.json b/versions/m-/mdl-sdk.json index 5befda98fa..b464e3f1ae 100644 --- a/versions/m-/mdl-sdk.json +++ b/versions/m-/mdl-sdk.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7b540090b50df32e1bdcab5953994590e0fb37bd", + "version": "2021.1.2", + "port-version": 1 + }, { "git-tree": "1ea6f971b1824f51c7beed4983f54733b24f1bed", "version": "2021.1.2",