On Mon, Sep 10, 2001 at 06:58:23PM -0400, Dan Sugalski wrote:
> At 03:52 PM 9/10/2001 -0700, Damien Neil wrote:
> >Parrot fails to work in very obscure ways on FreeBSD.  After some
> >poking around, I tracked the problem to the "end" op--this appears
> >to conflict with something inside libc.  Renaming the op fixes the
> >problem.
> 
> Ah, that's what was  killing the build on Nat's machine. Patch, by chance?

The following quick-and-dirty patch appears to work.  This prefixes
all opcode functions with "Parrot_op_".  I'd have made the prefix
configurable, but the opcode generation is spread across three
different files.

(Aside: What's the best way to generate a useful patch with cvs?
The following comes from "cvs -q diff -u".)

                       - Damien

Index: build_interp_starter.pl
===================================================================
RCS file: /home/perlcvs/parrot/build_interp_starter.pl,v
retrieving revision 1.2
diff -u -u -r1.2 build_interp_starter.pl
--- build_interp_starter.pl     2001/09/10 21:26:09     1.2
+++ build_interp_starter.pl     2001/09/10 23:07:08
@@ -27,7 +27,7 @@
     my($name) = split /\s+/;
     my $num = $count;
     $num = 0 if $name eq 'end';
-    print INTERP "\tx[$num] = $name; \\\n";
+    print INTERP "\tx[$num] = Parrot_op_$name; \\\n";
     $count++ unless $name eq 'end';
 }
 print INTERP "} while (0);\n";
Index: make_op_header.pl
===================================================================
RCS file: /home/perlcvs/parrot/make_op_header.pl,v
retrieving revision 1.3
diff -u -u -r1.3 make_op_header.pl
--- make_op_header.pl   2001/09/10 21:26:09     1.3
+++ make_op_header.pl   2001/09/10 23:07:08
@@ -6,7 +6,7 @@
     next if /^\s*#/ or /^\s*$/;
     chomp;
     ($name, undef) = split /\t/, $_;
-    print "IV *$name(IV *, struct Perl_Interp *);\n";
+    print "IV *Parrot_op_$name(IV *, struct Perl_Interp *);\n";
 }
 
 BEGIN {
Index: process_opfunc.pl
===================================================================
RCS file: /home/perlcvs/parrot/process_opfunc.pl,v
retrieving revision 1.3
diff -u -u -r1.3 process_opfunc.pl
--- process_opfunc.pl   2001/09/10 21:26:09     1.3
+++ process_opfunc.pl   2001/09/10 23:07:08
@@ -105,7 +105,7 @@
     my $line = shift;
     my ($name) = $line =~ /AUTO_OP\s+(\w+)/;
     
-    print OUTPUT "IV *$name(IV cur_opcode[], struct Perl_Interp *interpreter) {\n";
+    print OUTPUT "IV *Parrot_op_$name(IV cur_opcode[], struct Perl_Interp 
+*interpreter) {\n";
     return($name, "  return cur_opcode + "
     . $opcode{$name}{RETURN_OFFSET}. ";\n}\n");
 }
@@ -114,7 +114,7 @@
     my $line = shift;
     my ($name) = $line =~ /MANUAL_OP\s+(\w+)/;
     
-    print OUTPUT "IV *$name(IV cur_opcode[], struct Perl_Interp *interpreter) {\n";
+    print OUTPUT "IV *Parrot_op_$name(IV cur_opcode[], struct Perl_Interp 
+*interpreter) {\n";
     print OUTPUT "  IV return_offset = 1;\n";
     return($name, "  return cur_opcode + return_offset;\n}\n");
 }
Index: test.pbc
===================================================================
RCS file: /home/perlcvs/parrot/test.pbc,v
retrieving revision 1.2
diff -u -u -r1.2 test.pbc
Binary files /tmp/cvsqe7MSGr3cy and test.pbc differ

Reply via email to