Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

h2ph produces bad compiler defs file #1151

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#2114 (status was 'resolved')

Searchable as RT2114$

p5pRT commented 24 years ago

From helm@fionn.es.net

Created by helm@es.net

This error produced by the syslog packages​:

Warning​: Use of "defined" without parens is ambiguous at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/_h2ph_pre.ph line 2. Can't use subscript on subroutine entry at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/_h2ph_pre.ph line 2\, near "} }" syntax error at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/_h2ph_pre.ph line 4\, near "unless" BEGIN failed--compilation aborted at /tmp/junk line 4.

seems to come from this file​:

# This file was created by h2ph version 1 unless (defined &) { sub () { "" } }

unless (defined &__STDC__) { sub __STDC__() { 1 } }

unless (defined &__sun) { sub __sun() { 1 } }

unless (defined &__unix) { sub __unix() { 1 } }

unless (defined &sparc) { sub sparc() { 1 } }

unless (defined &sun) { sub sun() { 1 } }

unless (defined &unix) { sub unix() { 1 } }

That first line looks bogus. I assume this is extracted from the c compiler that built perl\, but I haven't tracked down where that test/storage took place (in config.sh\, presumably). The compiler used to build perl is the Sun workshop cc​:

Sun WorkShop Compiler C Version 4.200 (plus some jumbo patch)

I commented out this strange initial defined line & scripts seem to work ok.

Perl Info ``` Site configuration information for perl 5.00503: Configured by helm at Sat Jul 24 13:20:16 PDT 1999. Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=solaris, osvers=2.6, archname=sun4-solaris-thread uname='sunos fionn 5.6 generic_105181-15 sun4u sparc ' hint=recommended, useposix=true, d_sigaction=define usethreads=define useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-g -O', gccversion= cppflags='-D_REENTRANT -DDEBUGGING -I/usr/local/include' ccflags ='-D_REENTRANT -DDEBUGGING -I/usr/local/include' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lposix4 -lpthread -lc -lcrypt libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib' Locally applied patches: @INC for perl 5.00503: /usr/local/lib/perl5/5.00503/sun4-solaris-thread /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread /usr/local/lib/perl5/site_perl/5.005 . Environment for perl 5.00503: HOME=/export/home/helm LANG=en_US LANGUAGE (unset) LC_COLLATE=en_US LC_CTYPE=en_US LC_MESSAGES=C LC_MONETARY=en_US LC_NUMERIC=en_US LC_TIME=en_US LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin:/usr/afsws/bin:/usr/openwin/bin:.:/usr/ccs/bin:/usr/local/mh/bin:/opt/SUNWdat/bin PERL_BADLANG (unset) SHELL=/bin/csh ```
p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

On Mon\, Feb 07\, 2000 at 04​:49​:45PM -0800\, Michael Helm wrote​:

This is a bug report for perl from helm@​es.net\, generated with the help of perlbug 1.26 running under perl 5.00503.

----------------------------------------------------------------- [Please enter your report here] This error produced by the syslog packages​:

Warning​: Use of "defined" without parens is ambiguous at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/_h2ph_pre.ph line 2. Can't use subscript on subroutine entry at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/_h2ph_pre.ph line 2\, near "} }" syntax error at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread/_h2ph_pre.ph line 4\, near "unless" BEGIN failed--compilation aborted at /tmp/junk line 4.

  Thanks for the bug report. Would you mind trying the latest development Perl\, version 5.5.640? I think that the bug is fixed\, but I don't have a Solaris 2.6 machine ready at hand . . . .

  Peace\, * Kurt Starsinic (kstar@​orientation.com) ---------- Senior Network Engineer * | `Before a war\, military science seems a real science\, like astronomy. | | After a war it seems more like astrology.' -- Rebecca West |

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

I took a little extract from the h2ph script​:

#!/usr/local/bin/perl   eval 'exec /usr/local/bin/perl -S $0 ${1+"$@​"}'   if $running_under_some_shell;

use Config; use File​::Path qw(mkpath); use Getopt​::Std;

my (%define) = _extract_cc_defines();

sub _extract_cc_defines {   my %define;   my $allsymbols = join " "\, @​Config{ccsymbols\, cppsymbols\, cppccsymbols};

  # Split compiler pre-definitions into `key=value' pairs​:   foreach (split /\s+/\, $allsymbols) {   /(.*?)=(.*)/;   $define{$1} = $2;

  print STDERR "$_​: $1 -> $2\n";   }

  return %define; }

Result​:

: -> __STDC__=1​: __STDC__ -> 1 __sun=1​: __sun -> 1 __unix=1​: __unix -> 1 sparc=1​: sparc -> 1 sun=1​: sun -> 1 unix=1​: unix -> 1

my $allsymbols = join " "\, @​Config{ccsymbols\, cppsymbols\, cppccsymbols}; seems to happen because this is empty ^

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

On Tue\, Feb 08\, 2000 at 12​:04​:33AM -0800\, Michael Helm wrote​:

I took a little extract from the h2ph script​:

#!/usr/local/bin/perl eval 'exec /usr/local/bin/perl -S $0 ${1+"$@​"}' if $running_under_some_shell;

use Config; use File​::Path qw(mkpath); use Getopt​::Std;

my (%define) = _extract_cc_defines();

sub _extract_cc_defines { my %define; my $allsymbols = join " "\, @​Config{ccsymbols\, cppsymbols\, cppccsymbols};

\# Split compiler pre\-definitions into \`key=value' pairs​:
foreach \(split /\\s\+/\, $allsymbols\) \{
    /\(\.\*?\)=\(\.\*\)/;
    $define\{$1\} = $2;

        print STDERR "$\_​:  $1 \-> $2\\n";
\}

return %define;

}

Result​:

: -> __STDC__=1​: __STDC__ -> 1 __sun=1​: __sun -> 1 __unix=1​: __unix -> 1 sparc=1​: sparc -> 1 sun=1​: sun -> 1 unix=1​: unix -> 1

my $allsymbols = join " "\, @​Config{ccsymbols\, cppsymbols\, cppccsymbols}; seems to happen because this is empty ^

  Thanks\, got it\, patch to follow.

  Peace\, * Kurt Starsinic (kstar@​orientation.com) ---------- Senior Network Engineer * | `The term `Internet' has the meaning given that term in | | section 230(f)(1) of the Communications Act of 1934.' | | -- H.R. 3028\, Trademark Cyberpiracy Prevention Act |