From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Abd6KbLTAmtTUywAWB0awg (envelope-from ) for ; Sun, 22 Nov 2026 06:36:18 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NBlyPAj0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 992781E09B; Sun, 22 Nov 2026 06:36:18 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 [IPv6:2620:52:6:3111::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 A5A321E09B for ; Sun, 22 Nov 2026 06:36:17 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 44A1550E1D63 for ; Sun, 22 Nov 2026 11:36:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44A1550E1D63 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NBlyPAj0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id D2C6D4847AB0 for ; Sun, 22 Nov 2026 11:35:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2C6D4847AB0 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D2C6D4847AB0 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795347349; cv=none; b=gSt13T+i13ReP0OpFWkr1IcbrH0Y1+zaHrzWiuRPxugw45frE03TzoUsRckPWMDiRDFFuTIK61SLEEKjR7jC2L0iOjPevD3XNB7dOpUtAuiGmpB/rjQh+lL6+0mcLJwMitSDHN2YwxIQMOR3ztbua8LU6RVBCqOoVJ2OY6Wng+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795347349; c=relaxed/simple; bh=YDFXYBmhoTN8ErD1UZcF1jGOdNtsjidCJX06VlwVEc4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uqMaXl5K2NOCGJLMraZcCanHgAIJV3zKIyWSwUoJMUSc5i3tPqmrphpjuBYutj3M97aSyntoUQAJtjj2WgO6arn6q/iyYQd+TQpl8dYRM3v787Rm/fToWuWitUmSE+2wKjyfT53uip1kxFL95cM/HpoQ8uyKIX4T4Uyjski37zs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NBlyPAj0 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2C6D4847AB0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795347349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2an+LrP2tpGMsCZkkvks80OoAW6WWx5UsZ+WvTVVR1s=; b=NBlyPAj0NI3mj6+lGZi0eztQlas9UzgfdJXwyoukPZ7OHFVN63e1yE4C8goTgDSz3gV/d0 7b2oAe+Fd7DNlkJiIiP0ltTxNzBNu0JccfthZlzLl4GHIKoMRE8tXKukxnmQYl24REHH4x nVjpb+ub6it3gN0ZajysheqM6ck8sBY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-295--rTHasnGMdOQl2MKi1tAjQ-1; Sun, 22 Nov 2026 11:35:47 +0000 X-MC-Unique: -rTHasnGMdOQl2MKi1tAjQ-1 X-Mimecast-MFC-AGG-ID: -rTHasnGMdOQl2MKi1tAjQ_1795347346 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4ba078f26f4so16006505e9.2 for ; Sun, 22 Nov 2026 03:35:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795347346; x=1795952146; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2an+LrP2tpGMsCZkkvks80OoAW6WWx5UsZ+WvTVVR1s=; b=wkwPZA7xO8zY7b9uMY+H6FVmCUAVg2nNi6NuqQttVf7FeW9v0VFbk1ogxYyQz5F4az Gv88vAofA341gUeBKBOz6stPUj9iyi+5vshK5zmkw6jbJ33sr81Ua/XyY+HMlC/Ta1B1 S0WjkfUHP+kT+qoyniUTkxrccVbJzc4SHA4Wjs2hs539hZEsuBi/1l8D0AzIJyZwax3W 8staDF3gXJ94JkfMgBAB62c4Ba2lqv6U/JNy4qVe3NciGyLDb6WyijSAuWEr0VmC44u5 MA/o7gNDlEggU40vsr70qmrEw/tiCNtDsP9FqHP7TvX+oF5hBOPe9Xb2pXS8Va+ttB0Y +jOA== X-Forwarded-Encrypted: i=1; AL+hErFih/Bqc3ALzFsEFPq9qlNUAEXo5Q91hd3Bwy3HzvkOgsPTcDvMYtdfTuQ4eMyREMWe3v9xIb0VwyY6lQ==@sourceware.org X-Gm-Message-State: APuU4Z+Q+w2BvIrzGG7PZD079abpdBpSQfIcMUpopCJdkhTeyXcUchaA U2pHJKemFCVslGrwGmWb8ti1a2aLOi58pXcfX00OriOHgHV5lDNrHBZ+DZtU0UNzvbXoHDi+Cmf QmyU3kvQcEJYCPA+5FC4W4V5nhbnfA/c80WII8OnQgh2jTicaQ562EhRKZ/bR15g= X-Gm-Gg: AZFdTZd/uCO1Q1oy3WFSYNBFrn8c2AYExVRh9nYgK672kam6nIawhLBtrZv3503dBB7 M2EK+q9w7vYULA5vm7XzWtmRcwXTPuRDN7oVJPt8mAIXaVzd4rMmTYk4eSpPiivyTZNRxuJzpwk RRHqCVp7sJ7bnUTwMT4VACSfZDDu7Mw5aFYz8qagGKtF19Qs1Od6BFhZmOx0lhQie/Y1lupaOm6 6thYviq4jMrH5B+BLv5ddfYsIXetcadzJX23Iu+wOCbXCUE514KXEJP9GSHiHjTS6TaKnPYDYJB JSTZSnFI3v7uAT7fS6D9qafK1lZqJ0ZUTspEWdPaktAa8eEi189Xw6R+vfZUS0WOG8Aynn3pPtF 3+m5SqthiOzvpvU10AUCsX+1DMGA4b0gRJHjJG3GtVnFyIw== X-Received: by 2002:a05:600c:3b88:b0:4a2:191f:7cbd with SMTP id 5b1f17b1804b1-4bb888078a8mr204485105e9.11.1795347346155; Sun, 22 Nov 2026 03:35:46 -0800 (PST) X-Received: by 2002:a05:600c:3b88:b0:4a2:191f:7cbd with SMTP id 5b1f17b1804b1-4bb888078a8mr204484565e9.11.1795347345670; Sun, 22 Nov 2026 03:35:45 -0800 (PST) Received: from localhost ([83.216.138.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb9066e34esm119132025e9.3.2026.11.22.03.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2026 03:35:44 -0800 (PST) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH] [gnulib] Force HAVE_FNMATCH=1 In-Reply-To: <20261116134931.2120338-1-tdevries@suse.de> References: <20261116134931.2120338-1-tdevries@suse.de> Date: Sun, 22 Nov 2026 11:35:42 +0000 Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: HHGZ5l9cruye-wFIJpbTuUfb5CSpO2UNEC6DdNaCVEw_1795347346 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Tom de Vries writes: > 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. This seems reasonable proposal to me. Approved-By: Andrew Burgess Thanks, Andrew > --- > 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