[Top][All Lists]

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

A beginner's question

From: Rudolf Schubert
Subject: A beginner's question
Date: Fri, 7 Apr 2023 11:52:57 +0200 (CEST)


        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:

        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 (0x00007ffe00770000) => /usr/lib/ (0x00007fcb2ca00000) => /usr/lib/ (0x00007fcb2c918000) => /usr/lib/ (0x00007fcb2cc9f000) => /usr/lib/ (0x00007fcb2c731000)
        /lib64/ => /usr/lib64/ 

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?


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

reply via email to

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