From nobody Sat Sep 09 05:29:21 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RjM3j5RNmz4sZGS; Sat, 9 Sep 2023 05:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RjM3j4tQTz4PYZ; Sat, 9 Sep 2023 05:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694237361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzTepMyYrtkHT8P75X59ebjNs0u5SO1abSRgLntIZ2k=; b=Vb4wHn+bSqrJtdqB2j9rikLVwqSh8Mj8f22yrlq9FAszlEFuUrrNV/ku6qzMbIEBZ4iknK 4iFpb2mhOBNX+bqa3Ze37PUhym3YWxEik9ZXzzmLTFwbXExAOLTV+vMnF7OCsfDZZLTRv8 EBGYTE/KIdiA+C3H3sG0/OvrMdNQSbOsrIAtN4ve2wPy8giaCkscVQP3N9H0UWafYO6R9t ghAuDfWeDlEFFIYjX7OA692t8sFr7Q4Ybbd5Gl3zTNypEUGI5975JY9IT4uRFPMpULgME+ 15geQUqqSF8gssJkl0AgxWm4HtjEMfUt+aUiMwI9YLDTZpv92f3ITkDaRkADww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694237361; a=rsa-sha256; cv=none; b=FIcvipZRVEMxClo6ObvjqbVxjQOPejzKYSTEkPbytstn6WeCzuI8UGQNhpeSKm/yLpQq/e t09yz/bVNFzX1l73bj9tJUJAWm+vgDLyUeTXH2A6ZejHwHefjkCnjdeA3TAJYT+wllkkc/ UwlkjsyX2yUBdO1IJsUQZw63C9Y1d2Qjr0pqHFVBG+SujpxMYP7RT956gD9c4IwpgPe4yV 1fABZ2UROqQVTy9Wn6MC59IVlXEDTXaze2P4kLgbuJbZi5dNzIqu5CORmcH2sRincgKVJG po+Gx8qZmZcmCHqEKoXCKVsW/1T492gXTMnVW2a4UMJ7k/JmLGLeSEUcdCV2PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694237361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzTepMyYrtkHT8P75X59ebjNs0u5SO1abSRgLntIZ2k=; b=ubI13Ozyhx5NNCKYnFwvomeK9zH9EGgpJzICA+ak79Q7oHWR+r+dJxuXCAxmRs+BMl/BkE LjL8zJsy/HFBQScAfOIcB/63R/Nh1ks2iBrXDZ2Oobde1/qv2Z4y4KfyhBLPWhLpXhwqpt xAMiNqfifjMLDs5XRJGiwInMxEnuYqTIKbSYwKFZH89mkaZOZBT/aurgSRCDm/OkGx3hRR G8wl5Z87YZ4CziPU9tbiv1Q3U4TQalSu8zk8Vj9jQE9oHARJNby5o9VTELOaXPWYJ4CQjU ItIrFqnhjiCVmnAyiKcEnpjKACjql+mIBn6iaXJIEtDiaCHLmg3+ySKXs32WyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RjM3j3z52z1BRK; Sat, 9 Sep 2023 05:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3895TLfi053764; Sat, 9 Sep 2023 05:29:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3895TL3k053761; Sat, 9 Sep 2023 05:29:21 GMT (envelope-from git) Date: Sat, 9 Sep 2023 05:29:21 GMT Message-Id: <202309090529.3895TL3k053761@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Matthias Fechner Subject: git: 24de08d4d0fb - main - devel/libgit2: fix build with clang 16 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mfechner X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24de08d4d0fb6f0957817de3971ac22ea8d83a91 Auto-Submitted: auto-generated The branch main has been updated by mfechner: URL: https://cgit.FreeBSD.org/ports/commit/?id=24de08d4d0fb6f0957817de3971ac22ea8d83a91 commit 24de08d4d0fb6f0957817de3971ac22ea8d83a91 Author: Guido Falsi AuthorDate: 2023-09-09 04:51:14 +0000 Commit: Matthias Fechner CommitDate: 2023-09-09 04:52:51 +0000 devel/libgit2: fix build with clang 16 Update the patch from: https://cgit.freebsd.org/ports/commit/devel/libgit2?id=a62f1b5796b641bb502b33f7f073238a49dc4d0c so it can by applied to libgit 1.6.x --- devel/libgit2/files/patch-github-pr6555 | 145 ++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/devel/libgit2/files/patch-github-pr6555 b/devel/libgit2/files/patch-github-pr6555 new file mode 100644 index 000000000000..af4a5f36ef08 --- /dev/null +++ b/devel/libgit2/files/patch-github-pr6555 @@ -0,0 +1,145 @@ +--- CMakeLists.txt.orig 2023-02-15 10:03:30 UTC ++++ CMakeLists.txt +@@ -96,7 +96,7 @@ include(CheckStructHasMember) + include(CheckFunctionExists) + include(CheckSymbolExists) + include(CheckStructHasMember) +-include(CheckPrototypeDefinition) ++include(CheckPrototypeDefinitionSafe) + include(AddCFlagIfSupported) + include(FindPkgLibraries) + include(FindThreads) +--- cmake/CheckPrototypeDefinitionSafe.cmake.orig 2023-05-14 12:22:20 UTC ++++ cmake/CheckPrototypeDefinitionSafe.cmake +@@ -0,0 +1,16 @@ ++include(CheckPrototypeDefinition) ++ ++function(check_prototype_definition_safe function prototype return header variable) ++ # temporarily save CMAKE_C_FLAGS and disable warnings about unused ++ # unused functions and parameters, otherwise they will always fail ++ # if ENABLE_WERROR is on ++ set(SAVED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") ++ ++ disable_warnings(unused-function) ++ disable_warnings(unused-parameter) ++ ++ check_prototype_definition("${function}" "${prototype}" "${return}" "${header}" "${variable}") ++ ++ # restore CMAKE_C_FLAGS ++ set(CMAKE_C_FLAGS "${SAVED_CMAKE_C_FLAGS}") ++endfunction() +--- src/CMakeLists.txt.orig 2023-02-15 10:03:30 UTC ++++ src/CMakeLists.txt +@@ -58,15 +58,29 @@ add_feature_info(futimens GIT_USE_FUTIMENS "futimens s + + # qsort + +-check_prototype_definition(qsort_r +- "void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))" +- "" "stdlib.h" GIT_QSORT_R_BSD) ++# old-style FreeBSD qsort_r() has the 'context' parameter as the first argument ++# of the comparison function: ++check_prototype_definition_safe(qsort_r ++ "void (qsort_r)(void *base, size_t nmemb, size_t size, void *context, int (*compar)(void *, const void *, const void *))" ++ "" "stdlib.h" GIT_QSORT_BSD) + +-check_prototype_definition(qsort_r +- "void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg)" +- "" "stdlib.h" GIT_QSORT_R_GNU) ++# GNU or POSIX qsort_r() has the 'context' parameter as the last argument of the ++# comparison function: ++check_prototype_definition_safe(qsort_r ++ "void (qsort_r)(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *context)" ++ "" "stdlib.h" GIT_QSORT_GNU) + +-check_function_exists(qsort_s GIT_QSORT_S) ++# C11 qsort_s() has the 'context' parameter as the last argument of the ++# comparison function, and returns an error status: ++check_prototype_definition_safe(qsort_s ++ "errno_t (qsort_s)(void *base, rsize_t nmemb, rsize_t size, int (*compar)(const void *, const void *, void *), void *context)" ++ "0" "stdlib.h" GIT_QSORT_C11) ++ ++# MSC qsort_s() has the 'context' parameter as the first argument of the ++# comparison function, and as the last argument of qsort_s(): ++check_prototype_definition_safe(qsort_s ++ "void (qsort_s)(void *base, size_t num, size_t width, int (*compare )(void *, const void *, const void *), void *context)" ++ "" "stdlib.h" GIT_QSORT_MSC) + + # random / entropy data + +--- src/util/git2_features.h.in.orig 2023-02-15 10:03:30 UTC ++++ src/util/git2_features.h.in +@@ -24,9 +24,10 @@ + #cmakedefine GIT_REGEX_PCRE2 + #cmakedefine GIT_REGEX_BUILTIN 1 + +-#cmakedefine GIT_QSORT_R_BSD +-#cmakedefine GIT_QSORT_R_GNU +-#cmakedefine GIT_QSORT_S ++#cmakedefine GIT_QSORT_BSD ++#cmakedefine GIT_QSORT_GNU ++#cmakedefine GIT_QSORT_C11 ++#cmakedefine GIT_QSORT_MSC + + #cmakedefine GIT_SSH 1 + #cmakedefine GIT_SSH_MEMORY_CREDENTIALS 1 +--- src/util/util.c.orig 2023-02-15 10:03:30 UTC ++++ src/util/util.c +@@ -18,7 +18,7 @@ + # endif + # include + +-# ifdef GIT_QSORT_S ++# ifdef GIT_QSORT_MSC + # include + # endif + #endif +@@ -673,7 +673,7 @@ size_t git__unescape(char *str) + return (pos - str); + } + +-#if defined(GIT_QSORT_S) || defined(GIT_QSORT_R_BSD) ++#if defined(GIT_QSORT_MSC) || defined(GIT_QSORT_BSD) + typedef struct { + git__sort_r_cmp cmp; + void *payload; +@@ -688,9 +688,11 @@ static int GIT_LIBGIT2_CALL git__qsort_r_glue_cmp( + #endif + + +-#if !defined(GIT_QSORT_R_BSD) && \ +- !defined(GIT_QSORT_R_GNU) && \ +- !defined(GIT_QSORT_S) ++#if !defined(GIT_QSORT_BSD) && \ ++ !defined(GIT_QSORT_GNU) && \ ++ !defined(GIT_QSORT_C11) && \ ++ !defined(GIT_QSORT_MSC) ++ + static void swap(uint8_t *a, uint8_t *b, size_t elsize) + { + char tmp[256]; +@@ -716,17 +718,20 @@ static void insertsort( + for (j = i; j > base && cmp(j, j - elsize, payload) < 0; j -= elsize) + swap(j, j - elsize, elsize); + } ++ + #endif + + void git__qsort_r( + void *els, size_t nel, size_t elsize, git__sort_r_cmp cmp, void *payload) + { +-#if defined(GIT_QSORT_R_BSD) ++#if defined(GIT_QSORT_GNU) ++ qsort_r(els, nel, elsize, cmp, payload); ++#elif defined(GIT_QSORT_C11) ++ qsort_s(els, nel, elsize, cmp, payload); ++#elif defined(GIT_QSORT_BSD) + git__qsort_r_glue glue = { cmp, payload }; + qsort_r(els, nel, elsize, &glue, git__qsort_r_glue_cmp); +-#elif defined(GIT_QSORT_R_GNU) +- qsort_r(els, nel, elsize, cmp, payload); +-#elif defined(GIT_QSORT_S) ++#elif defined(GIT_QSORT_MSC) + git__qsort_r_glue glue = { cmp, payload }; + qsort_s(els, nel, elsize, git__qsort_r_glue_cmp, &glue); + #else