Ticket #644 (closed bug: worksforme)

Opened 5 years ago

Last modified 4 years ago

target 'make hello' broken

Reported by: fperrad Owned by:
Priority: normal Milestone:
Component: core Version: 1.1.0
Severity: medium Keywords:
Cc: chromatic, gerd Language:
Patch status: new Platform:

Description

Since r38502 (Removed PARROT_EXPORT from generated ops functions), the target 'make hello' is broken, at least with MinGW32.

> make hello

.\parrot.exe -o examples\pasm\hello.pbc examples\pasm\hello.pasm
.\parrot.exe -o examples\pasm\hello.o examples\pasm\hello.pbc
mingw32-make -C . EXEC=examples\pasm\hello exec
src\exec_start.c
src\exec_start.c: In function `main':
src\exec_start.c:54: warning: nested extern declaration of `program_code'
src\exec_start.c:63: warning: nested extern declaration of `interpre'
gcc -o examples\pasm\hello.exe examples\pasm\hello.o src\exec_start.o src\parrot_config.o  "C:\fperrad\Parrot\trunk\libparrot.dll" C:\icu-4.0\iculib\icudt.lib C:\icu-4.0\icu\lib\icuuc.lib -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lreadline -lintl
examples\pasm\hello.o:(.text+0x6f): undefined reference to `Parrot_print_sc'
examples\pasm\hello.o:(.text+0x9d): undefined reference to `Parrot_print_sc'
examples\pasm\hello.o:(.text+0xaa): undefined reference to `Parrot_print_s'
examples\pasm\hello.o:(.text+0xb7): undefined reference to `Parrot_print_sc'
collect2: ld returned 1 exit status

Attachments

hello.patch Download (0.7 KB) - added by fperrad 5 years ago.
rewrite with PBC_TO_EXE

Change History

  Changed 5 years ago by fperrad

Same problem on linux.

follow-up: ↓ 3   Changed 5 years ago by jkeenan

Confirmed on Linux/i386 (r43162):

./parrot -o examples/pasm/hello.pbc examples/pasm/hello.pasm
./parrot -o examples/pasm/hello.o examples/pasm/hello.pbc
main: can't produce object filemake: *** [examples/pasm/hello.o] Error 1

in reply to: ↑ 2 ; follow-up: ↓ 4   Changed 5 years ago by jkeenan

Replying to jkeenan:

Confirmed on Linux/i386 (r43162): {{{ ./parrot -o examples/pasm/hello.pbc examples/pasm/hello.pasm ./parrot -o examples/pasm/hello.o examples/pasm/hello.pbc main: can't produce object filemake: *** [examples/pasm/hello.o] Error 1 }}}

This is not just limited to hello.pasm. Consider cat.pasm from the same directory:

$ ./parrot -o examples/pasm/cat.pbc examples/pasm/cat.pasm
$ ./parrot -o examples/pasm/cat.o examples/pasm/cat.pbc
main: can't produce object file

in reply to: ↑ 3 ; follow-up: ↓ 5   Changed 5 years ago by jkeenan

Replying to jkeenan:

This is not just limited to hello.pasm. Consider cat.pasm from the same directory:

Got same results with fact.pasm and trace.pasm.

So, how does Parrot run PASM these days?

kid51

in reply to: ↑ 4   Changed 5 years ago by jkeenan

Replying to jkeenan:

So, how does Parrot run PASM these days?

Coke indicated on #parrot that it was simple as calling ./parrot on the file.

That led to this patch:

Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in        (revision 43583)
+++ config/gen/makefiles/root.in        (working copy)
@@ -1094,20 +1094,9 @@
     examples/pasm/hello$(EXE)
 
 # hello
-hello: test_prep examples/pasm/hello$(EXE)
-       $(CUR_DIR)/examples/pasm/hello$(EXE) "from your friendly makefile"
+hello : test_prep
+       $(PARROT) examples/pasm/hello.pasm
 
-examples/pasm/hello.pbc: examples/pasm/hello.pasm
-       $(PARROT) -o examples/pasm/hello.pbc examples/pasm/hello.pasm
-
-examples/pasm/hello$(O): examples/pasm/hello.pbc
-       $(PARROT) -o examples/pasm/hello$(O) examples/pasm/hello.pbc
-
-examples/pasm/hello$(EXE): examples/pasm/hello$(O)
-       $(MAKE) . EXEC=examples/pasm/hello exec
-
-
-
 ###############################################################################
 #
 # Dependencies:

More to come.

  Changed 5 years ago by fperrad

  • patch set to new

AFAIK the purpose of the target 'hello' is to demonstrate the creation of an executable.

So this target could be rewrite with PBC_TO_EXE (see patch).

Changed 5 years ago by fperrad

rewrite with PBC_TO_EXE

  Changed 5 years ago by coke

On Mon, Jan 25, 2010 at 7:19 AM, Parrot <parrot-tickets@lists.parrot.org> wrote:
> #644: target 'make hello' broken
> ---------------------+------------------------------------------------------
>  Reporter:  fperrad  |       Owner:
>     Type:  bug      |      Status:  new
>  Priority:  normal   |   Milestone:
> Component:  core     |     Version:  1.1.0
>  Severity:  medium   |    Keywords:
>     Lang:           |       Patch:  new
>  Platform:           |
> ---------------------+------------------------------------------------------
> Changes (by fperrad):
>
>  * patch:  => new
>
>
> Comment:
>
>  AFAIK the purpose of the target 'hello' is to demonstrate the creation of
>  an executable.
>
>  So this target could be rewrite with PBC_TO_EXE (see patch).
>
> --
> Ticket URL: <https://trac.parrot.org/parrot/ticket/644#comment:6>
> Parrot <https://trac.parrot.org/parrot/>
> Parrot Development
> _______________________________________________
> parrot-tickets mailing list
> parrot-tickets@lists.parrot.org
> http://lists.parrot.org/mailman/listinfo/parrot-tickets
>

Except that isn't the original style executable that was being
created, it's a new, "fake" one. (We already have an example for
creating a fake executable using the fake executable maker itself.)

If doing it the old way is broken, let's rip out references to it and
remove this target entirely.

-- 
Will "Coke" Coleda

  Changed 4 years ago by jkeenan

  • cc gerd added

Gerd: Given your commit in r43950 to make make hello work, can you take and (hopefully) resolve this ticket?

Thank you very much.

kid51

  Changed 4 years ago by gerd

  • status changed from new to closed
  • resolution set to worksforme

This bug is fixed in changeset r43950 and r43964. It can be switched back to the -o option of parrot if this option works, like it is documented in docs/running.pod. I do not kown if this option can be fixed to handle the file extension ".o". I will try to do it or docs/running.pod should be changed. May be a ticket for the -o option should be created.

Note: See TracTickets for help on using tickets.