From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Nq2hDR4K+2prbBMAWB0awg (envelope-from ) for ; Mon, 16 Nov 2026 08:50:22 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pkZBaiVC; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=BTu+9/oS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pkZBaiVC; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=BTu+9/oS; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 26B871E091; Mon, 16 Nov 2026 08:50:22 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 22E591E023 for ; Mon, 16 Nov 2026 08:50:21 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A83C84BA23E6 for ; Mon, 16 Nov 2026 13:50:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A83C84BA23E6 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pkZBaiVC; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=BTu+9/oS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pkZBaiVC; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=BTu+9/oS Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 5D2CB4BA2E14 for ; Mon, 16 Nov 2026 13:49:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D2CB4BA2E14 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5D2CB4BA2E14 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794836973; cv=none; b=CABpfuJWipHn97c71+Wx66KN2PV2TDAV9LhOGASsedAdDSLs3ej4uwPP3Wpc2MIcJkafO7jKWBXXftKkzhT23xKvHuhpT0FDnzwmn7F22guyzq6mB6cCCd8/hl4xFCHjEPjBgYfQX9tUKK6deWYUvbuTPm+GUX6Es+5hiSj69MA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794836973; c=relaxed/simple; bh=dxZeEfALHmGD+K0x5UZMU3Rqy4TLjkpJombUTNYnxd0=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=uAdwU+eRUrBClUHhMMEMr4Zekzjsz6UK1x7ufas/K9p64b/nqSO4oRUBIXYyUizdzPwOKkRGGXOWJbvKa882cIC3KyRYL0tR3TnFjTjT//vfV3YXhMy8+wQrAsM0Qqeccbp8FA+MF1FW9zYGncN8ut/lxUJbmWYGMAictB7TXn4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pkZBaiVC; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=BTu+9/oS; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pkZBaiVC; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=BTu+9/oS DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D2CB4BA2E14 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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-out1.suse.de (Postfix) with ESMTPS id 4B90621BD4 for ; Mon, 16 Nov 2026 13:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1794836972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PFzG3etmS/hA2+tQ4L4ncI4VwcuNMhDF0LrrfoSYM3k=; b=pkZBaiVCiit4aUEdCOeHZjbIWxj5QP/s92j88Qd/bNrWmWcxpoZzUZ30IQGe3ora3wksA8 5x0GhAeHWK4ECUhWwpsZDrVDx+4SmSVYUVKqTEuM1pQycqOR7cjeIlBj3ENCf6xqfZt/0Y NMDNBx8t50qyIpIQAFHSdzkORW13Azw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1794836972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PFzG3etmS/hA2+tQ4L4ncI4VwcuNMhDF0LrrfoSYM3k=; b=BTu+9/oSzSCXQzTOFkr0hMFeNvQfL8j7btZ0qcxzyRT1D3w8J5Qu1tmj2baWeOPQ7UQuUE GI9lke5+fgW+CuBA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1794836972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PFzG3etmS/hA2+tQ4L4ncI4VwcuNMhDF0LrrfoSYM3k=; b=pkZBaiVCiit4aUEdCOeHZjbIWxj5QP/s92j88Qd/bNrWmWcxpoZzUZ30IQGe3ora3wksA8 5x0GhAeHWK4ECUhWwpsZDrVDx+4SmSVYUVKqTEuM1pQycqOR7cjeIlBj3ENCf6xqfZt/0Y NMDNBx8t50qyIpIQAFHSdzkORW13Azw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1794836972; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PFzG3etmS/hA2+tQ4L4ncI4VwcuNMhDF0LrrfoSYM3k=; b=BTu+9/oSzSCXQzTOFkr0hMFeNvQfL8j7btZ0qcxzyRT1D3w8J5Qu1tmj2baWeOPQ7UQuUE GI9lke5+fgW+CuBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 17E331334C for ; Mon, 16 Nov 2026 13:49:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id CCbTMusJ+2pMPgAAD6G6ig (envelope-from ) for ; Mon, 16 Nov 2026 13:49:31 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gnulib] Force HAVE_FNMATCH=1 Date: Mon, 16 Nov 2026 14:49:31 +0100 Message-ID: <20261116134931.2120338-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-11.80 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org I ran "maint selftest" on msys2-ucrt64, and ran into the same failure in skip_gfile_matching as fixed for macOS in commit 2e7f60647f1 ("[gdb/build] Use gnulib fnmatch"): libiberty's fnmatch is used instead of gnulib's version. This is not a regression, the test failed before the commit as well. But the reason it fails is slightly different. Before the commit, libiberty's fnmatch.h was included, and libiberty's fnmatch was used. After the commit, gnulib's fnmatch.h is used, but still libiberty's fnmatch is used. This happens because gnulib doesn't use the rpl_ prefix, which would have forced the use of gnulib regardless of link order. Without the rpl_ prefix, it comes down to link order, and libiberty wins out there. The reason why gnulib doesn't use the rpl_ prefix, is that while it's being built, no system fnmatch is detected that needs overriding. I tried out if I could fix this by changing the link order. I managed to get this working by moving LIBSUPPORT and LIBGNU to the start of CLIBS: ... CLIBS = $(LIBSUPPORT) $(LIBGNU) ... ... I like this fix because it clearly gives precedence to gnulib. But changing linking order is notoriously fragile, so instead I'm proposing a minimal fix. Fix this by making the gnulib build aware of libiberty's fnmatch, by initializing autoconf variable ac_cv_func_fnmatch to yes. Tested on x86_64-linux, aarch64-macos and msys2-ucrt64 by rebuilding and running the selftests. --- gnulib/configure | 30 ++++++++++++++++++------------ gnulib/configure.ac | 6 ++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/gnulib/configure b/gnulib/configure index de2f5c4cec1..caf934607de 100755 --- a/gnulib/configure +++ b/gnulib/configure @@ -4105,6 +4105,12 @@ fi +# Gnulib is built in isolation, but in practice it's always used in +# combination with libiberty, which does contain an fnmatch. Let gnulib know +# this. This ensures that if gnulib provides a copy, it will name it +# rpl_fnmatch, avoiding name clashes with the version from libiberty. +: ${ac_cv_func_fnmatch=yes} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13811,8 +13817,8 @@ rm -f core conftest.err conftest.$ac_objext \ LIBS=$save_LIBS test $gl_pthread_api = yes && break done - echo "$as_me:13814: gl_pthread_api=$gl_pthread_api" >&5 - echo "$as_me:13815: LIBPTHREAD=$LIBPTHREAD" >&5 + echo "$as_me:13820: gl_pthread_api=$gl_pthread_api" >&5 + echo "$as_me:13821: LIBPTHREAD=$LIBPTHREAD" >&5 gl_pthread_in_glibc=no # On Linux with glibc >= 2.34, libc contains the fully functional @@ -13837,7 +13843,7 @@ rm -f conftest* ;; esac - echo "$as_me:13840: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 + echo "$as_me:13846: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) @@ -13991,7 +13997,7 @@ fi fi fi - echo "$as_me:13994: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 + echo "$as_me:14000: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 $as_echo_n "checking whether POSIX threads API is available... " >&6; } @@ -17068,8 +17074,8 @@ rm -f core conftest.err conftest.$ac_objext \ LIBS=$save_LIBS test $gl_pthread_api = yes && break done - echo "$as_me:17071: gl_pthread_api=$gl_pthread_api" >&5 - echo "$as_me:17072: LIBPTHREAD=$LIBPTHREAD" >&5 + echo "$as_me:17077: gl_pthread_api=$gl_pthread_api" >&5 + echo "$as_me:17078: LIBPTHREAD=$LIBPTHREAD" >&5 gl_pthread_in_glibc=no # On Linux with glibc >= 2.34, libc contains the fully functional @@ -17094,7 +17100,7 @@ rm -f conftest* ;; esac - echo "$as_me:17097: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 + echo "$as_me:17103: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) @@ -17248,7 +17254,7 @@ fi fi fi - echo "$as_me:17251: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 + echo "$as_me:17257: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 $as_echo_n "checking whether POSIX threads API is available... " >&6; } @@ -17474,8 +17480,8 @@ rm -f core conftest.err conftest.$ac_objext \ LIBS=$save_LIBS test $gl_pthread_api = yes && break done - echo "$as_me:17477: gl_pthread_api=$gl_pthread_api" >&5 - echo "$as_me:17478: LIBPTHREAD=$LIBPTHREAD" >&5 + echo "$as_me:17483: gl_pthread_api=$gl_pthread_api" >&5 + echo "$as_me:17484: LIBPTHREAD=$LIBPTHREAD" >&5 gl_pthread_in_glibc=no # On Linux with glibc >= 2.34, libc contains the fully functional @@ -17500,7 +17506,7 @@ rm -f conftest* ;; esac - echo "$as_me:17503: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 + echo "$as_me:17509: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) @@ -17654,7 +17660,7 @@ fi fi fi - echo "$as_me:17657: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 + echo "$as_me:17663: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 $as_echo_n "checking whether POSIX threads API is available... " >&6; } diff --git a/gnulib/configure.ac b/gnulib/configure.ac index 0675e0c850a..dceac194e5e 100644 --- a/gnulib/configure.ac +++ b/gnulib/configure.ac @@ -25,6 +25,12 @@ AC_CONFIG_MACRO_DIRS([import/m4]) AC_CONFIG_MACRO_DIRS([../config]) AM_MAINTAINER_MODE +# Gnulib is built in isolation, but in practice it's always used in +# combination with libiberty, which does contain an fnmatch. Let gnulib know +# this. This ensures that if gnulib provides a copy, it will name it +# rpl_fnmatch, avoiding name clashes with the version from libiberty. +: ${ac_cv_func_fnmatch=yes} + AC_PROG_CC AC_USE_SYSTEM_EXTENSIONS # Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included base-commit: 5678a7bfceb3a6ea18bcde1ae68f7e96c43c998b -- 2.51.0