[Top][All Lists]

[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 12:43:47 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

Rudolf, Gaius,

would it not be an option to first use a pre-compiled package (e.g. to see if there are no issues "in general" with the installation ? And, if this is going to work, dive deeper in the building of an very actual compiler in a second step ?

Rudolf, did you try to compile a short "C" program, just as an example, to see if at least this is well behaved ? I had some issues in the past when installing

GM2 in a more actual version than the "default" gcc - just to exclude these types of issues.



Am 08.04.23 um 12:29 schrieb Rudolf Schubert:
Hi Gaius,

I tried to follow your hints as closely as possible but in the very end
when I try to compile a simple test program I get a very simalar error
message than I got previously:

/usr/bin/ld: /tmp/cciW0QG5.o: in function `_M2_link':
port_test_gm2.mod:(.text+0x16d5): undefined reference to `_M2_wraptime_ctor'
collect2: error: ld returned 1 exit status

'Previously' means: as mentioned, I followed the instructions at

and managed to build a gm2 in some local installation directory on my
Arch Linux system. But when using this I got this error message:

/usr/bin/ld: /tmp/cc0s2CjZ.o: warning: relocation against `_M2_wraptime_ctor' 
in read-only section `.text'
/usr/bin/ld: /tmp/cc0s2CjZ.o: in function `_M2_link':
port_test_gm2.mod:(.text+0x1a03): undefined reference to `_M2_wraptime_ctor'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE

BTW, was it to be expected that the

make m2/stage2/cc1gm2

in your script just did nothing because I got the message that
there was no rule in the Makefile?

The difference between my two installations is:

the latter is on my Arch Linux and the former is on Debian sid. It seems that
on both platforms there is some basic problem so that linking does not work.
The warning on my Arch Linux does indicate that this is something with 'PIE'.

Perhaps I've also missed some configuration steps or something? So my question
would be:

Whats steps exactly will I have to do in order to get a running gm2 from
the gcc sources at git:// Do you also use Debian sid
or a different version? Will I need some special prerequisites? BTW, I'm
using the 4 packages mpfr, mpc, isl, gmp from my system and did not download
these into the gcc tree. I hope this would not make the difference?



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

On Fri, 7 Apr 2023, Gaius Mulley wrote:

Rudolf Schubert <> writes:

Hi Rudolf and Benjamin,

My 'real' problems go a bit 'deeper' but before I wanted to go in too
much detail I first wanted to make sure I'm really using the latest
version of GM2. I don't want to bore peeple with old stuff which is
not relevant any more;-)
the latest gm2 in source form is available via:

   $ git clone git://

note that GCC-13 is about to be released (somewhere within 0-3 weeks).
However gm2-13 is significantly different to gm2-12 (linking options and
many bug fixes).  The RTExceptions bug for example was fixed around 6
weeks ago iirc in GCC-13.

On a Debian system (if I need a fast build then) I build it with the
script included at the end.  Please read and adapt - it will remove the
$HOME/opt directory - and probably do other bad things - but the
configure arguments should be useful at least :-)






# INSTALLDIR=opt-lto
# MAKEFLAGS=profiledbootstrap-lean
# CONFIGFLAGS=--with-build-config=bootstrap-lto-lean

if [ $# -gt 1 ]; then
    echo "configure with ${CONFIGFLAGS}"
    echo "press enter to confirm"
    read ans

if [ $# -eq 0 ]; then
    CPUS="-j ${MAXCPU}"
    CPUS="-j $*"

pushd $HOME/opt && rm -rf bin  include  lib  lib32  lib64  libexec  share && 

echo "download prereq"
pushd ${REPRODIR}

if [ ${REGEN_CONFIGURE} -eq 1 ] ; then
     echo "regenerating configuring files"
     chmod 755 rebuild-autofiles
     if ! ./rebuild-autofiles ${REPRODIR} ; then
        echo "failed to reconfigure"
        exit 1
     echo "after reconfigure"
     echo "not regenerating configuring files"

rm -rf build ; mkdir build ; cd build ; CFLAGS="-O0 -g" CXXFLAGS="-O0 -g" 
../gcc-read-write/configure \
                                            --enable-languages=${LANGUAGES} \
--enable-checking \
                                            --disable-bootstrap \
                                            ${CONFIGFLAGS} \
if make ${CPUS} ${MAKEFLAGS} ; then
     cd gcc
     if make m2/stage2/cc1gm2 ; then
         echo "built stage2 as well with full debugging"
         echo "failed to build m2/stage2/cc1gm2"
         exit 1
     cd ..
     make check-m2 ${CPUS}
     make install
     echo "make failed"

reply via email to

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