]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add support for '?' in linker script globs
authorJonathan Wakely <jwakely@redhat.com>
Mon, 13 Dec 2021 13:09:57 +0000 (13:09 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 13 Dec 2021 13:14:51 +0000 (13:14 +0000)
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.

libstdc++-v3/scripts/make_exports.pl

index 93100e17ddfc713508e0145dfe883703ce01e236..7f4670f8a91234c711341883158a51112ad29dbc 100644 (file)
@@ -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;
     }