[perl #24080] [PATCH] parrot-build-1: Build parrot incl. imcc files take 1
# New Ticket Created by Leopold Toetsch # Please include the string: [perl #24080] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt2/Ticket/Display.html?id=24080 > Attached is a first attempt to prepare for the move of languages/imcc to imcc and to build a single parrot executable. The patch doesn't address languages/* yet, only parrot/imcc are involved. Changes: - imcc makefile rules and targets are included in root now - libparrot contains imcc objects too (except main of course) - imcc test system is adapted to run with the parrot executable Known issues: - Building of imcc in its own directory is broken (this will very probably be abandoned anyway - except Melvin, the original author of imcc, loudly hollers - it could be a dummy to just copy parrot). - languages like perl6, which are still using imcc$(EXE) will be addressed by another patch. - "make realclean" deletes generated parser/lexer files too (which it probably shouldn't) - regenerating these files may be broken. Status - Runs "make test" (incl. test_imcc) on i386/linux here. The only problematic thing AFAIK might be the automatic rule in root.in:594 that includes the private imcc headers for building IMCC_O_FILES. I don't know if other makes are capable of "info make" "Syntax of Static Pattern Rules". If not, we probably have to expand these to explicit rules. Please give it a try. Feedback very welcome TIA leo -- attachment 1 -- url: http://rt.perl.org/rt2/attach/65508/48841/d5cfd7/parrot-build-1.patch --- parrot/config/gen/cflags/root.inTue Jul 22 16:56:43 2003 +++ parrot-leo/config/gen/cflags/root.inWed Oct 1 09:10:30 2003 @@ -7,3 +7,7 @@ # spf_render.c -{-Wformat-nonliteral} # noisy tsq.c -{${optimize}} # never optimize tsq.c! + +# imcc file settings +{imcc} -{-Wwrite-strings -Wcast-qual} s/-Wno-unused/-Wunused/ -{-Wformat-nonliteral} + --- parrot/config/gen/makefiles/root.in Tue Sep 30 16:26:09 2003 +++ parrot-leo/config/gen/makefiles/root.in Wed Oct 1 10:24:22 2003 @@ -8,13 +8,13 @@ INCLUDEDIR = $(EXEC_PREFIX)/include # imcc dir -IMCC_DIR = languages/imcc +IMCC_DIR = languages${slash}imcc + # file containing main -PARROT_MAIN = test_main +PARROT_MAIN = $(IMCC_DIR)${slash}main -O = ${o} -SO = ${so} -A = ${a} + +# programs and utils used for build RM_F = ${rm_f} RM_RF = ${rm_rf} AR_CR = ${ar} ${ar_flags} @@ -22,9 +22,18 @@ LINK = ${link} LD = ${ld} LD_SHARED = ${ld_shared} +TOUCH = perl -e ${PQ}open(A,q{>>},$$_) or die foreach @ARGV${PQ} +YACC = ${yacc} +LEX = ${lex} + +# file extensions and util flags +O = ${o} +SO = ${so} +A = ${a} LD_OUT = ${ld_out} LD_SHARED_FLAGS=${ld_shared_flags} + INC=./${inc} NONGEN_HEADERS = ${nongen_headers} @@ -96,6 +105,36 @@ # ### +# these are private to the imcc subsystem +IMCC_H_FILES = \ + $(IMCC_DIR)${slash}imc.h\ + $(IMCC_DIR)${slash}stacks.h \ + $(IMCC_DIR)${slash}cfg.h\ + $(IMCC_DIR)${slash}instructions.h \ + $(IMCC_DIR)${slash}debug.h \ + $(IMCC_DIR)${slash}sets.h \ + $(IMCC_DIR)${slash}symreg.h \ + $(IMCC_DIR)${slash}pbc.h\ + $(IMCC_DIR)${slash}optimizer.h \ + $(IMCC_DIR)${slash}parser.h \ + $(IMCC_DIR)${slash}imcparser.h + +IMCC_O_FILES = \ + $(IMCC_DIR)${slash}imcparser$(O)\ + $(IMCC_DIR)${slash}imclexer$(O) \ + $(IMCC_DIR)${slash}imc$(O) \ + $(IMCC_DIR)${slash}stacks$(O) \ + $(IMCC_DIR)${slash}symreg$(O) \ + $(IMCC_DIR)${slash}instructions$(O) \ + $(IMCC_DIR)${slash}cfg$(O) \ + $(IMCC_DIR)${slash}sets$(O) \ + $(IMCC_DIR)${slash}debug$(O)\ + $(IMCC_DIR)${slash}optimizer$(O)\ + $(IMCC_DIR)${slash}pbc$(O) \ + $(IMCC_DIR)${slash}parser_util$(O) \ + $(IMCC_DIR)${slash}jit$(O) \ + $(IMCC_DIR)${slash}pcc$(O) + GENERAL_H_FILES = $(NONGEN_HEADERS) $(GEN_HEADERS) ${cg_h} @@ -113,7 +152,7 @@ IO_O_FILES = io/io$(O) io/io_buf$(O) io/io_unix$(O) io/io_win32$(O) \ io/io_stdio$(O) io/io_passdown$(O) -INTERP_O_FILES = exceptions$(O) global_setup$(O) interpreter$(O) parrot$(O) \ +INTERP_O_FILES = exceptions$(O) global_setup$(O) interpreter$(O) \ register$(O) core_ops$(O) core_ops_prederef$(O) core_ops_switch$(O) \ memory$(O) objects$(O) ${exec_o} \ packfile$(O) stacks$(O) string$(O) sub$(O) encoding$(O) \ @@ -128,7 +167,8 @@ dynext$(O) utils$(O) vtables$(O) mmd$(O) O_FILES = $(INTERP_O_FILES) $(IO_O_FILES) $(CLASS_O_FILES) \ - $(ENCODING_O_FILES) $(CHARTYPE_O_FILES) + $(ENCODING_O_FILES) $(CHARTYPE_O_FILES) \ + $(IMCC_O_FILES) OPS_FILES = ${ops} $(GEN_OPSFILES) @@ -170,8 +210,6 @@ PINFO = pbc_info${exe} PDB = pdb${ex
Re: [RfT] Configure/Makefile changes towards Borland C++ Builder
"Jonathan Worthington" <[EMAIL PROTECTED]> writes: > - Original Message - > From: "Juergen Boemmels" <[EMAIL PROTECTED]> > To: "Brent Dax" <[EMAIL PROTECTED]> > Cc: "'Steve Fink'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, September 23, 2003 6:38 PM > Subject: Re: [RfT] Configure/Makefile changes towards Borland C++ Builder > > > > I tried the first way: substitute before interpolation. This means all > > uservariables need to substitute slashes. Fortunatly there are not so > > many. > > > > ... > > > > Anyway please test the revisited patch > Works for me. :-) All languages apart from cola now build successfully on > Win32 using nmake. > > Thanks, If nobody objects I will commit this change tomorrow. bye boe -- Juergen Boemmels[EMAIL PROTECTED] Fachbereich Physik Tel: ++49-(0)631-205-2817 Universitaet Kaiserslautern Fax: ++49-(0)631-205-3906 PGP Key fingerprint = 9F 56 54 3D 45 C1 32 6F 23 F6 C7 2F 85 93 DD 47
Re: [perl #24080] [PATCH] parrot-build-1: Build parrot incl. imcc files take 1
On Wed, 1 Oct 2003, Leopold Toetsch wrote: > The only problematic thing AFAIK might be the automatic rule in > root.in:594 that includes the private imcc headers for building > IMCC_O_FILES. I don't know if other makes are capable of "info make" > "Syntax of Static Pattern Rules". If not, we probably have to expand > these to explicit rules. I don't know what "info make" "Syntax of Static Pattern Rules" is (since I don't have info installed on my Solaris system) but I'm guessing that whatever it is, it's the underlying cause for Solaris make to complain: make: Fatal error in reader: Makefile, line 665: Extra `:', `::', or `:=' on dependency line -- Andy Dougherty [EMAIL PROTECTED]
Re: [RfT] Configure/Makefile changes towards Borland C++ Builder
Juergen Boemmels <[EMAIL PROTECTED]> wrote: > If nobody objects I will commit this change tomorrow. I really thought that stuff is already committed - but obiously isn't - my bad. A minute ago I had checked in build system changes WRT languages to use parrot instead of imcc. This will for sure collide with your patch - sorry. I'd be glad if you can omit changes to root.in. I'll do the s!/!\${slash}!g then in that file. Again sorry for the additional work. > bye > boe leo
Re: [perl #24080] [PATCH] parrot-build-1: Build parrot incl. imcc files take 1
Andy Dougherty <[EMAIL PROTECTED]> wrote: > I don't know what "info make" "Syntax of Static Pattern Rules" is It was a rule like: $(dir/o_files) : %.o : %.c dependencies Its now separated into two. Thanks for the feedback, I've sent an updated version to bugs-parrot. leo
[perl #24082] [PATCH] parrot-build-3: replaces and obsoletes #24080
# New Ticket Created by Leopold Toetsch # Please include the string: [perl #24082] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt2/Ticket/Display.html?id=24082 > Thanks to Andy for the feedback - I have replaced that part with a simpler and probably less gnuish make rule. Additional changes are: - addresses ${slash} changes for imcc files by a new IMCC_DIR_SL var - fixed typos like -oinclexer Thanks again for testing and feedback, leo -- attachment 1 -- url: http://rt.perl.org/rt2/attach/65514/48848/094078/parrot-build-3.patch --- parrot/config/gen/cflags/root.inTue Jul 22 16:56:43 2003 +++ parrot-leo/config/gen/cflags/root.inWed Oct 1 09:10:30 2003 @@ -7,3 +7,7 @@ # spf_render.c -{-Wformat-nonliteral} # noisy tsq.c -{${optimize}} # never optimize tsq.c! + +# imcc file settings +{imcc} -{-Wwrite-strings -Wcast-qual} s/-Wno-unused/-Wunused/ -{-Wformat-nonliteral} + --- parrot/config/gen/makefiles/root.in Tue Sep 30 16:26:09 2003 +++ parrot-leo/config/gen/makefiles/root.in Wed Oct 1 16:19:45 2003 @@ -8,13 +8,14 @@ INCLUDEDIR = $(EXEC_PREFIX)/include # imcc dir -IMCC_DIR = languages/imcc +IMCC_DIR = languages${slash}imcc +IMCC_DIR_SL = $(IMCC_DIR)${slash} + # file containing main -PARROT_MAIN = test_main +PARROT_MAIN = $(IMCC_DIR_SL)main -O = ${o} -SO = ${so} -A = ${a} + +# programs and utils used for build RM_F = ${rm_f} RM_RF = ${rm_rf} AR_CR = ${ar} ${ar_flags} @@ -22,9 +23,18 @@ LINK = ${link} LD = ${ld} LD_SHARED = ${ld_shared} +TOUCH = perl -e ${PQ}open(A,q{>>},$$_) or die foreach @ARGV${PQ} +YACC = ${yacc} +LEX = ${lex} + +# file extensions and util flags +O = ${o} +SO = ${so} +A = ${a} LD_OUT = ${ld_out} LD_SHARED_FLAGS=${ld_shared_flags} + INC=./${inc} NONGEN_HEADERS = ${nongen_headers} @@ -96,6 +106,36 @@ # ### +# these are private to the imcc subsystem +IMCC_H_FILES = \ + $(IMCC_DIR_SL)imc.h \ + $(IMCC_DIR_SL)stacks.h \ + $(IMCC_DIR_SL)cfg.h \ + $(IMCC_DIR_SL)instructions.h\ + $(IMCC_DIR_SL)debug.h \ + $(IMCC_DIR_SL)sets.h\ + $(IMCC_DIR_SL)symreg.h \ + $(IMCC_DIR_SL)pbc.h \ + $(IMCC_DIR_SL)optimizer.h \ + $(IMCC_DIR_SL)parser.h \ + $(IMCC_DIR_SL)imcparser.h + +IMCC_O_FILES = \ + $(IMCC_DIR_SL)imcparser$(O) \ + $(IMCC_DIR_SL)imclexer$(O) \ + $(IMCC_DIR_SL)imc$(O) \ + $(IMCC_DIR_SL)stacks$(O)\ + $(IMCC_DIR_SL)symreg$(O)\ + $(IMCC_DIR_SL)instructions$(O) \ + $(IMCC_DIR_SL)cfg$(O) \ + $(IMCC_DIR_SL)sets$(O) \ + $(IMCC_DIR_SL)debug$(O) \ + $(IMCC_DIR_SL)optimizer$(O) \ + $(IMCC_DIR_SL)pbc$(O) \ + $(IMCC_DIR_SL)parser_util$(O) \ + $(IMCC_DIR_SL)jit$(O) \ + $(IMCC_DIR_SL)pcc$(O) + GENERAL_H_FILES = $(NONGEN_HEADERS) $(GEN_HEADERS) ${cg_h} @@ -113,7 +153,7 @@ IO_O_FILES = io/io$(O) io/io_buf$(O) io/io_unix$(O) io/io_win32$(O) \ io/io_stdio$(O) io/io_passdown$(O) -INTERP_O_FILES = exceptions$(O) global_setup$(O) interpreter$(O) parrot$(O) \ +INTERP_O_FILES = exceptions$(O) global_setup$(O) interpreter$(O) \ register$(O) core_ops$(O) core_ops_prederef$(O) core_ops_switch$(O) \ memory$(O) objects$(O) ${exec_o} \ packfile$(O) stacks$(O) string$(O) sub$(O) encoding$(O) \ @@ -128,7 +168,8 @@ dynext$(O) utils$(O) vtables$(O) mmd$(O) O_FILES = $(INTERP_O_FILES) $(IO_O_FILES) $(CLASS_O_FILES) \ - $(ENCODING_O_FILES) $(CHARTYPE_O_FILES) + $(ENCODING_O_FILES) $(CHARTYPE_O_FILES) \ + $(IMCC_O_FILES) OPS_FILES = ${ops} $(GEN_OPSFILES) @@ -170,8 +211,6 @@ PINFO = pbc_info${exe} PDB = pdb${exe} -IMCC_PROG = languages/imcc/imcc${exe} - # lclint has changed name to splint at v3.0 LINT = splint @@ -201,7 +240,7 @@ .c$(O) : @$(PERL) tools/dev/cc_flags.pl ./CFLAGS $(CC) $(CFLAGS) ${cc_o_out}$@ -c $< -all : flags_dummy $(TEST_PROG) $(IMCC_PROG) docs +all : flags_dummy $(TEST_PROG) docs world: all parrot_utils @@ -216,7 +255,6 @@ $(TEST_PROG) : $(PARROT_MAIN)$(O) $(GEN_HEADERS) $(LIBPARROT) lib/Parrot/OpLib/core.pm $(LINK) ${ld_out}$(TEST_PROG) $(LINKFLAGS) $(PARROT_MAIN)$(O) $(LIBPARROT) $(C_LIBS) - $(PERL) -MExtUtils::Command -e mv $(TEST_PROG) test_main$(EXE) lib_deps_object : $(O_FILES) $(PERL) tools/dev/lib_deps.pl object $(O_FILES) @@ -238,7 +276,13 @@ shared : $(GEN_HEADERS) blib/lib/libparrot$(SO) $(LIBPARROT) static : $(GEN_HEADERS) $(LIBPARROT) +# XXX changes don't always propagate into libparrot +# e.g. when I change debug:fataly to xfataly, nm still shows the old symbol +# and parrot builds fine (except for the unproto warning +# so always delete the lib -leo + $(LIBPARROT) : $(O_FILES) + $(RM_F) $@
[CVS ci] build imcc as parrot - 4: cleanup Test.pm; allow PIR tests in main
I've committed that part directly as it should be totally independent of the immanent changes to the build system. It cleans up some remaining cruft from the old days when assemble.pl happened to be used. More importantly there are now two different ways to run tests through the PIR assembler: From t/op/basic.t: output_is(<<'CODE', <<'OUTPUT', "pir syntax with marker - is"); ##PIR## .sub _main .const string OK = "ok\n" print OK end .end pir_output_is(<<'CODE', <<'OUTPUT', "pir syntax with function - is"); .sub _main .const string OK = "ok\n" print OK end .end "make clean" changes will be done with root.in. leo
Oops
In my last commit I forgot to remove makefiles/root.in from the check in list - and worse, I've checked it out immediately - so that my original is gone. If it doesn't work please undo the changes to makefiles/root.in or leave it - lets just see, how its goes. leo
"::" doesn't work inside an identifier.
According to the CVS log for /languages/imcc/imcc.l, "::" is now allowed inside an identifier name. However, when I try to create an example like: .sub foo::bar end .end It gives the error: error:imcc:parse error, unexpected LABEL, expecting IDENTIFIER Is this a bug, or am I misunderstanding something? - Joe
Re: [perl #24082] [PATCH] parrot-build-3: replaces and obsoletes #24080
On Wed, 1 Oct 2003, Leopold Toetsch wrote: > Thanks to Andy for the feedback - I have replaced that part with a > simpler and probably less gnuish make rule. Thanks. That works better. (I'm now stuck elsewhere, but that's a separate issue.) -- Andy Dougherty [EMAIL PROTECTED]
lvalue casts don't work
Building with Sun's Workshop compiler, I'm currently getting stuck when comiling core_ops.c with the message: "bit.ops", line 349: a cast does not yield an lvalue "bit.ops", line 349: a cast does not yield an lvalue Sure enough, line 349 in bit.ops is ((UINTVAL) $1 >>= $2; I don't know enough about .ops file syntax to suggest a fix offhand. -- Andy Dougherty [EMAIL PROTECTED]
Re: [perl #24038] [PATCH] PIO_parse_open_flags is too lenient
Michael Scott (via RT) <[EMAIL PROTECTED]> writes: > PIO_parse_open_flags thinks that "<" is the same as "<". This > could lead to errors such as using "<<" instead of ">>". I solved the problem with a different patch. Your solution was not easily extendeble with the planned but not implemented "?" and "!" modifieres. bye boe -- Juergen Boemmels[EMAIL PROTECTED] Fachbereich Physik Tel: ++49-(0)631-205-2817 Universitaet Kaiserslautern Fax: ++49-(0)631-205-3906 PGP Key fingerprint = 9F 56 54 3D 45 C1 32 6F 23 F6 C7 2F 85 93 DD 47
Re: "::" doesn't work inside an identifier.
Joseph Ryan wrote: According to the CVS log for /languages/imcc/imcc.l, "::" is now allowed inside an identifier name. However, when I try to create an example like: .sub foo::bar end .end It gives the error: error:imcc:parse error, unexpected LABEL, expecting IDENTIFIER Is this a bug, or am I misunderstanding something? It should have worked, if you had used an underscore in front of the label, but didn't either :) Fixed, tests added, thanks for reporting. - Joe leo
Re: lvalue casts don't work
Andy Dougherty wrote: Building with Sun's Workshop compiler, I'm currently getting stuck when comiling core_ops.c with the message: "bit.ops", line 349: a cast does not yield an lvalue "bit.ops", line 349: a cast does not yield an lvalue Sure enough, line 349 in bit.ops is ((UINTVAL) $1 >>= $2; *(UINTVAL*) $1 should do the trick. leo
[PATCH]
Sun's Workshop compiler complains about the use of a non-constant initializer in the giant vtable initialization in the class_init() functions generated by classes/pmc2c.pl. Here's a sample error message: "array.c", line 649: non-constant initializer: op "NAME" Here's a suggested fix: --- parrot/classes/pmc2c.pl Tue Sep 30 11:00:19 2003 +++ parrot-andy/classes/pmc2c.plWed Oct 1 13:07:12 2003 @@ -751,7 +751,7 @@ struct _vtable temp_base_vtable = { NULL, /* package */ -entry, +NULL, /* base_type -- set to entry below */ NULL, /* whoami */ NULL, /* method_table */ $vtbl_flag, /* flags */ @@ -759,6 +759,7 @@ 0, /* extra data */ $methodlist }; +temp_base_vtable.base_type = entry; /* parrotio calls some class_init functions during its class_init * code, so some of the slots might already be allocated -- Andy Dougherty [EMAIL PROTECTED]
Re: lvalue casts don't work
On Wed, 1 Oct 2003, Leopold Toetsch wrote: > Andy Dougherty wrote: > > > Building with Sun's Workshop compiler, I'm currently getting stuck when > > comiling core_ops.c with the message: > > > > "bit.ops", line 349: a cast does not yield an lvalue > > ((UINTVAL) $1 >>= $2; > *(UINTVAL*) $1 > > should do the trick. Thanks. That lets the compile succeed. I still fail t/op/bitwise test 7; I don't yet know if it's related. I'll need to investigate further. -- Andy Dougherty [EMAIL PROTECTED]
Re: lvalue casts don't work
Andy Dougherty writes: > On Wed, 1 Oct 2003, Leopold Toetsch wrote: > > > Andy Dougherty wrote: > > > > > Building with Sun's Workshop compiler, I'm currently getting stuck when > > > comiling core_ops.c with the message: > > > > > > "bit.ops", line 349: a cast does not yield an lvalue > > > > ((UINTVAL) $1 >>= $2; > > > *(UINTVAL*) $1 > > > > should do the trick. The compiling trick. But that makes me shiver in my boots. *(UINTVAL*) &$1 Luke > Thanks. That lets the compile succeed. I still fail t/op/bitwise test 7; > I don't yet know if it's related. I'll need to investigate further. > > -- > Andy Dougherty[EMAIL PROTECTED]
[perl #24087] languages/imcc/t/syn/macro.t test 17 failing on Mac OS X
# New Ticket Created by Jeff Clites # Please include the string: [perl #24087] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt2/Ticket/Display.html?id=24087 > I'm getting a crash on Mac OS X on test 17 of languages/imcc/t/syn/macro.t, which is trying to detect an unterminated macro. I don't see the problem right off, but here's the backtrace, in case the problem is obvious to someone more familiar with this section of the code: Program received signal EXC_BAD_ACCESS, Could not access memory. 0x9e60 in strlen () (gdb) bt #0 0x9e60 in strlen () #1 0xef6c in str_dup (old=0x7b3000 ) at imc.c:1025 #2 0xb214 in yylex_skip (valp=0xb2f4, interp=0x73e400, skip=0x1a65d8 " \n") at languages/imcc/imcc.l:513 #3 0xb2a4 in read_params (valp=0x0, interp=0x73e400, params=0x1ea8b4, macro_name=0x75cb90 "M", need_id=1) at languages/imcc/imcc.l:526 #4 0xb650 in read_macro (valp=0xb434, interp=0x73e400) at languages/imcc/imcc.l:592 #5 0x7ce8 in yylex (valp=0xb434, interp=0x73e400) at languages/imcc/imcc.l:240 #6 0x2eb4 in yyparse (interp=0x73e400) at imcparser.c:1495 #7 0x0001ea20 in main (argc=1, argv=0xbc14) at main.c:470 #8 0x2098 in _start (argc=2, argv=0xbc10, envp=0xbc1c) at /SourceCache/Csu/Csu-45/crt.c:267 #9 0x1f18 in start () JEff
Re: [perl #24080] [PATCH] parrot-build-1: Build parrot incl. imcc files take 1
> I don't know what "info make" "Syntax of Static Pattern Rules" is (since I > don't have info installed on my Solaris system) but I'm guessing that > whatever it is, it's the underlying cause for Solaris make to complain: info is the texinfo doc reader, generally used for GNU documentation.. thus it's the documentation for GNU make. (We probably could simplify things by requiring GNU make.. but I'm not going to start that now.) -R