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

IMCC Changes necessary for Win32 builds

5 views
Skip to first unread message

Clinton A. Pierce

unread,
Mar 27, 2003, 11:30:26 AM3/27/03
to perl6-i...@perl.org, Leopold Toetsch
Many of these seem to be from "generated" files, so I'd rather let a
proper, knowledgable maintainer take care of these. They are:

s/CONST/CONSTX/ anywhere in the parser & lexer. Keeps Win32 headers happy
as previously mentioned.

Index: imcparser.h
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/imcparser.h,v
retrieving revision 1.28
diff -r1.28 imcparser.h
51c51
< CONST = 274,
---
> CONSTX = 274,
113c113
< #define CONST 274
---
> #define CONSTX 274


Index: imcparser.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/imcparser.c,v
retrieving revision 1.38
diff -r1.38 imcparser.c
69c69
< CONST = 274,
---
> CONSTX = 274,
131c131
< #define CONST 274
---
> #define CONSTX 274
876c876
< "ENDNAMESPACE", "CLASS", "ENDCLASS", "SYM", "LOCAL", "CONST", "PARAM",
---
> "ENDNAMESPACE", "CLASS", "ENDCLASS", "SYM", "LOCAL", "CONSTX", "PARAM",

Index: imclexer.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/imclexer.c,v
retrieving revision 1.32
diff -r1.32 imclexer.c
1055c1055
< return(CONST);
---
> return(CONSTX);


The one "C" language problem:
Index: imc.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/imc.c,v
retrieving revision 1.45
diff -r1.45 imc.c
431a432
> 1;

MS's nmake isn't happy with the makefile at all. First:
C:\projects\perl\parrot\languages\imcc>nmake
Microsoft (R) Program Maintenance Utility Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1073: don't know how to make 'FORCE'
Stop.

Removing the .FORCE references gets me something that builds objects.

Once the objects are built though, it goes a little nuts trying to do the
link. Hundreds of :

Microsoft (R) Program Maintenance Utility Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
cd ../.. && nmake

followed by hundreds of:

NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

I suspect something's trying to make one of the OFILES at the bottom, which
should already be in there (I removed the OFILES dependancy from imcc
temporarily). I'm not really sure what it's trying to do.

Further corrections (this is currently empty, and shouldn't be):

PARROTLIB = blib/lib/libparrot.lib

And manually building with "nmake shared" at the parrot level satisfy this
requirement. Then I'm down to link errors at the end of the imcc linking:

Microsoft (R) Program Maintenance Utility Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
link -out:imcc -nologo -nodefaultlib -release -machine:x86
imcparser.obj imclexer.obj
imc.obj stacks.obj symreg.obj instructions.obj cfg.obj sets.obj
debug.obj optimizer.obj pbc.o
bj main.obj parser_util.obj jit.obj ../../blib/lib/libparrot.lib
oldnames.lib kernel32.lib user
32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib netap
i32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib
odbccp32.lib msvcrt.lib
imclexer.obj : error LNK2019: unresolved external symbol
_mem_sys_allocate_zeroed referenced in
function _new_frame
pbc.obj : error LNK2019: unresolved external symbol
_mem_sys_allocate_zeroed referenced in funct
ion _store_str_const
imclexer.obj : error LNK2019: unresolved external symbol _mem_sys_free
referenced in function _d
estroy_frame
optimizer.obj : error LNK2019: unresolved external symbol _mem_sys_free
referenced in function _
subst_constants
pbc.obj : error LNK2001: unresolved external symbol _mem_sys_free
main.obj : error LNK2001: unresolved external symbol _mem_sys_allocate
imclexer.obj : error LNK2019: unresolved external symbol _mem_sys_allocate
referenced in functio
n _yylex
instructions.obj : error LNK2001: unresolved external symbol _mem_sys_allocate
optimizer.obj : error LNK2019: unresolved external symbol _mem_sys_allocate
referenced in functi
on _unused_label
pbc.obj : error LNK2001: unresolved external symbol _mem_sys_allocate
pbc.obj : error LNK2019: unresolved external symbol _Parrot_on_exit
referenced in function _e_pb
c_open
pbc.obj : error LNK2019: unresolved external symbol
_PackFile_Segment_new_seg referenced in func
tion _make_jit_info
pbc.obj : error LNK2019: unresolved external symbol
_PackFile_FixupTable_new_entry_t0 referenced
in function _store_labels
pbc.obj : error LNK2019: unresolved external symbol _string_make referenced
in function _add_con
st_str
parser_util.obj : error LNK2001: unresolved external symbol _string_make
pbc.obj : error LNK2019: unresolved external symbol _PDB_extend_const_table
referenced in functi
on _add_const_str
pbc.obj : error LNK2019: unresolved external symbol
_PackFile_Constant_unpack_key referenced in
function _add_const_key
pbc.obj : error LNK2019: unresolved external symbol _Parrot_new_debug_seg
referenced in function
_e_pbc_emit
pbc.obj : error LNK2019: unresolved external symbol _mem_sys_realloc
referenced in function _e_p
bc_emit
main.obj : error LNK2019: unresolved external symbol _Parrot_exit
referenced in function _main
main.obj : error LNK2019: unresolved external symbol _PackFile_pack
referenced in function _main
main.obj : error LNK2019: unresolved external symbol _PackFile_pack_size
referenced in function
_main
main.obj : error LNK2019: unresolved external symbol _PackFile_new
referenced in function _main
parser_util.obj : error LNK2019: unresolved external symbol
_Parrot_switch_to_cs referenced in f
unction _imcc_compile
parser_util.obj : error LNK2019: unresolved external symbol
_Parrot_new_eval_cs referenced in fu
nction _imcc_compile
parser_util.obj : error LNK2019: unresolved external symbol
_Parrot_new_eval_cs referenced in fu
nction _imcc_compile
parser_util.obj : error LNK2019: unresolved external symbol _Parrot_compreg
referenced in functi
on _register_compilers
parser_util.obj : error LNK2019: unresolved external symbol _pmc_new
referenced in function _reg
ister_compilers
parser_util.obj : error LNK2019: unresolved external symbol _key_new_string
referenced in functi
on _get_pmc_num
jit.obj : error LNK2019: unresolved external symbol _op_jit referenced in
function _allocate_jit
imcc : fatal error LNK1120: 21 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.

Which I suspect is something's missing out of libparrot and I'm willing to
take suggestions at this point to get the link to finish.


Clinton A. Pierce

unread,
Mar 28, 2003, 9:35:12 AM3/28/03
to perl6-i...@perl.org
[I will confess, I don't entirely understand Microsoft's linker and DLL
business. Don't really want to...]

Parrot
-------------
libparrot.lib gets built as some kind of perverted stub of a library using
the "nmake shared" target for parrot. If instead I build libparrot with:

lib -out:blib\lib\libparrot.lib [objects......]

I get a 5MB libparrot.lib chock full of symbols and other nonsense I need
later.


IMCC
-------------
The target for Win32 needs to be "imcc.exe", not "imcc".

Now that I have a working IMCC.... I should consider how to make a binary
Win32 bundle.

Suggestions on what needs to be included? Should I just strip out
*.[dll,obj,lib] and distribute that? Considering that this really isn't a
consumer-ready type of application should the source, docs, intermediate
files, etc.. be in the bundle?


0 new messages