This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Workaround for the buggy ("internal compiler error")
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 13 Mar 2001 14:22:45 +0000 (14:22 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 13 Mar 2001 14:22:45 +0000 (14:22 +0000)
AIX C compiler 5.0.1.0: skip the optimization for regcomp.c
(and ext/re/re_comp.c).  The MakeMaker dark magic courtesy
of Andreas König.

p4raw-id: //depot/perl@9124

ext/re/Makefile.PL
hints/aix.sh

index b8d25bd..537704c 100644 (file)
@@ -39,3 +39,22 @@ re_exec\$(OBJ_EXT) : re_exec.c
 
 EOF
 }
+
+sub MY::c_o {
+    my($self) = @_;
+    package MY; # so that "SUPER" works right
+    my $inh = $self->SUPER::c_o(@_);
+    use Config;
+    if ($Config{osname} eq 'aix' && $Config{ccversion} eq '5.0.1.0') {
+       # Known buggy optimizer.
+       my $cccmd = $self->const_cccmd;
+       $cccmd =~ s/^CCCMD\s*=\s*//;
+       $cccmd =~ s/\s\$\(OPTIMIZE\)\s/ /;
+       $inh .= qq{
+
+re_comp\$\(OBJ_EXT\): re_comp.c
+\t$cccmd \$(CCCDLFLAGS) -I\$(PERL_INC) \$(DEFINE) \$*.c
+};
+    }
+    $inh;
+}
index b14aad0..31d189f 100644 (file)
@@ -138,8 +138,25 @@ case "$cc" in
        optimize='none'
        ;;
      4.4.0.0|4.4.0.1|4.4.0.2)
-       echo >&4 "*** This C compiler ($ccversion) is outdated."
-       echo >&4 "*** Please upgrade to at least 4.4.0.3."
+       cat >&4 <<EOF
+***
+*** This C compiler ($ccversion) is outdated.
+***
+*** Please upgrade to at least 4.4.0.3.
+***
+EOF
+       ;;
+     5.0.1.0)
+       cat >&4 <<EOF
+***
+*** This C compiler ($ccversion) is known to have optimizer problems
+*** when compiling regcomp.c.
+***
+*** Disabling optimization for that file but consider upgrading
+*** your C compiler.
+***
+EOF
+regcomp_cflags='optimize='
        ;;
      esac
 esac