diff options
author | Joseph Myers <joseph@codesourcery.com> | 2018-08-31 21:19:51 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2018-08-31 21:19:51 +0000 |
commit | 2bbd06bcee5fe62896d71f78c6c2b6d0f3a23467 (patch) | |
tree | 4c28e38e786a26898976945861a014d591a94b2a /conform/list-header-symbols.pl | |
parent | 81b9d87bae23efc42e2121ac066fe38fceb96124 (diff) | |
download | glibc-2bbd06bcee5fe62896d71f78c6c2b6d0f3a23467.tar glibc-2bbd06bcee5fe62896d71f78c6c2b6d0f3a23467.tar.gz glibc-2bbd06bcee5fe62896d71f78c6c2b6d0f3a23467.tar.bz2 glibc-2bbd06bcee5fe62896d71f78c6c2b6d0f3a23467.zip |
Replace conform/list-header-symbols.pl with a Python script.
Continuing the move of test code from Perl to Python (which seems
uncontroversial, unlike dependencies on Python in the actual build of
glibc), this patch replaces conform/list-header-symbols.pl with a
Python script, as a first step in converting the conform/ tests.
(conform/glibcconform.py is an equivalent to GlibcConform.pm,
containing code that will be relevant to move than one of the conform/
scripts.)
Tested for x86_64, including verifying that the symbol lists generated
are identical to those generated by the Perl version.
* conform/glibcconform.py: New file.
* conform/list-header-symbols.py: Likewise.
* conform/list-header-symbols.pl: Remove.
* conform/Makefile (tests-special): Only add linknamespace tests
if [PYTHON].
($(linknamespace-symlists-tests)): Use list-header-symbols.py.
Diffstat (limited to 'conform/list-header-symbols.pl')
-rw-r--r-- | conform/list-header-symbols.pl | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/conform/list-header-symbols.pl b/conform/list-header-symbols.pl deleted file mode 100644 index 0db61bfe86..0000000000 --- a/conform/list-header-symbols.pl +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/perl - -# Print a list of symbols exported by some headers that would -# otherwise be in the user's namespace. - -# Copyright (C) 2014-2018 Free Software Foundation, Inc. -# This file is part of the GNU C Library. - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, see -# <http://www.gnu.org/licenses/>. - -use GlibcConform; -use Getopt::Long; - -GetOptions ('headers=s' => \$headers, 'standard=s' => \$standard, - 'flags=s' => \$flags, 'cc=s' => \$CC, 'tmpdir=s' => \$tmpdir); -@headers = split (/\s+/, $headers); - -# Extra symbols possibly not found through -aux-info but still -# reserved by the standard: either data symbols, or symbols where the -# standard leaves unspecified whether the identifier is a macro or -# defined with external linkage. -$extra_syms{"ISO"} = ["errno", "setjmp", "va_end"]; -$extra_syms{"ISO99"} = ["errno", "math_errhandling", "setjmp", "va_end"]; -# stdatomic.h not yet covered by conformance tests; as per DR#419, all -# the generic functions there or may not be defined with external -# linkage (but are reserved in any case). -$extra_syms{"ISO11"} = ["errno", "math_errhandling", "setjmp", "va_end"]; -# The following lists may not be exhaustive. -$extra_syms{"POSIX"} = ["errno", "setjmp", "va_end", "environ", "sigsetjmp", - "optarg", "optind", "opterr", "optopt", "tzname"]; -$extra_syms{"XPG4"} = ["errno", "setjmp", "va_end", "environ", "signgam", - "loc1", "loc2", "locs", "sigsetjmp", "optarg", - "optind", "opterr", "optopt", "daylight", "timezone", - "tzname"]; -$extra_syms{"XPG42"} = ["errno", "setjmp", "va_end", "environ", "signgam", - "loc1", "loc2", "locs", "sigsetjmp", "optarg", - "optind", "opterr", "optopt", "daylight", "timezone", - "tzname", "getdate_err", "h_errno"]; -$extra_syms{"UNIX98"} = ["errno", "setjmp", "va_end", "environ", "signgam", - "loc1", "loc2", "locs", "sigsetjmp", "optarg", - "optind", "opterr", "optopt", "daylight", "timezone", - "tzname", "getdate_err", "h_errno"]; -$extra_syms{"XOPEN2K"} = ["errno", "setjmp", "va_end", "environ", "signgam", - "sigsetjmp", "optarg", "optind", "opterr", "optopt", - "daylight", "timezone", "tzname", "getdate_err", - "h_errno", "in6addr_any", "in6addr_loopback"]; -$extra_syms{"XOPEN2K8"} = ["errno", "setjmp", "va_end", "environ", "signgam", - "sigsetjmp", "optarg", "optind", "opterr", "optopt", - "daylight", "timezone", "tzname", "getdate_err", - "in6addr_any", "in6addr_loopback"]; -$extra_syms{"POSIX2008"} = ["errno", "setjmp", "va_end", "environ", - "sigsetjmp", "optarg", "optind", "opterr", "optopt", - "tzname", "in6addr_any", "in6addr_loopback"]; - -%user_syms = (); - -foreach my $header (@headers) { - @syms = list_exported_functions ("$CC $flags", $standard, $header, $tmpdir); - foreach my $sym (@syms) { - if ($sym !~ /^_/) { - $user_syms{$sym} = 1; - } - } -} -foreach my $sym (@{$extra_syms{$standard}}) { - $user_syms{$sym} = 1; -} - -foreach my $sym (sort keys %user_syms) { - print "$sym\n"; -} |