Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #32122] [TODO] exec core testing

12 views
Skip to first unread message

Leopold Toetsch

unread,
Oct 24, 2004, 8:56:45 AM10/24/04
to bugs-bi...@rt.perl.org
# New Ticket Created by Leopold Toetsch
# Please include the string: [perl #32122]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=32122 >


We have since quite a time the support for creating native executables
on some platforms. This functionality is not tested at all. The Makefile
has just one very simple rule to create a "Hello world"-like program
with "make testexec".

Testing the EXEC core should probably use EXEC_SHARED, but I don't know
if that works. Hopelfully Daniel is listening and can provide some hints.

Takers welcome,
leo

Andy Dougherty

unread,
Oct 26, 2004, 4:28:33 PM10/26/04
to Perl6 Internals
On Sun, 24 Oct 2004, Leopold Toetsch wrote:

> We have since quite a time the support for creating native executables
> on some platforms. This functionality is not tested at all. The Makefile
> has just one very simple rule to create a "Hello world"-like program
> with "make testexec".

The Makefile target attempts to create a simple file containing:

print "Hello World\n"
end

Alas, it's hard to create that file portably. In particular,
echo 'print "Hello World\n"'
gives different results with different 'echo' commands. The
default bash behavior is to pass the \n on through. The default
ksh behavior is to interpolate the \n and replace it by an actual
newline. Adding the -e flag to bash's echo command forces it to
act like ksh, but ksh complains about the unrecognized -e option.

The symptom of this is the following rather mysterious error message:

error:imcc:op not found 'print' (print<0>)

in file 'hello.pasm' line 1

We could use a perl one-liner in place of echo, but getting all the quotes
right across different operating systems is still hard.

This patch takes a simpler approach: it creates a new file
examples/assembly/hello.pasm, and just uses that.

It still doesn't work on Solaris/SPARC. I now get

error:imcc:main: can't produce object file*** Error code 1

but that's to be expected because the code simply isn't written yet to
produce native executables on this platform.

diff -r -u -N parrot-orig/MANIFEST parrot-andy/MANIFEST
--- parrot-orig/MANIFEST Mon Oct 25 10:56:52 2004
+++ parrot-andy/MANIFEST Tue Oct 26 13:04:53 2004
@@ -378,6 +378,7 @@
examples/assembly/fact.pasm [main]doc
examples/assembly/getopt_demo.imc [main]doc
examples/assembly/hanoi.pasm [main]doc
+examples/assembly/hello.pasm [main]doc
examples/assembly/hello-dwim.imc [main]doc
examples/assembly/io1.pasm [main]doc
examples/assembly/io2.pasm [main]doc
diff -r -u -N parrot-orig/config/gen/makefiles/root.in parrot-andy/config/gen/makefiles/root.in
--- parrot-orig/config/gen/makefiles/root.in Tue Oct 12 08:40:16 2004
+++ parrot-andy/config/gen/makefiles/root.in Tue Oct 26 13:03:28 2004
@@ -1280,16 +1280,12 @@
testexec: hello-parrot hello-clean

hello-clean:
- @$(RM_F) hello.pasm hello$(O) hello
+ @$(RM_F) hello.pbc hello$(O) hello

hello-parrot: hello

-hello.pasm:
- echo 'print "Hello World\n"' > hello.pasm
- echo 'end' >> hello.pasm
-
-hello.pbc: hello.pasm
- ./parrot -o hello.pbc hello.pasm
+hello.pbc: examples/assembly/hello.pasm
+ ./parrot -o hello.pbc examples/assembly/hello.pasm

hello$(O): hello.pbc
./parrot -o hello$(O) hello.pbc
diff -r -u -N parrot-orig/examples/assembly/hello.pasm parrot-andy/examples/assembly/hello.pasm
--- parrot-orig/examples/assembly/hello.pasm Wed Dec 31 19:00:00 1969
+++ parrot-andy/examples/assembly/hello.pasm Tue Oct 26 13:04:11 2004
@@ -0,0 +1,2 @@
+print "Hello World\n"
+end
diff -r -u -N parrot-orig/hello.pasm parrot-andy/hello.pasm
--- parrot-orig/hello.pasm Wed Dec 31 19:00:00 1969
+++ parrot-andy/hello.pasm Tue Oct 26 15:56:02 2004
@@ -0,0 +1,3 @@
+print "Hello World
+"
+end

--
Andy Dougherty doug...@lafayette.edu

Leopold Toetsch

unread,
Oct 27, 2004, 6:23:09 AM10/27/04
to Andy Dougherty, perl6-i...@perl.org
Andy Dougherty <doug...@lafayette.edu> wrote:
> On Sun, 24 Oct 2004, Leopold Toetsch wrote:

>> We have since quite a time the support for creating native executables
>> on some platforms. This functionality is not tested at all. The Makefile
>> has just one very simple rule to create a "Hello world"-like program
>> with "make testexec".

> The Makefile target attempts to create a simple file containing:

> print "Hello World\n"
> end

> Alas, it's hard to create that file portably.

Sorry, misunderstanding. I'd like to get rid of this hello world test.

"make testexec" should run like "make testj" i.e. test all ~2000 current
tests via the exec core.

leo

0 new messages