Dpkg::Vendor::Debian: Move time64 buildflags feature from future to abi
[dpkg.git] / scripts / t / Dpkg_Shlibs / spacesyms-c-gen.pl
blob48434f45d75e0e87081d771e342679d1aa4be2dc
1 #!/usr/bin/perl
3 # spacesyms-c-gen.pl
5 # Output a C file that contains symbols matching the shell glob
6 # sym{defaultver,longver,shortver}{nospace,SPACE}{default,hidden,protected,internal}
7 # with symbol visibility matching the final element and at least one relocation
8 # against each symbol.
10 # When used together with spacesyms-o-map.pl and spacesyms.map, makes a shared
11 # object that contains symbols that covers all cases of:
13 # 1) has a short, long or Base version,
14 # 2) has or does not have a space in the symbol name,
15 # 3) default, hidden, protected or internal visibility.
17 use strict;
18 use warnings;
20 my @symbols;
22 foreach my $version (qw(defaultver longver shortver)) {
23 foreach my $space (qw(nospace SPACE)) {
24 foreach my $visibility (qw(default hidden protected internal)) {
25 my $symbol = "sym$version$space$visibility";
26 push @symbols, $symbol;
27 print "void $symbol(void) __attribute__((visibility(\"$visibility\")));\n";
28 print "void $symbol(void) {}\n";
33 print "void (*funcs[])(void) = {\n";
34 foreach my $symbol (@symbols) {
35 print "$symbol,\n";
37 print "};\n";