diff --git a/graphics/tiff/files/patch-cmake_LinkerChecks.cmake b/graphics/tiff/files/patch-cmake_LinkerChecks.cmake deleted file mode 100644 index 8b6c8c54482f..000000000000 --- a/graphics/tiff/files/patch-cmake_LinkerChecks.cmake +++ /dev/null @@ -1,11 +0,0 @@ ---- cmake/LinkerChecks.cmake.orig 2024-09-21 09:08:00 UTC -+++ cmake/LinkerChecks.cmake -@@ -39,7 +39,7 @@ set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) - } VERS_1; - ") - set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) --set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map") -+set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -Wl,--undefined-version "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map") - check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT) - set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) - file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") diff --git a/graphics/tiff/files/patch-git-01-0dbcfc5bd2eaacf8be4f57f8b7cc7369d88fafa8 b/graphics/tiff/files/patch-git-01-0dbcfc5bd2eaacf8be4f57f8b7cc7369d88fafa8 new file mode 100644 index 000000000000..765bf56f26da --- /dev/null +++ b/graphics/tiff/files/patch-git-01-0dbcfc5bd2eaacf8be4f57f8b7cc7369d88fafa8 @@ -0,0 +1,52 @@ +From 0dbcfc5bd2eaacf8be4f57f8b7cc7369d88fafa8 Mon Sep 17 00:00:00 2001 +From: "Daniel E @diizzyy" +Date: Sun, 20 Oct 2024 22:45:15 +0200 +Subject: [PATCH] CMake: fix build with LLVM/Clang 17+ + +Fixes #651 +--- + cmake/LinkerChecks.cmake | 7 ++++++- + libtiff/CMakeLists.txt | 9 +++++++-- + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/cmake/LinkerChecks.cmake b/cmake/LinkerChecks.cmake +index ad1f0f9ff..90496bd2e 100644 +--- cmake/LinkerChecks.cmake ++++ cmake/LinkerChecks.cmake +@@ -39,7 +39,12 @@ VERS_2 { + } VERS_1; + ") + set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) +-set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map") ++if (CMAKE_VERSION GREATER_EQUAL 3.29 AND CMAKE_C_COMPILER_LINKER_ID STREQUAL "LLD" AND CMAKE_C_COMPILER_LINKER_VERSION GREATER_EQUAL 17) ++ set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -Wl,--undefined-version "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map") ++else() ++ set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map") ++endif() ++ + check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT) + set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") +diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt +index a8aa0c320..2762fab7c 100755 +--- libtiff/CMakeLists.txt ++++ libtiff/CMakeLists.txt +@@ -201,8 +201,13 @@ if(NOT CYGWIN) + set_target_properties(tiff PROPERTIES VERSION ${SO_VERSION}) + endif() + if(HAVE_LD_VERSION_SCRIPT) +- set_target_properties(tiff PROPERTIES LINK_FLAGS +- "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map") ++ if (CMAKE_VERSION GREATER_EQUAL 3.29 AND CMAKE_C_COMPILER_LINKER_ID STREQUAL "LLD" AND CMAKE_C_COMPILER_LINKER_VERSION GREATER_EQUAL 17) ++ set_target_properties(tiff PROPERTIES LINK_FLAGS ++ "-Wl,--undefined-version -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map") ++ else() ++ set_target_properties(tiff PROPERTIES LINK_FLAGS ++ "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map") ++ endif() + endif() + + if(tiff-install) +-- +GitLab + diff --git a/graphics/tiff/files/patch-libtiff_CMakeLists.txt b/graphics/tiff/files/patch-libtiff_CMakeLists.txt deleted file mode 100644 index face49e28c9a..000000000000 --- a/graphics/tiff/files/patch-libtiff_CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ ---- libtiff/CMakeLists.txt.orig 2024-08-15 21:16:11 UTC -+++ libtiff/CMakeLists.txt -@@ -202,7 +202,7 @@ if(HAVE_LD_VERSION_SCRIPT) - endif() - if(HAVE_LD_VERSION_SCRIPT) - set_target_properties(tiff PROPERTIES LINK_FLAGS -- "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map") -+ "-Wl,--undefined-version -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map") - endif() - - if(tiff-install)