Right now the gcc and g++ on my ubuntu 15.10 machine is version 5.2.1. I need to install v4.4 of them for some reason. I downloaded the source code of gcc4.4.7 and configure with this:
../configure \
--disable-checking \
--enable-languages=c,c++ \
--enable-multiarch \
--enable-shared \
--enable-threads=posix \
--program-suffix=4.4 \
--with-gmp=/usr/local/lib \
--with-mpc=/usr/local/lib \
--with-mpfr=/usr/local/lib \
--without-included-gettext \
--with-system-zlib \
--with-tune=generic \
--prefix=$HOME/bin/android_build
I got a makefile and try make but I receive these two errors:
../../gcc/toplev.c:536:1: error: redefinition of ‘floor_log2’
../../gcc/toplev.c:571:1: error: redefinition of ‘exact_log2’
So how to solve this problem? Thanks.
I tried to install
gcc 4.4.7, too, with a newergccversion. I've seen the same errors as you. According to this bug report, the problem comes from the flag-fno-gn89-inline, which became the default flag for handling inline functions on newergccversions. As ofgcc 4.3, the default was-fgnu89-inline. So all you need to do, is set the-fgnu89-inlineflag when compiling.I tried this with
but I still get the same error. I assume the flags do not get properly forwarded, but I don't know. Then I tried a normal
and changed the two lines in the
Makefilefromto
With this, I didn't see the errors any more.
However, I ran into other errors:
They are caused by a newer version of
texinfo, so what you could do is using an older version oftexinfo. Maybe you could also fix them by hand, I tried it for one case, but I don't know what I'm doing so I didn't follow this path.Long story short, I guess you are better off by running a virtual machine or a docker image.