public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-5927] libstdc++: Add support for '?' in linker script globs
Date: Mon, 13 Dec 2021 13:16:21 +0000 (GMT)	[thread overview]
Message-ID: <20211213131621.972233858409@sourceware.org> (raw)

https://gcc.gnu.org/g:7bf710b5116e6186204edd6a0168202fd8ef0389

commit r12-5927-g7bf710b5116e6186204edd6a0168202fd8ef0389
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Dec 13 13:09:57 2021 +0000

    libstdc++: Add support for '?' in linker script globs
    
    The scripts/make_exports.pl script used for darwin only replaces '*'
    wildcards in globs, it doesn't handle '?'. This means the recent changes
    to std::__timepunct exports broke darwin.
    
    Rather than use mangled names in the linker script, this adds support
    for '?' to the perl script.
    
    This also removes some unnecessary escaping of the replacement strings
    in s// substitutions.
    
    libstdc++-v3/ChangeLog:
    
            * scripts/make_exports.pl: Replace '?' with '.' when turning
            a glob into a regex.

Diff:
---
 libstdc++-v3/scripts/make_exports.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/scripts/make_exports.pl b/libstdc++-v3/scripts/make_exports.pl
index 93100e17ddf..7f4670f8a91 100644
--- a/libstdc++-v3/scripts/make_exports.pl
+++ b/libstdc++-v3/scripts/make_exports.pl
@@ -52,11 +52,13 @@ while (<F>) {
 	next;
     }
     # Catch globs.  Note that '{}' is not allowed in globs by this script,
-    # so only '*' and '[]' are available.
+    # so only '*' and '?' and '[]' are available.
     if (/^[ \t]*([^ \t;{}#]+);?[ \t]*$/) {
 	my $ptn = $1;
 	# Turn the glob into a regex by replacing '*' with '.*'.
-	$ptn =~ s/\*/\.\*/g;
+	$ptn =~ s/\*/.*/g;
+	# And replacing '?' with '.'.
+	$ptn =~ s/\?/./g;
 	push @$glob,$ptn;
 	next;
     }


                 reply	other threads:[~2021-12-13 13:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211213131621.972233858409@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).