From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 46C79158020 for ; Thu, 3 Nov 2022 01:24:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A3BEE0A5C; Thu, 3 Nov 2022 01:24:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DACFDE0A5C for ; Thu, 3 Nov 2022 01:24:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9549034103B for ; Thu, 3 Nov 2022 01:24:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id EE3AC617 for ; Thu, 3 Nov 2022 01:24:12 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1667438615.c305a45884a8f01838d6e032f469d7f9423154e1.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/autoconf/, sys-devel/autoconf/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/autoconf/autoconf-2.13-r3.ebuild sys-devel/autoconf/autoconf-2.13-r4.ebuild sys-devel/autoconf/files/autoconf-2.13-Clang-16-fixes-for-various-tests.patch X-VCS-Directories: sys-devel/autoconf/files/ sys-devel/autoconf/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: c305a45884a8f01838d6e032f469d7f9423154e1 X-VCS-Branch: master Date: Thu, 3 Nov 2022 01:24:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 19f90d66-6437-4405-a24d-567a4738a62a X-Archives-Hash: 9879e841fa4f8b31495d24a8f12afd4c commit: c305a45884a8f01838d6e032f469d7f9423154e1 Author: Sam James gentoo org> AuthorDate: Thu Nov 3 01:21:36 2022 +0000 Commit: Sam James gentoo org> CommitDate: Thu Nov 3 01:23:35 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c305a458 sys-devel/autoconf: further Clang 16 patches for autoconf 2.13 Reported by matsl when building XEmacs 21.4 (21.5 - which is WIP - works with newer autoconf). A bunch of the built-in/provided tests from autoconf 2.13 suffered from -Wimplicit-int or -Wimplicit-function-declaration. We also disable the {get,set}pgrp tests (see the patch for details, but the gist is they're unfixable without some substantial effort on POSIX systems nowadays and there's no need anyway -- they're gone in newer autoconf and we never expect them to fail.) Bug: https://bugs.gentoo.org/874366 Reported-by: Mats Lidell gentoo.org> Signed-off-by: Sam James gentoo.org> ...conf-2.13-r3.ebuild => autoconf-2.13-r4.ebuild} | 1 + ...onf-2.13-Clang-16-fixes-for-various-tests.patch | 243 +++++++++++++++++++++ 2 files changed, 244 insertions(+) diff --git a/sys-devel/autoconf/autoconf-2.13-r3.ebuild b/sys-devel/autoconf/autoconf-2.13-r4.ebuild similarity index 96% rename from sys-devel/autoconf/autoconf-2.13-r3.ebuild rename to sys-devel/autoconf/autoconf-2.13-r4.ebuild index 45a43a49c6f8..3593b3e30269 100644 --- a/sys-devel/autoconf/autoconf-2.13-r3.ebuild +++ b/sys-devel/autoconf/autoconf-2.13-r4.ebuild @@ -32,6 +32,7 @@ PATCHES=( "${FILESDIR}"/${P}-test-fixes.patch #146592 "${FILESDIR}"/${P}-perl-5.26.patch "${FILESDIR}"/${P}-K-R-decls-clang.patch + "${FILESDIR}"/${P}-Clang-16-fixes-for-various-tests.patch ) src_configure() { diff --git a/sys-devel/autoconf/files/autoconf-2.13-Clang-16-fixes-for-various-tests.patch b/sys-devel/autoconf/files/autoconf-2.13-Clang-16-fixes-for-various-tests.patch new file mode 100644 index 000000000000..b9319f0a4b71 --- /dev/null +++ b/sys-devel/autoconf/files/autoconf-2.13-Clang-16-fixes-for-various-tests.patch @@ -0,0 +1,243 @@ +From de47e22d9b4f5fd5f1c9b9de798218a46ef94b98 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Thu, 3 Nov 2022 01:19:39 +0000 +Subject: [PATCH] Clang 16 fixes for various tests + +Fixes -Wimplicit-int and -Wimplicit-function-declaration +issues in various built-in tests. + +Noticed when building XEmacs 21.4 (thanks to matsl for reporting). + +Signed-off-by: Sam James +--- a/acgeneral.m4 ++++ b/acgeneral.m4 +@@ -1988,6 +1988,7 @@ changequote([, ])dnl + AC_MSG_CHECKING(size of $1) + AC_CACHE_VAL(AC_CV_NAME, + [AC_TRY_RUN([#include ++#include + main(void) + { + FILE *f=fopen("conftestval", "w"); +--- a/acspecific.m4 ++++ b/acspecific.m4 +@@ -706,6 +706,7 @@ fi + if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + AC_TRY_RUN([#include ++#include + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') + #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) + #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +@@ -819,6 +820,7 @@ esac + + AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void, + [AC_TRY_RUN([#include ++#include + #include <$ac_header_dirent> + int closedir(...); int main(void) { exit(closedir(opendir(".")) != 0); }], + ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)]) +@@ -988,6 +990,7 @@ AC_DEFUN(AC_FUNC_CLOSEDIR_VOID, + [AC_REQUIRE([AC_HEADER_DIRENT])dnl + AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void, + [AC_TRY_RUN([#include ++#include + #include <$ac_header_dirent> + int closedir(...); int main(void) { exit(closedir(opendir(".")) != 0); }], + ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)]) +@@ -1038,6 +1041,7 @@ AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped, + #include + #include + #include ++#include + + /* This mess was copied from the GNU getpagesize.h. */ + #ifndef HAVE_GETPAGESIZE +@@ -1165,49 +1169,17 @@ AC_DEFUN(AC_FUNC_GETPGRP, + * + * Snarfed from Chet Ramey's bash pgrp.c test program + */ +-#include +-#include +- +-int pid; +-int pg1, pg2, pg3, pg4; +-int ng, np, s, child; ++#include + + int main(void) + { +- pid = getpid(); +- pg1 = getpgrp(0); +- pg2 = getpgrp(); +- pg3 = getpgrp(pid); +- pg4 = getpgrp(1); +- +- /* +- * If all of these values are the same, it's pretty sure that +- * we're on a system that ignores getpgrp's first argument. +- */ +- if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3) +- exit(0); +- +- child = fork(); +- if (child < 0) +- exit(1); +- else if (child == 0) { +- np = getpid(); +- /* +- * If this is Sys V, this will not work; pgrp will be +- * set to np because setpgrp just changes a pgrp to be +- * the same as the pid. +- */ +- setpgrp(np, pg1); +- ng = getpgrp(0); /* Same result for Sys V and BSD */ +- if (ng == pg1) { +- exit(1); +- } else { +- exit(0); +- } +- } else { +- wait(&s); +- exit(s>>8); +- } ++ /* XXX: Gentoo: This function used to check for ++ BSD vs POSIX getpgrp but the test fails to compile ++ on modern POSIX systems when not relying on implicit ++ function declarations. It has no value anyway on such ++ systems and it's been removed in newer autoconf. ++ */ ++ exit(0); + } + ], ac_cv_func_getpgrp_void=yes, ac_cv_func_getpgrp_void=no, + AC_MSG_ERROR(cannot check getpgrp if cross compiling)) +@@ -1220,9 +1192,7 @@ fi + AC_DEFUN(AC_FUNC_SETPGRP, + [AC_CACHE_CHECK(whether setpgrp takes no argument, ac_cv_func_setpgrp_void, + AC_TRY_RUN([ +-#ifdef HAVE_UNISTD_H +-#include +-#endif ++#include + + /* + * If this system has a BSD-style setpgrp, which takes arguments, exit +@@ -1230,10 +1200,13 @@ AC_TRY_RUN([ + */ + int main(void) + { +- if (setpgrp(1,1) == -1) +- exit(0); +- else +- exit(1); ++ /* XXX: Gentoo: This function used to check for ++ BSD vs POSIX gsetpgrp but the test fails to compile ++ on modern POSIX systems when not relying on implicit ++ function declarations. It has no value anyway on such ++ systems and it's been removed in newer autoconf. ++ */ ++ exit(1); + } + ], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes, + AC_MSG_ERROR(cannot check setpgrp if cross compiling)) +@@ -1255,9 +1228,11 @@ AC_DEFUN(AC_FUNC_VFORK, + AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H)) + AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works, + [AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */ ++#include + #include + #include + #include ++#include + #ifdef HAVE_UNISTD_H + #include + #endif +@@ -1270,7 +1245,7 @@ AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works, + but some compilers (e.g. gcc -O) don't grok . + Test for this by using a static variable whose address + is put into a register that is clobbered by the vfork. */ +-static ++static void + #ifdef __cplusplus + sparc_address_test (int arg) + #else +@@ -1359,6 +1334,7 @@ AC_DEFUN(AC_FUNC_WAIT3, + #include + #include + #include ++#include + /* HP-UX has wait3 but does not fill in rusage at all. */ + int main(void) { + struct rusage r; +@@ -1582,6 +1558,7 @@ AC_DEFUN(AC_FUNC_UTIME_NULL, + # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. + AC_TRY_RUN([#include + #include ++#include + int main(void) { + struct stat s, t; + exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 +@@ -1598,6 +1575,7 @@ fi + AC_DEFUN(AC_FUNC_STRCOLL, + [AC_CACHE_CHECK(for working strcoll, ac_cv_func_strcoll_works, + [AC_TRY_RUN([#include ++#include + int main (void) + { + exit (strcoll ("abc", "def") >= 0 || +@@ -1614,6 +1592,7 @@ AC_DEFUN(AC_FUNC_SETVBUF_REVERSED, + [AC_CACHE_CHECK(whether setvbuf arguments are reversed, + ac_cv_func_setvbuf_reversed, + [AC_TRY_RUN([#include ++#include + /* If setvbuf has the reversed format, exit 0. */ + int main (void) { + /* This call has the arguments reversed. +@@ -1646,7 +1625,8 @@ LIBS="-lintl $LIBS"])])]) + + AC_DEFUN(AC_FUNC_MEMCMP, + [AC_CACHE_CHECK(for 8-bit clean memcmp, ac_cv_func_memcmp_clean, +-[AC_TRY_RUN([ ++[AC_TRY_RUN([#include ++#include + int main(void) + { + char c0 = 0x40, c1 = 0x80, c2 = 0x81; +@@ -1805,6 +1785,7 @@ AC_TRY_RUN( + #if !defined(__STDC__) || __STDC__ != 1 + #define volatile + #endif ++#include + int main(void) { + volatile char c = 255; exit(c < 0); + }], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no) +@@ -1819,7 +1800,8 @@ AC_DEFUN(AC_C_LONG_DOUBLE, + [if test "$GCC" = yes; then + ac_cv_c_long_double=yes + else +-AC_TRY_RUN([int main(void) { ++AC_TRY_RUN([#include ++int main(void) { + /* The Stardent Vistra knows sizeof(long double), but does not support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ +@@ -1834,7 +1816,8 @@ fi + AC_DEFUN(AC_INT_16_BITS, + [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl + AC_MSG_CHECKING(whether int is 16 bits) +-AC_TRY_RUN([int main(void) { exit(sizeof(int) != 2); }], ++AC_TRY_RUN([#include ++int main(void) { exit(sizeof(int) != 2); }], + [AC_MSG_RESULT(yes) + AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no)) + ]) +@@ -1842,7 +1825,8 @@ AC_TRY_RUN([int main(void) { exit(sizeof(int) != 2); }], + AC_DEFUN(AC_LONG_64_BITS, + [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl + AC_MSG_CHECKING(whether long int is 64 bits) +-AC_TRY_RUN([int main(void) { exit(sizeof(long int) != 8); }], ++AC_TRY_RUN([#include ++int main(void) { exit(sizeof(long int) != 8); }], + [AC_MSG_RESULT(yes) + AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no)) + ])