[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A beginner's question

From: Michael Riedl
Subject: Re: A beginner's question
Date: Sat, 8 Apr 2023 22:15:54 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:102.0) Gecko/20100101 Thunderbird/102.9.0


about the interfacing with "C" I can most probably help out. I wrote several interfaces for Fortran code

but also for "C" based libraries. I even managed to call free Pascal (fpc) code from Modula-2. If I am right only for 32 bit code, but

anyhow - I am optimistic :-)

Send me mail what your would like to interface and I look in my "repertoire" for a most similar sample to give you some guidance.


Am 08.04.23 um 21:31 schrieb Rudolf Schubert:
Hi Gaius,

your script you sent in the other post was very helpful! There was
a minor 'surprise' with command

cd ../tests

because I did not have that directory but I could work around this;-)

A 'gm2 --version' prints: 'gm2 (GCC) 13.0.1 20230408 (experimental)'
as it should be. The tests are also running: I found that I did not
have dejagnu installed before! Also the famous hello.mod is compiling
and running fine. So this was the good news.

The bad news is that my 'big' programm shows an internal compiler error.
It goes like this:

/mnt/hgfs/mo1/lfs50_von_20190312/home/rudolf/lern/gpm_gm2/squash1/wrk_gm2_02 $ 
cc -c unix.c
gm2 -fiso -c Ctv2.mod
gm2 -fiso -fsoft-check-all squash1.mod Ctv2.o unix.o -o squash1 -lc -lcrypt -lm
terminate called after throwing an instance of 'unsigned int'
*** WARNING *** there are active plugins, do not report this as a bug unless 
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH                    | m2rte
In function ‘welche_tabelle’:
cc1gm2: internal compiler error: Abgebrochen
0xea857f crash_signal
0x7fe53b8a89ba __gnu_cxx::__verbose_terminate_handler()
0x7fe53b8b7f79 __cxxabiv1::__terminate(void (*)())
0x7fe53b8b7fe4 std::terminate()
0x7fe53b8b8236 __cxa_throw
0x9951b6 InvokeHandler
0x9951b6 RTExceptions_Raise
0x995278 invalidloc
0x8cd7b6 contains_struct_check(tree_node*, tree_node_structure_enum, char 
const*, int, char const*)
0x8cd7b6 m2statement_BuildAssignmentTree
0x90898d CodeBecomes
0x908ef8 CodeStatement
0x90aea6 M2GenGCC_ConvertQuadsToTree
0x933bba M2Scope_ForeachScopeBlockDo
0x8f1fc4 M2Code_CodeBlock
0x8e013a Lists_ForeachItemInListDo
0x8f20d6 M2Code_CodeBlock
0x8f247a DoCodeBlock
0x8f247a M2Code_Code
x8f32b1 Compile
Please submit a full bug report, with preprocessed source (by using 
Please include the complete backtrace with any bug report.
See <> for instructions.

The question now is how we should best proceed here. I think playing some
ping pong between us is a waste of time. Therefore I make a proposal to you:

If you do not laugh too loud about my programm I can send you all files
so you may do with them what you want. I've put them on my page anyway
and I don't care what people are doing with them. They might even port
the software to GM2;-) Although it looks like MODULA code it's not very
MODULAr because I packed everything into mainly one mod-file.  Well a
little ctv-file (constants, types, variables) is also there and a small
C-Interface. GPM did not know much about signals at the time I wrote
this thing.

BTW, concerning C-Interface I might also need some 'further training'. I
did not quite get how parameter passing is working with open arrays 'normally'.
I'm using '...' mainly because there I found my parameters easily.
Specifically I could not find the HIGH value. It seemed that just
ramdom values were there. But this is another story we could talk about
another time.



Rudolf Schubert                 \
Kirchstr. 18a                    \
82054 Sauerlach                   >
Deutschland                      /
Tel. 08104/908311               /

On Sat, 8 Apr 2023, Gaius Mulley wrote:

Rudolf Schubert <> writes:

Hi Gaius,

ah, there are two things which come to my mind:

1. I did not take care of PATH and LD_LIBRARY_PATH. These might be
important so that not the system libs are used. Might well be the
reason for the linking error I see.

2. When working with the 'original' gcc sources from
git:// Do I still have to

git checkout devel/modula-2

as they explain at

or would this just mess up things? I was still checking out
devel/modula-2 and perhaps I should not do this any more?
Hi Rudolf,

ah yes - the devel/modula-2 will checkout the code from last November
(pre merge).  The PATH and LD_LIBRARY_PATH are only set post successful
build and install of gm2/gcc (see the build log in the other email for

hope this helps,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]