gm2
[Top][All Lists]
Advanced

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

Fwd: A beginner's question


From: Michael Riedl
Subject: Fwd: A beginner's question
Date: Fri, 7 Apr 2023 15:21:01 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

Hallo Rudolf,

perhaps a good idea to share some code you made some modifications on "to work around errors I suspect might be caused by GM2".

I remember I had some (small) issues at the beginning porting code from XDS Modula-2 to GM2 in a similar situation. So I hope I can help out at least in some cases. For example GM2 is more strict with type compatibility - I detected some issues I was never aware about at that time... But now I can compile with both compilers (and AWD M2) with close to zero modifications. Do not know GPM but "we will get that fixed" :-)

Gruß

Michael

Am 07.04.23 um 11:52 schrieb Rudolf Schubert:
          Hi,

          I'm about porting an old Programm developped with Gardens Point 
Modula-2
          (GPM) and facing a few problems. But before I possibly ask silly
          questions I'd like to know how I can make sure to use the latest
          version of GM2.

          I'm working on a (current) Arch Linux with this gcc version:
          gcc (GCC) 12.2.1 20230201

          I started with the instructions found here:
          https://www.nongnu.org/gm2/12/development.html

          The idea was to have a local installation directory, so my
          configure command was this:

          ../gcc-git-devel-modula2/configure --prefix=<some_local_inst_dir> 
--enable-languages=default,m2 --enable-libgm2

          But during 'make install' I got this error:

          /usr/bin/ld: build/genmodes.o: relocation R_X86_64_32S against 
`.rodata' can not be used when making a PIE object; recompile with -fPIE

          So finally I changed my configure command:

          ../gcc-git-devel-modula2/configure --prefix=<some_local_inst_dir> 
--with-system-zlib --enable-default-pie --enable-default-ssp 
--enable-languages=default,m2 --enable-libgm2

          and could easily compile the famous hello.mod:

          <some_local_inst_dir>/bin/gm2 -g hello.mod

          ldd showed this:

rudolf@archkiste: /mo1/more_homedata/lern/gpm_gm2 $ ldd a.out
          linux-vdso.so.1 (0x00007ffe00770000)
          libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fcb2ca00000)
          libm.so.6 => /usr/lib/libm.so.6 (0x00007fcb2c918000)
          libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fcb2cc9f000)
          libc.so.6 => /usr/lib/libc.so.6 (0x00007fcb2c731000)
          /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 
(0x00007fcb2cd0e000)

rudolf@archkiste: /mo1/more_homedata/lern/gpm_gm2 $ ./a.out
hello world

          This was the easy part. Then I tried compiling my 'big' programm
          which I wanted to port but did  not succeed. I played around a bit
          but with no success. Again I saw 'PIE' in some messages and I
          guessed if the problem might be that my Arch system does not use
          PIE but GM2 was now compiled with PIE and that this will go wrong.

          So I installed a Debian sid with gm2 in a virtual machine (BTW,
          gm2 --version says this: gm2 (Debian 12.2.0-14) 12.2.0) and with
          this installation I am now finally able to compile and run a
          modified version of my 'big' programm.

          The modifications I made were to work around errors I suspect
          might be caused by GM2. When using GPM, however I do not need
          to use these workarounds! But I'm not sure if GM2 in Debian sid
          really is the latest version. So I first want to make sure I'm
          using the latest version. And thus my question simply is:

          How will I do this?
BR

Rudolf


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





reply via email to

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