[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Compiling with pim-coroutine
From: |
Johannes von Rotz |
Subject: |
Re: [Gm2] Compiling with pim-coroutine |
Date: |
Tue, 03 Dec 2013 12:55:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130809 Thunderbird/17.0.8 |
On 12/03/2013 11:06 AM, Fischlin Andreas wrote:
> My recommendation if I understood your problem correctly is the following: If
> you have many modules using the types INTEGER{16,32} etc., simply write a
> module such as shown below yourself, where you equate in the definition the
> type to the correct one. E.g.
> Then import in your modules the wanted types from MySystem. Upon port you
> merely need to adjust the definition in MySystem according to the compiler
> (or compiler variant) you use. Anything else is not the business of gm2. Gm2
> has only to provide consistently some 16 and 32 bit integer standard type
> depending on the variant in which you compile your code.
Hello Andreas,
thanks for your reply. Basically, that's what's already done:
DEFINITION MODULE FOR "C" ANSITYP;
FROM SYSTEM IMPORT ADDRESS, CARDINAL32 (* etc. *);
EXPORT UNQUALIFIED machint, machuint, machshort (* etc. *);
TYPE
machint = INTEGER32;
machlong = INTEGER32; (* never mind the actual sizes *)
machshort = INTEGER16;
machuint = CARDINAL32;
machulong = CARDINAL32;
machushort = CARDINAL16;
(* etc. *)
END ANSITYP.
The ANSITYP module is the one preprocessed by vc to insert the
appropriate types for machint etc. It is then imported by the other modules.
The problem is: When I tried to compile the first few modules with gm2
without the pim-coroutine library, it worked just fine with INTEGER32
etc, apart from a few adjustments of course.
The compiler refuses to compile the one module which uses coroutines
with the default pim library, of course, so I switch to
-flibs=pim-coroutine,pim and the whole thing doesn't work anymore.
For example, a module which imports from ANSITYP compiles just fine
using pim only:
$ /opt/gcc-4.1.2+gm2-1.0.4/bin/gm2 -g -c -flibs=pim entryexi.mod
$ echo $?
0
And blows up right in my face when using pim-coroutine:
$ /opt/gcc-4.1.2+gm2-1.0.4/bin/gm2 -g -c -flibs=pim-coroutine,pim
entryexi.mod
/opt/gcc-4.1.2+gm2-1.0.4/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim-coroutine/SYSTEM.def:19:1:
error: unknown symbol 'CARDINAL32' found
/opt/gcc-4.1.2+gm2-1.0.4/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim-coroutine/SYSTEM.def:19:1:
error: unknown symbol 'INTEGER16' found
/opt/gcc-4.1.2+gm2-1.0.4/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim-coroutine/SYSTEM.def:19:1:
error: unknown symbol 'INTEGER32' found
/opt/gcc-4.1.2+gm2-1.0.4/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim-coroutine/SYSTEM.def:19:1:
error: unknown symbol 'CARDINAL16' found
/opt/gcc-4.1.2+gm2-1.0.4/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim-coroutine/SYSTEM.def:118:5:
error: the following symbols are unknown at the end of module
'EntryExit' when requested by another modules import (symbols have not
been exported by the appropriate definition module)
$ echo $?
1
I even tried LONGINT, etc., or INT16, INT32, etc., but that didn't work
either (The latter form is used by M2CC, so this was actually the first
thing I've changed).
So the question probably is: How do I use pim-coroutine correctly so the
elementary data types do not suddenly disappear?
Cheers,
Johannes