gm2
[Top][All Lists]
Advanced

[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

Rudolf,

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.

Michael

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:

rudolf@debian: 
/mnt/hgfs/mo1/lfs50_von_20190312/home/rudolf/lern/gpm_gm2/squash1/wrk_gm2_02 $ 
./mach_squash1
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
         ../../gcc-read-write/gcc/toplev.cc:314
0x7fe53b8a89ba __gnu_cxx::__verbose_terminate_handler()
         ../../../../gcc-read-write/libstdc++-v3/libsupc++/vterminate.cc:95
0x7fe53b8b7f79 __cxxabiv1::__terminate(void (*)())
         ../../../../gcc-read-write/libstdc++-v3/libsupc++/eh_terminate.cc:48
0x7fe53b8b7fe4 std::terminate()
         ../../../../gcc-read-write/libstdc++-v3/libsupc++/eh_terminate.cc:58
0x7fe53b8b8236 __cxa_throw
         ../../../../gcc-read-write/libstdc++-v3/libsupc++/eh_throw.cc:98
0x9951b6 InvokeHandler
         m2/gm2-libs-boot/RTExceptions.c:484
0x9951b6 RTExceptions_Raise
         m2/gm2-libs-boot/RTExceptions.c:946
0x995278 invalidloc
         m2/gm2-libs-boot/RTExceptions.c:755
0x8cd7b6 contains_struct_check(tree_node*, tree_node_structure_enum, char 
const*, int, char const*)
         ../../gcc-read-write/gcc/tree.h:3653
0x8cd7b6 m2statement_BuildAssignmentTree
         ../../gcc-read-write/gcc/m2/gm2-gcc/m2statement.cc:169
0x90898d CodeBecomes
         m2/gm2-compiler-boot/M2GenGCC.c:4428
0x908ef8 CodeStatement
         m2/gm2-compiler-boot/M2GenGCC.c:1756
0x90aea6 M2GenGCC_ConvertQuadsToTree
         m2/gm2-compiler-boot/M2GenGCC.c:8449
0x933bba M2Scope_ForeachScopeBlockDo
         m2/gm2-compiler-boot/M2Scope.c:661
0x8f1fc4 M2Code_CodeBlock
         m2/gm2-compiler-boot/M2Code.c:512
0x8e013a Lists_ForeachItemInListDo
         m2/gm2-compiler-boot/Lists.c:394
0x8f20d6 M2Code_CodeBlock
         m2/gm2-compiler-boot/M2Code.c:544
0x8f247a DoCodeBlock
         m2/gm2-compiler-boot/M2Code.c:271
0x8f247a M2Code_Code
         m2/gm2-compiler-boot/M2Code.c:475
x8f32b1 Compile
         m2/gm2-compiler-boot/M2Comp.c:223
Please submit a full bug report, with preprocessed source (by using 
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> 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.


BR

Rudolf

--
Rudolf Schubert                 \
Kirchstr. 18a                    \  mailto:rudolf@muc.de
82054 Sauerlach                   > http://www.dose.muc.de
Deutschland                      /
Tel. 08104/908311               /


On Sat, 8 Apr 2023, Gaius Mulley wrote:

Rudolf Schubert <rudolf@muc.de> 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://gcc.gnu.org/git/gcc.git. Do I still have to

git checkout devel/modula-2

as they explain at

https://www.nongnu.org/gm2/12/development.html

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
details),

hope this helps,
regards,
Gaius



reply via email to

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