gm2
[Top][All Lists]
Advanced

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

Re: Simple program doesn't compile


From: Gaius Mulley
Subject: Re: Simple program doesn't compile
Date: Mon, 09 Nov 2020 10:22:54 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Peter Wiehe <info@pwiehe.de> writes:

> RHYBUDD: Mae'r e-bost hwn yn tarddu o'r tu allan i'r
> sefydliad. Peidiwch รข chlicio dolenni nac agor atodiadau oni bai eich
> bod yn adnabod yr anfonwr ac yn gwybod bod y cynnwys yn ddiogel.
>
> CAUTION: This email originated from outside of the organisation. Do not click 
> links or open attachments unless you recognise the sender and know the 
> content is safe.
>
>
> Hello GNU Modula-2 list!
>
> I have the following program source code:
>
> ------------------
> MODULE Test;
>
> BEGIN
>
> END Test.
> ------------------
>
> It is in test.mod. I type in the shell:
> gm2 -g test.mod
>
> Then I get the following output:
> -----------------------------------
> /usr/bin/ld: /tmp/ccePqjIl.a(wayfarer1_m2.o): in function `init(int, char**)':
> /home/peter/Schreibtisch/dev/Wayfarer 1/wayfarer1_m2.cpp:69: undefined 
> reference to `_M2_Wayfarer1_init'
> /usr/bin/ld: /tmp/ccePqjIl.a(wayfarer1_m2.o): in function `finish()':
> /home/peter/Schreibtisch/dev/Wayfarer 1/wayfarer1_m2.cpp:80: undefined 
> reference to `_M2_Wayfarer1_finish'
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/m2/m2pim/libm2pim.so: undefined 
> reference to `RTco_select'
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/m2/m2pim/libm2pim.so: undefined 
> reference to `RTco_initSemaphore'
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/m2/m2pim/libm2pim.so: undefined 
> reference to `RTco_wait'
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/m2/m2pim/libm2pim.so: undefined 
> reference to `RTco_signal'
> collect2: error: ld returned 1 exit status
> -------------------------------
> I use gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> and gm2 (Ubuntu 10.2.0-5ubuntu1~20.04) 10.2.0
>
> What can I do to get the program compiled?
>

Hi Peter,

many thanks for the bug report!  Yes this looks like a bug - you might
be able to work around this by forcing the linker to include RTco using:

gm2 -fruntime-modules=Storage,SYSTEM,M2RTS,RTExceptions,IOLink,RTco Test.mod

However on:

$ gm2 --version
gm2 (GCC) 10.2.1 20200915

this appears to work:

$ cat minimal.mod
MODULE minimal ;

BEGIN

END minimal.

$ gm2 minimal.mod
./a.out
$

it might be worth upgrading to 10.2.1 if possible?


regards,
Gaius



reply via email to

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