gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Potential woe with gm2-4.1.2


From: Gaius Mulley
Subject: Re: [Gm2] Potential woe with gm2-4.1.2
Date: Tue, 08 Oct 2013 15:32:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Gaius Mulley <address@hidden> writes:
> john o goyo <address@hidden> writes:
>
>> On 7 Oct 2013, at 16:08, Gaius Mulley responded (in part):
>>> Hi John,
>>>
>>> the source of gm2 was not changed - I just changed the .deb package.
>>> I'm currently trying to rebuild it again - to fix the .deb package
>>> such
>>> that it copies the crt0.o (and friends) into the gm2 directories.
>>> No gm2 code has changed since 2013-01-09 (on the 4.1.2 branch).
>>>
>>> The newer package - when done should install cleanly on Ubuntu 13.04
>>> or
>>> Mint 14 (hopefully 15 as well)
>>
>> Okay but that has no effect on me -- I do not use Linux.
>>
>> My woe is that the initialization part of the main module is not
>> called.  A function call appears in the C++ debug file source but not
>> in the object module.
>>
>> I have not been able to use gm2 for the last few releases so I do not
>> know when this went awry.  I also recall this happening years ago but
>> I did not record it.
>>
>> john
>
> Hi John,
>
> just for drilling down, given:
>
> MODULE hello ;
>
> FROM libc IMPORT printf ;
>
> BEGIN
>    printf ("hello world\n")
> END hello.
>
> even this is not visible in the: hello.o file ?   Or have I misunderstood?
>
> regards,
> Gaius

for example on my system I get the following:

$ cat chello.mod 
MODULE chello ;

FROM libc IMPORT printf ;

BEGIN
   printf("hello world\n")
END chello.

$ export PATH=/usr/bin:$PATH
$ gm2 --version
GNU Modula-2  1.0.5  (20131007)
  grafted onto GCC 4.1.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv2: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ gm2 -g -c chello.mod
$ nm chello.o
0000000000000028 T _M2_chello_finish
0000000000000000 T _M2_chello_init
0000000000000000 b _T25
0000000000000008 b _T26
                 U __gxx_personality_v0
                 U printf


$ gm2 -g -S chello.mod
$ cat chello.s

  ... lots of stuff removed ...

.globl _M2_chello_init
        .type   _M2_chello_init, @function
_M2_chello_init:
.LFB3:
        .file 1 "chello.mod"
        .loc 1 22 0
        pushq   %rbp
.LCFI0:
        movq    %rsp, %rbp
.LCFI1:
        .loc 1 23 0
        movq    $.LC0, _T25(%rip)
        movq    _T25(%rip), %rdi
        movl    $0, %eax
        call    printf
        movl    %eax, _T26(%rip)
        .loc 1 24 0
        leave
        ret

regards,
Gaius



reply via email to

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