From: Jarkko Hietaniemi Date: Wed, 14 Jul 1999 21:59:11 +0000 (+0000) Subject: Fixed AIX dynamic loading and AIX shared Perl library. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=549a6b102c2ac8c43e32b815191190bc29aef348;p=p5sagit%2Fp5-mst-13.2.git Fixed AIX dynamic loading and AIX shared Perl library. Tested in: AIX 4.1.5 cc+useshrplib+usethreads, 4.1.5 cc, 4.1.5 gcc+useshrplib+usethreads, 4.3.1 cc+useshrplib. Hijacked win32/makedef.pl for more general purpose export list building, now it is used (as toplevel makedef.pl) for win32 and AIX (perl_exp.SH made unnecessary). Because the export lists are now correct in AIX, no more linker warnings about "Exported symbol not defined" should appear. p4raw-id: //depot/cfgperl@3673 --- diff --git a/MANIFEST b/MANIFEST index 023b51f..1063670 100644 --- a/MANIFEST +++ b/MANIFEST @@ -859,6 +859,7 @@ lib/validate.pl Perl library supporting wholesale file mode validation lib/vars.pm Declare pseudo-imported global variables lib/warning.pm For "use warning" makeaperl.SH perl script that produces a new perl binary +makedef.pl Create symbol export lists for linking makedepend.SH Precursor to makedepend makedir.SH Precursor to makedir malloc.c A version of malloc you might not want @@ -931,7 +932,6 @@ perl.c main() perl.h Global declarations perlapi.c Perl API functions perlapi.h Perl API function declarations -perl_exp.SH Creates list of exported symbols for AIX perlio.c C code for PerlIO abstraction perlio.h compatibility stub perlio.sym Symbols for PerlIO abstraction @@ -1419,7 +1419,6 @@ win32/include/arpa/inet.h Win32 port win32/include/dirent.h Win32 port win32/include/netdb.h Win32 port win32/include/sys/socket.h Win32 port -win32/makedef.pl Win32 exports definition file writer win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds) win32/perlglob.c Win32 port win32/perllib.c Win32 port diff --git a/Makefile.SH b/Makefile.SH index 2e35bda..af2703d 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -61,15 +61,13 @@ true) aix*) shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp" case "$osvers" in - 3*) - shrpldflags="$shrpldflags -e _nostart $ldflags $libs $cryptlib" + 3*) shrpldflags="$shrpldflags -e _nostart" ;; - *) - shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib" + *) shrpldflags="$shrpldflags -b noentry" ;; esac - aixinstdir=`pwd | sed 's/\/UU$//'` - linklibperl="-L $archlibexp/CORE -L $aixinstdir -lperl" + shrpldflags="$shrpldflags $ldflags $libs $cryptlib" + linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl" ldlibpth="LIBPATH=`pwd`:${LIBPATH}" ;; hpux*) @@ -205,10 +203,10 @@ private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm # Files to be built with variable substitution before miniperl # is available. sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \ - makedir.SH myconfig.SH perl_exp.SH writemain.SH + makedir.SH myconfig.SH writemain.SH shextract = Makefile cflags config.h makeaperl makedepend \ - makedir myconfig perl.exp writemain + makedir myconfig writemain # Files to be built with variable substitution after miniperl is # available. Dependencies handled manually below (for now). @@ -309,6 +307,51 @@ cygwin*) ;; esac +case "$osname" in +aix) + $spitshell >>Makefile <>Makefile <<'!NO!SUBS!' + +LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT) +MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT) + +$(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj) + $(RMS) $(LIBPERL_NONSHR) + $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj) + +$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) + $(CC) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS) + +MINIPERLEXP = $(MINIPERL_NONSHR) + +LIBPERLEXPORT = perl.exp + +!NO!SUBS! + + ;; + *) + $spitshell >>Makefile <<'!NO!SUBS!' +MINIPERLEXP = miniperl$(EXE_EXT) + +PERLEXPORT = perl.exp + +!NO!SUBS! + ;; + esac + $spitshell >>Makefile <<'!NO!SUBS!' +perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) + ./$(MINIPERLEXP) makedef.pl PLATFORM=aix | sort -u | sort -f > perl.exp.tmp + sh mv-if-diff perl.exp.tmp perl.exp + +!NO!SUBS! + ;; +esac + if test -r $Makefile_s ; then . $Makefile_s $spitshell >>Makefile <>Makefile <<'!NO!SUBS!' -$(LIBPERL): $& perl$(OBJ_EXT) $(obj) +$(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT) !NO!SUBS! case "$useshrplib" in true) @@ -358,16 +401,16 @@ miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs) $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest -perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs +perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) -pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs +pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) -purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs +purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) -quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs +quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) # This version, if specified in Configure, does ONLY those scripts which need @@ -375,7 +418,7 @@ quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs # checks as well as the special code to validate that the script in question # has been invoked correctly. -suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs +suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) !NO!SUBS! @@ -562,7 +605,7 @@ _cleaner: -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ $(LDLIBPTH) sh ext/util/make_ext realclean $$x MAKE=$(MAKE) ; \ done - rm -f *.orig */*.orig *~ */*~ core core.perl.*.? core.miniperl.*.? perl.core miniperl.core t/core t/core.perl.*.? t/perl.core t/tmp???? t/c t/perl so_locations t/nonexistent1 + rm -f *.orig */*.orig *~ */*~ core core.perl.*.? core.miniperl.*.? perl.core miniperl.core t/core t/core.perl.*.? t/perl.core t/tmp???? t/c t/perl so_locations t/nonexistent1 so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) rm -rf $(addedbyconf) rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old rm -f $(private) @@ -593,10 +636,6 @@ $(FIRSTMAKEFILE): README $(MAKEDEPEND) config.h: config_h.SH config.sh $(SHELL) config_h.SH -# This is an AIXism. -perl.exp: perl_exp.SH config.sh $(SYM) $(SYMH) - $(SHELL) perl_exp.SH - # When done, touch perlmain.c so that it doesn't get remade each time. depend: makedepend sh ./makedepend MAKE=$(MAKE) diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index cf7d708..96c9962 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -191,7 +191,7 @@ sub bootstrap { # it executed. my $libref = dl_load_file($file, $module->dl_load_flags) or - croak("Can't load '$file' for module $module: ".dl_error()."\n"); + croak("Can't load '$file' for module $module: ".dl_error()); push(@dl_librefs,$libref); # record loaded object diff --git a/ext/DynaLoader/dl_aix.xs b/ext/DynaLoader/dl_aix.xs index 78e4343..877b285 100644 --- a/ext/DynaLoader/dl_aix.xs +++ b/ext/DynaLoader/dl_aix.xs @@ -77,14 +77,14 @@ typedef struct Module { * We keep a list of all loaded modules to be able to call the fini * handlers at atexit() time. */ -static ModulePtr modList; /* XXX threadead */ +static ModulePtr modList; /* XXX threaded */ /* * The last error from one of the dl* routines is kept in static * variables here. Each error is returned only once to the caller. */ -static char errbuf[BUFSIZ]; /* XXX threadead */ -static int errvalid; /* XXX threadead */ +static char errbuf[BUFSIZ]; /* XXX threaded */ +static int errvalid; /* XXX threaded */ static void caterr(char *); static int readExports(ModulePtr); @@ -103,7 +103,7 @@ char *strerrorcat(char *str, int err) { if (buf == 0) return 0; - if (strerror_r(err, buf, sizeof(buf)) == 0) + if (strerror_r(err, buf, BUFSIZ) == 0) msg = buf; else msg = strerror_r_failed; @@ -131,7 +131,7 @@ char *strerrorcpy(char *str, int err) { if (buf == 0) return 0; - if (strerror_r(err, buf, sizeof(buf)) == 0) + if (strerror_r(err, buf, BUFSIZ) == 0) msg = buf; else msg = strerror_r_failed; @@ -155,7 +155,7 @@ void *dlopen(char *path, int mode) { dTHX; register ModulePtr mp; - static int inited; /* XXX threadead */ + static int inited; /* XXX threaded */ /* * Upon the first call register a terminate handler that will @@ -188,11 +188,19 @@ void *dlopen(char *path, int mode) safefree(mp); return NULL; } + /* * load should be declared load(const char *...). Thus we * cast the path to a normal char *. Ugly. */ - if ((mp->entry = (void *)load((char *)path, L_NOAUTODEFER, NULL)) == NULL) { + if ((mp->entry = (void *)load((char *)path, +#ifdef L_LIBPATH_EXEC + L_LIBPATH_EXEC | +#endif + L_NOAUTODEFER, + NULL)) == NULL) { + int saverrno = errno; + safefree(mp->name); safefree(mp); errvalid++; @@ -204,17 +212,17 @@ void *dlopen(char *path, int mode) * can be further described by querying the loader about * the last error. */ - if (errno == ENOEXEC) { - char *tmp[BUFSIZ/sizeof(char *)]; - if (loadquery(L_GETMESSAGES, tmp, sizeof(tmp)) == -1) - strerrorcpy(errbuf, errno); + if (saverrno == ENOEXEC) { + char *moreinfo[BUFSIZ/sizeof(char *)]; + if (loadquery(L_GETMESSAGES, moreinfo, sizeof(moreinfo)) == -1) + strerrorcpy(errbuf, saverrno); else { char **p; - for (p = tmp; *p; p++) + for (p = moreinfo; *p; p++) caterr(*p); } } else - strerrorcat(errbuf, errno); + strerrorcat(errbuf, saverrno); return NULL; } mp->refCnt = 1; @@ -226,10 +234,12 @@ void *dlopen(char *path, int mode) * of the perl core are in the same shared object. */ if (loadbind(0, (void *)dlopen, mp->entry) == -1) { + int saverrno = errno; + dlclose(mp); errvalid++; strcpy(errbuf, "loadbind: "); - strerrorcat(errbuf, errno); + strerrorcat(errbuf, saverrno); return NULL; } if (readExports(mp) == -1) { diff --git a/hints/aix.sh b/hints/aix.sh index e24874b..b6978dc 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -61,7 +61,7 @@ case "$osvers" in esac so="a" -dlext="so" +dlext="o" # Trying to set this breaks the POSIX.c compilation @@ -128,6 +128,13 @@ $define|true|[yY]*) # (e.g. pragma/overload core dumps) # --jhi@iki.fi cc=cc_r + if test ! -e /bin/cc_r; then + cat >&4 <&4 <) + { + if (/^(?:ccflags|optimize)='(.+)'$/) { + $_ = $1; + $define{$1} = 1 while /-D(\w+)/g; + } + } + close(CFG); +} + +open(CFG,$config_h) || die "Cannot open $config_h: $!\n"; while () { $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/; + $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/; $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/; } close(CFG); -warn join(' ',keys %define)."\n"; - -if ($define{PERL_OBJECT}) { - print "LIBRARY PerlCore\n"; - print "DESCRIPTION 'Perl interpreter'\n"; - print "EXPORTS\n"; +if ($PLATFORM eq 'win32') { + warn join(' ',keys %define)."\n"; + if ($define{PERL_OBJECT}) { + print "LIBRARY PerlCore\n"; + print "DESCRIPTION 'Perl interpreter'\n"; + print "EXPORTS\n"; # output_symbol("perl_alloc"); - output_symbol("perl_get_host_info"); - output_symbol("perl_alloc_using"); + output_symbol("perl_get_host_info"); + output_symbol("perl_alloc_using"); # output_symbol("perl_construct"); # output_symbol("perl_destruct"); # output_symbol("perl_free"); @@ -38,17 +81,20 @@ if ($define{PERL_OBJECT}) { # output_symbol("perl_run"); # output_symbol("RunPerl"); # exit(0); -} -else { - if ($CCTYPE ne 'GCC') { - print "LIBRARY Perl\n"; - print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; } else { - $define{'PERL_GLOBAL_STRUCT'} = 1; - $define{'MULTIPLICITY'} = 1; - } - print "EXPORTS\n"; + if ($CCTYPE ne 'GCC') { + print "LIBRARY Perl\n"; + print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; + } + else { + $define{'PERL_GLOBAL_STRUCT'} = 1; + $define{'MULTIPLICITY'} = 1; + } + print "EXPORTS\n"; + } +} elsif ($PLATFORM eq 'aix') { + print "#!\n"; } my %skip; @@ -73,6 +119,7 @@ sub emit_symbols { } } +if ($PLATFORM eq 'win32') { skip_symbols [qw( PL_statusvalue_vms PL_archpat_auto @@ -117,6 +164,31 @@ PL_cshlen PL_cshname PL_opsave )]; +} elsif ($PLATFORM eq 'aix') { + skip_symbols([qw( +Perl_dump_fds +Perl_ErrorNo +Perl_GetVars +Perl_my_bcopy +Perl_my_bzero +Perl_my_chsize +Perl_my_htonl +Perl_my_memcmp +Perl_my_memset +Perl_my_ntohl +Perl_my_swap +Perl_safexcalloc +Perl_safexfree +Perl_safexmalloc +Perl_safexrealloc +Perl_same_dirent +Perl_unlnk +PL_cryptseen +PL_opsave +PL_statusvalue_vms +PL_sys_intern +)]); +} if ($define{'PERL_OBJECT'}) { skip_symbols [qw( @@ -214,7 +286,7 @@ sub readvar { my $file = shift; my $proc = shift || sub { "PL_$_[2]" }; - open(VARS,$file) || die "Cannot open $file:$!"; + open(VARS,$file) || die "Cannot open $file: $!\n"; my @syms; while () { @@ -228,19 +300,19 @@ sub readvar if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'}) { - my $thrd = readvar("../thrdvar.h"); + my $thrd = readvar($thrdvar_h); skip_symbols $thrd; } if ($define{'MULTIPLICITY'}) { - my $interp = readvar("../intrpvar.h"); + my $interp = readvar($intrpvar_h); skip_symbols $interp; } if ($define{'PERL_GLOBAL_STRUCT'}) { - my $global = readvar("../perlvars.h"); + my $global = readvar($perlvars_h); skip_symbols $global; emit_symbols [qw(Perl_GetVars)]; emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC'; @@ -262,16 +334,23 @@ unless ($define{'DEBUGGING'}) PL_watchok)]; } -if ($define{'HAVE_DES_FCRYPT'}) +if ($PLATFORM eq 'win32' && $define{'HAVE_DES_FCRYPT'}) { emit_symbols [qw(win32_crypt)]; } # functions from *.sym files -for my $syms ('../global.sym','../pp.sym', '../globvar.sym') +my @syms = ($global_sym, $pp_sym, $globvar_sym); + +if ($define{'USE_PERLIO'}) { - open (GLOBAL, "<$syms") || die "failed to open $syms" . $!; + push @syms, $perlio_sym; + } + +for my $syms (@syms) + { + open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n"; while () { next if (!/^[A-Za-z]/); @@ -288,87 +367,51 @@ for my $syms ('../global.sym','../pp.sym', '../globvar.sym') # variables if ($define{'PERL_OBJECT'}) { - for my $f ("../perlvars.h", "../intrpvar.h", "../thrdvar.h") { + for my $f ($perlvars_h, $ntrpvar_h, $thrdvar_h) { my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); emit_symbols $glob; } } else { unless ($define{'PERL_GLOBAL_STRUCT'}) { - my $glob = readvar("../perlvars.h"); + my $glob = readvar($perlvars_h); emit_symbols $glob; } unless ($define{'MULTIPLICITY'}) { - my $glob = readvar("../intrpvar.h"); + my $glob = readvar($intrpvar_h); emit_symbols $glob; } unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'}) { - my $glob = readvar("../thrdvar.h"); + my $glob = readvar($thrdvar_h); emit_symbols $glob; } } -while () { - my $symbol; - next if (!/^[A-Za-z]/); - next if (/^#/); - s/\r//g; - chomp($_); - $symbol = $_; - next if exists $skip{$symbol}; - emit_symbol($symbol); -} - -foreach my $symbol (sort keys %export) - { - output_symbol($symbol); - } +sub try_symbol { + my $symbol = shift; -sub emit_symbol { - my $symbol = shift; - chomp($symbol); - $export{$symbol} = 1; + return if $symbol !~ /^[A-Za-z]/; + return if $symbol =~ /^\#/; + $symbol =~s/\r//g; + chomp($symbol); + next if exists $skip{$symbol}; + emit_symbol($symbol); } -sub output_symbol { - my $symbol = shift; - $symbol = "_$symbol" if $CCTYPE eq 'BORLAND'; - print "\t$symbol\n"; -# XXX: binary compatibility between compilers is an exercise -# in frustration :-( -# if ($CCTYPE eq "BORLAND") { -# # workaround Borland quirk by exporting both the straight -# # name and a name with leading underscore. Note the -# # alias *must* come after the symbol itself, if both -# # are to be exported. (Linker bug?) -# print "\t_$symbol\n"; -# print "\t$symbol = _$symbol\n"; -# } -# elsif ($CCTYPE eq 'GCC') { -# # Symbols have leading _ whole process is $%@"% slow -# # so skip aliases for now -# print "\t$symbol\n"; -# } -# else { -# # for binary coexistence, export both the symbol and -# # alias with leading underscore -# print "\t$symbol\n"; -# print "\t_$symbol = $symbol\n"; -# } +while () { + try_symbol($_); } -1; -__DATA__ -# extra globals not included above. -perl_alloc -perl_construct -perl_destruct -perl_free -perl_parse -perl_run +if ($PLATFORM eq 'win32') { + foreach my $symbol (qw( boot_DynaLoader +Perl_getTHR +Perl_init_os_extras +Perl_setTHR Perl_thread_create +Perl_win32_init +RunPerl win32_errno win32_environ win32_stdin @@ -505,11 +548,62 @@ win32_rewinddir win32_closedir win32_longpath win32_os_id -Perl_win32_init -Perl_init_os_extras -Perl_getTHR -Perl_setTHR -RunPerl -GetPerlInterpreter -SetPerlInterpreter + )) { + try_symbol($symbol); + } +} +# Now all symbols should be defined because +# next we are going to output them. + +foreach my $symbol (sort keys %export) + { + output_symbol($symbol); + } + +sub emit_symbol { + my $symbol = shift; + chomp($symbol); + $export{$symbol} = 1; +} + +sub output_symbol { + my $symbol = shift; + if ($PLATFORM eq 'win32') { + print "\t$symbol\n"; + $symbol = "_$symbol" if $CCTYPE eq 'BORLAND'; +# XXX: binary compatibility between compilers is an exercise +# in frustration :-( +# if ($CCTYPE eq "BORLAND") { +# # workaround Borland quirk by exporting both the straight +# # name and a name with leading underscore. Note the +# # alias *must* come after the symbol itself, if both +# # are to be exported. (Linker bug?) +# print "\t_$symbol\n"; +# print "\t$symbol = _$symbol\n"; +# } +# elsif ($CCTYPE eq 'GCC') { +# # Symbols have leading _ whole process is $%@"% slow +# # so skip aliases for now +# nprint "\t$symbol\n"; +# } +# else { +# # for binary coexistence, export both the symbol and +# # alias with leading underscore +# print "\t$symbol\n"; +# print "\t_$symbol = $symbol\n"; +# } + } elsif ($PLATFORM eq 'aix') { + print "$symbol\n"; + } +} + +1; +__DATA__ +# extra globals not included above. +perl_alloc +perl_construct +perl_destruct +perl_free +perl_parse +perl_run diff --git a/perl_exp.SH b/perl_exp.SH deleted file mode 100644 index f467884..0000000 --- a/perl_exp.SH +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh -# -# Written: Nov 1994 Wayne Scott -# -# Updated: 1997-8 Jarkko Hietaniemi -# -# Create the export list for perl. -# Needed by AIX to do dynamic linking. -# -# This simple program relies on global.sym and few other *.sym files -# and the *var*.h files being up to date with all of the global -# symbols that a dynamic link library might want to access. -# -# Most symbols have a Perl_ or PL_prefix because that's what embed.h -# sticks in front of them. -# -# AIX requires the list of external symbols (variables or functions) -# that are made available for another executable object file the import. -# The list is called the export file and it is a simple text file. -# The first line must be -#! -# That is, hash-bang, pound-shout, however you want to call it. -# The remainder of the file are the names of the symbols, one per line. -# The file is then given to the system loader (cc/xlc command line) -# as -bE:export.file. - -case $CONFIGDOTSH in -'') - if test -f config.sh; then TOP=.; - elif test -f ../config.sh; then TOP=..; - elif test -f ../../config.sh; then TOP=../..; - elif test -f ../../../config.sh; then TOP=../../..; - elif test -f ../../../../config.sh; then TOP=../../../..; - else - echo "Can't find config.sh."; exit 1 - fi - . $TOP/config.sh - ;; -esac -: This forces SH files to create target in same directory as SH file. -: This is so that make depend always knows where to find SH derivatives. -case "$0" in -*/*) cd `expr X$0 : 'X\(.*\)/'` ;; -esac - -echo "Extracting perl.exp" - -rm -f perl.exp -echo "#!" > perl.exp - -# No compat3 since 5.004_50. -# No interp.sym since 5.005_03. -# perlio.sym will added later if needed. - -grep '^Perl_' global.sym >> perl.exp -grep '^Perl_' pp.sym >> perl.exp -sed -n '/^[A-Za-z]/ s/^/PL_/p' globvar.sym >> perl.exp - -sed -n 's/^PERLVAR.*(G\([^[,]*\).*/PL_\1/p' perlvars.h >> perl.exp -sed -n 's/^PERLVAR.*(I\([^[,]*\).*/PL_\1/p' intrpvar.h >> perl.exp -sed -n 's/^PERLVAR.*(T\([^[,]*\).*/PL_\1/p' thrdvar.h >> perl.exp - -# -# If we use the PerlIO abstraction layer, add its symbols. -# - -if [ "X$useperlio" = "Xdefine" ] -then - grep '^[A-Za-z]' perlio.sym >> perl.exp -fi - -# -# Extra globals not included above (including a few that might -# not actually be defined, but there's no harm in that). -# - -#cat >>perl.exp < perl.exp$$ - mv -f perl.exp$$ perl.exp - case "$ccflags" in - *DEBUGGING*) ;; - *) - egrep -v '^(Perl_dump_mstats)$' < perl.exp > perl.exp$$ - mv -f perl.exp$$ perl.exp - ;; - esac - ;; -esac - -# Remove unneeded utility functions. -egrep -v '^(Perl_my_(bcopy|bzero|chsize|htonl|memcmp|memset|ntohl|swap))$' < perl.exp > perl.exp$$ -mv -f perl.exp$$ perl.exp - -case "$usethreads" in -true|[yY]*) usethreads=define ;; -esac - -# Remove thread symbols if needed. -case "$usethreads" in -define) ;; -*) - egrep -v '^(Perl_(condpair_magic|find_threadsv|magic_mutexfree|new_struct_thread|unlock_condpair)|^PL_((eval|nthreads)_cond|curthr|eval_owner|(cred|eval|strtab|sv|svref|threads|malloc|vtbl)_mutex|nthreads|threadnum|threadsv_names|thr_key|thrsv))$' < perl.exp > perl.exp$$ - mv -f perl.exp$$ perl.exp - ;; -esac - -# Remove debugging symbols if needed. -case "$ccflags" in -*DEBUGGING*) ;; -*) - egrep -v '^(PL_(block_type|watchaddr|watchok))$' < perl.exp > perl.exp$$ - mv -f perl.exp$$ perl.exp - ;; -esac - -# Remove unneeded globals. -egrep -v '^(Perl_(ErrorNo|GetVars|same_dirent|unlnk)|PL_(cryptseen|statusvalue_vms))' < perl.exp > perl.exp$$ -mv -f perl.exp$$ perl.exp - -# The shebang line nicely sorts as the first one. -sort -o perl.exp -u perl.exp - -# eof diff --git a/win32/Makefile b/win32/Makefile index 82a72ec..de6499e 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -709,8 +709,8 @@ $(DLL_OBJ) : $(CORE_H) $(PERL95_OBJ) : $(CORE_H) $(X2P_OBJ) : $(CORE_H) -perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym makedef.pl - $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \ +perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl + $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \ CCTYPE=$(CCTYPE) > perldll.def $(PERLDLL): perldll.def $(PERLDLL_OBJ) diff --git a/win32/makefile.mk b/win32/makefile.mk index ffda9fd..b279127 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -838,8 +838,8 @@ $(DLL_OBJ) : $(CORE_H) $(PERL95_OBJ) : $(CORE_H) $(X2P_OBJ) : $(CORE_H) -perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym makedef.pl - $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \ +perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl + $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \ CCTYPE=$(CCTYPE) > perldll.def $(PERLDLL): perldll.def $(PERLDLL_OBJ)