[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] gm2 make errors?
From: |
Charles Bradshaw |
Subject: |
Re: [Gm2] gm2 make errors? |
Date: |
Fri, 09 May 2014 11:32:25 +0100 |
On Fri, 2014-05-09 at 00:08 +0100, Charles Bradshaw wrote:
> On Thu, 2014-05-08 at 18:57 +0100, Gaius Mulley wrote:
> > Charles Bradshaw <address@hidden> writes:
> >
> > > I'm trying to compile gm2. I compiling under Fedora 17 using gcc version
> > > 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC)
> > >
> > > I followed the yellow brick road:
> > >
> > > http://floppsie.comp.glam.ac.uk/download/c/gcc-4.7.3
> > > +gm2-git-latest.tar.gz
> > > tar zvxf gcc-4.7.3+gm2-git-latest.tar.gz
> > > cd gcc-4.7.3+gm2-git-latest/gm2
> > > sh ./combine-trees
> > > cd gcc-versionno
> > > mkdir objdir
> > > cd objdir
> > > mkdir /home/brad/gcc
> > > ../configure --prefix=/home/brad/gcc
> > >
> > > Until this error from make:
> > >
> > > $ make
> > > ....
> > > ../../gcc/gcc.c: In function ‘int main(int, char**)’:
> > > ../../gcc/gcc.c:6366:33: error: ‘lang_register_spec_functions’ was not
> > > declared in this scope
> > >
> > > I tried adding the following to gcc.c
> > > extern void lang_register_spec_functions (void);
> > >
> > > But now I see the following:
> > >
> > > gcc.o: In function `main':
> > > gcc.c:(.text.startup+0x4f9): undefined reference to
> > > `lang_register_spec_functions()'
> > > collect2: error: ld returned 1 exit status
> > >
> > > This looks like something to do with Gaius Mulleys patches for gm2 but
> > > my C is inadequate.
> > >
> > > How can I fix the problem?
> > >
> > > TIA Charles Bradshaw
> >
> > Hi Charles,
> >
> > please can you post the complete build log. Are you building using
> > more options to configure ie something along these lines?
> >
> > regards,
> > Gaius
> >
> > ps. please read through the script especially the "rm -rf" line !
> >
> >
> > #!/bin/bash
> >
> > export PATH=/usr/bin:$PATH
> >
> > LANGUAGES=c,c++,gm2
> > cd $HOME/GM2
> >
> > GCC=$1
> >
> > if [ "${GCC}" == "" ] ; then
> > echo "You must specify which gcc release you want to download,
> > currently supported are: 4.1.2 and 4.7.3"
> > exit 1
> > fi
> >
> > if [ ! -d $HOME/GM2 ] ; then
> > echo "no $HOME/GM2 found"
> > exit 1
> > fi
> >
> > echo path set to ${PATH}
> > echo "press enter to continue if the path is correct"
> > read ans
> >
> > rm -rf scratch-area
> > mkdir scratch-area
> > cd scratch-area
> >
> > if ! wget
> > http://floppsie.comp.glam.ac.uk/download/c/gcc-${GCC}+gm2-git-latest.tar.gz
> > ; then
> > echo "unable to download gm2 grafted onto gcc-${GCC}"
> > exit 2
> > fi
> >
> > tar zxf gcc-${GCC}+gm2-git-latest.tar.gz
> > find gcc-${GCC}+gm2-git-latest -exec touch {} \; # fix any future file
> > date stamps
> >
> > rm -rf build-${GCC}
> > mkdir build-${GCC}
> > cd build-${GCC}
> >
> > if [ "$GCC" == "4.7.3" ] ; then
> > ../gcc-${GCC}+gm2-git-latest/gm2/gcc-versionno/configure
> > --prefix=$HOME/opt \
> > --enable-languages=${LANGUAGES} \
> > --libexecdir=$HOME/opt/lib --enable-shared \
> > --enable-threads=posix --enable-__cxa_atexit \
> > --enable-clocale=gnu \
> > --disable-multilib --disable-bootstrap \
> > --enable-checking --enable-libgm2
> > fi
> > if [ "$GCC" == "4.1.2" ] ; then
> > CFLAGS=-B/usr/lib/x86_64-linux-gnu
> > export CFLAGS
> > LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
> > export LIBRARY_PATH
> > ../gcc-${GCC}+gm2-git-latest/gm2/gcc-versionno/configure
> > --enable-languages=c,c++,gm2 \
> > --disable-multilib --enable-checking=all --prefix=$HOME/opt
> > fi
> >
> > time ( ( make "SHELL=/bin/bash" && cd gcc && make check-gm2 ) >& build-log
> > < /dev/null ) &
> > sleep 3
> > tail -f build-log
> >
>
> Gaius,
>
> Thanks for your prompt reply.
>
> Your build script throws a whole different light on the problem. Now I
> see the necessary configure options.
>
> Please bear in mind I'm a simple mechanical engineer, having never done
> a compile of this complexity before.
>
> OK I have a successful make.
>
> Then I do
> $ cd GM2/scratch-area/build-4.7.3
> $ make install
>
> ${HOME}/opt is now populated.
>
> $ export ${PATH}:/home/brad/opt/bin
>
> $ cd /home/brad/GM2/scratch-area/gcc-4.7.3
> +gm2-git-latest/gm2/gcc-versionno/gcc/gm2/examples/hello/
>
> $ gm2 -g -I. -fmakeall hello.mod
> /home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3gm2 -c -fmakeall0
> -B/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3 -g -fonlylink
> -fobject-path=. -ftarget-ar=/usr/bin/ar -ftarget-ranlib=/usr/bin/ranlib
> -fmakeall -I. -I/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/gm2/pim
> hello.mod
> make: /home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3gm2: Command not
> found
> make: *** [hello.o] Error 127
>
> Looks like a Makefile.in error. Missing / before gm2 ?
>
> I'm now clueless. What did I miss?
>
> Charles Bradshaw
>
> PS For the record I attach build-log as requested.
>
More info:
I added a -B path to my gm2 .... hello.mod command, as follows, then I
get a different error:
$ gm2 -g -I. -B /home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/gm2
-fmakeall hello.mod
gm2 -c -fmakeall0 -B -g -fonlylink -fobject-path=.
-ftarget-ar=/usr/bin/ar -ftarget-ranlib=/usr/bin/ranlib -fmakeall -I.
-I/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/gm2/pim hello.mod
gm2cc: error trying to exec 'cc1plus': execvp: No such file or directory
A search for execvp produces:
$ locate execvp
/home/brad/GM2/scratch-area/build-4.7.3/i686-pc-linux-gnu/libgcc/_gcov_execvp.dep
/home/brad/GM2/scratch-area/build-4.7.3/i686-pc-linux-gnu/libgcc/_gcov_execvp.o
/usr/lib/perl5/auto/POSIX/execvp.al
I'm clutching at straws with:
$ gm2 -print-search-dirs
install: /home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/
programs:
=/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/../../../../i686-pc-linux-gnu/bin/
libraries:
=/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/../../../../i686-pc-linux-gnu/lib/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/../../../i686-pc-linux-gnu/4.7.3/:/home/brad/opt/lib/gcc/i686-pc-linux-gnu/4.7.3/../../../:/lib/i686-pc-linux-gnu/4.7.3/:/lib/:/usr/lib/i686-pc-linux-gnu/4.7.3/:/usr/lib/
Which produces some very funny looking output, several paths repeated!
Are these deep bugs or am I doing something wrong?