diff options
author | Florian Ragwitz <rafl@debian.org> | 2010-07-24 10:59:06 +0200 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2010-09-02 17:55:30 +0200 |
commit | d5815d73a5d4b78427d78106b2315eaf66e67745 (patch) | |
tree | aed7098dd2cace4c328a395c38c39e44d0ac326c | |
parent | 69f857902b1b105d96448597da9c4bc9cd4e90a3 (diff) | |
download | perl-rafl/ld_export.tar.gz |
Only export the public symbols in shared libperlssmoke-me/ld_exportrafl/ld_export
Only works on ELF platforms, and does require a linker that understands
--version-script. That's probably GNU ld only.
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | Makefile.SH | 18 | ||||
-rw-r--r-- | Porting/bump-perl-version | 6 | ||||
-rw-r--r-- | makedef.pl | 28 |
4 files changed, 46 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore index adf8b97958..0ce9676ede 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,8 @@ bug*.pl *.gcda *.gcno +libperl.version + dll.base /ext/DynaLoader/dl_win32.xs splittree.pl diff --git a/Makefile.SH b/Makefile.SH index 5948f4dd1e..d932179c15 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -722,6 +722,22 @@ $(LIBPERL_NONSHR): $(obj) !NO!SUBS! ;; +*) + # ELF platforms with GNU linker + if [ "$bin_ELF" = 'define' -a "$gccversion" != '' ]; then + case "$useshrplib" in + define|true|[yY]*) + $spitshell >>$Makefile <<'!NO!SUBS!' +LIBPERLLDSCRIPT = libperl.version +SHRPLDFLAGS += -Wl,--version-script=$(LIBPERLLDSCRIPT) + +libperl.version: $(MINIPERL_EXE) makedef.pl config.sh $(SYM) $(SYMH) $(CONFIGPM) + $(MINIPERL) makedef.pl PLATFORM=gnuelf CC_FLAGS="$(OPTIMIZE)" > $@ + +!NO!SUBS! + ;; + esac + fi esac if test -s $Makefile_s ; then @@ -752,7 +768,7 @@ $(DTRACE_O): perldtrace.d ;; esac $spitshell >>$Makefile <<'!NO!SUBS!' -$(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT) +$(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT) $(LIBPERLLDSCRIPT) !NO!SUBS! case "$useshrplib" in true) diff --git a/Porting/bump-perl-version b/Porting/bump-perl-version index e478cf0e17..3a9f0522ba 100644 --- a/Porting/bump-perl-version +++ b/Porting/bump-perl-version @@ -105,6 +105,12 @@ my $old_decimal = sprintf "%d.%03d%03d", $oldx, $oldy, $oldz; # 5.011001 my @maps = ( [ + qr{\b (LIBPERL_) ([\d.]+) (\s+ \{)}x, + sub { $2, ($newy % 2) ? "$1$newx.$newy.$newz$3" : "$1$newx.$newy$3" }, + ($oldy % 2) ? "$oldx.$oldy.$oldz" : "$oldx.$oldy", + qr/makedef/, + ], + [ qr{^((?:api_)?version(?:=|\s+)'?) (\d+) ('?) (?!\.)}x, sub { $2, "$1$newy$3" }, $oldy, diff --git a/makedef.pl b/makedef.pl index 810a4c80ec..a2285f74ba 100644 --- a/makedef.pl +++ b/makedef.pl @@ -59,7 +59,7 @@ while (@ARGV) { } } -my @PLATFORM = qw(aix win32 wince os2 MacOS netware); +my @PLATFORM = qw(aix win32 wince os2 MacOS netware gnuelf); my %PLATFORM; @PLATFORM{@PLATFORM} = (); @@ -255,6 +255,10 @@ elsif ($PLATFORM eq 'netware') { output_symbol("perl_clone_host"); } } +elsif ($PLATFORM eq 'gnuelf') { + print "LIBPERL_5.13.3 {\n"; + print " global:\n"; +} my %skip; my %export; @@ -621,6 +625,11 @@ elsif ($PLATFORM eq 'netware') { PerlIO_perlio )]; } +elsif ($PLATFORM eq 'gnuelf') { + emit_symbols [qw( + boot_DynaLoader + )]; +} unless ($define{'DEBUGGING'}) { skip_symbols [qw( @@ -1226,15 +1235,14 @@ if ($define{'MULTIPLICITY'}) { my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); emit_symbols $glob; } - unless ($define{'USE_ITHREADS'}) { - # XXX needed for XS extensions that define PERL_CORE - emit_symbol("PL_curinterp"); - } - # XXX AIX seems to want the perlvars.h symbols, for some reason - if ($PLATFORM eq 'aix' or $PLATFORM eq 'os2') { # OS/2 needs PL_thr_key + if ($define{'USE_ITHREADS'}) { my $glob = readvar($perlvars_h); emit_symbols $glob; } + else { + # XXX needed for XS extensions that define PERL_CORE + emit_symbol("PL_curinterp"); + } } else { unless ($define{'PERL_GLOBAL_STRUCT'}) { @@ -1622,6 +1630,9 @@ if ($PLATFORM eq 'os2') { ; LAST_ORDINAL=$sym_ord EOP } +elsif ($PLATFORM eq 'gnuelf') { + print "\n local: *;\n};\n"; +} sub emit_symbol { my $symbol = shift; @@ -1670,6 +1681,9 @@ sub output_symbol { elsif ($PLATFORM eq 'netware') { print "\t$symbol,\n"; } + elsif ($PLATFORM eq 'gnuelf') { + print " $symbol;\n"; + } } 1; |