'Gcc-4.8 compilation issue in ubuntu-20.04lts docker
I'm trying to compile gcc-4.8 in ubuntu-20.04 docker using below dockerfile.
# Pull base image.
FROM ubuntu:20.04
..............
...................
........................
## Get gcc 4.8.5 and build it
RUN wget http://mirror.keystealth.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz \
&& tar xzf gcc-4.8.5.tar.gz && \
cd gcc-4.8.5 && \
./contrib/download_prerequisites && \
cd .. && mkdir gccbuild && cd gccbuild && \
../gcc-4.8.5/configure \
--prefix="/opt/gcc" \
--enable-shared --with-system-zlib --enable-threads=posix \
--enable-__cxa_atexit --enable-checking --enable-gnu-indirect-function \
--enable-languages="c,c++" --disable-bootstrap \
&& make all && make install
When i build the image, make all shows below error message.
In file included from ../../gcc-4.8.5/gcc/cp/except.c:1008: cfns.gperf:101:1: error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline with 'gnu_inline' attribute cfns.gperf:26:14: note: 'const char* libc_name_p(const char*, unsigned int)' previously declared here cfns.gperf:26:14: warning: inline function 'const char* libc_name_p(const char*, unsigned int)' used but never defined make[2]: Leaving directory '/gccbuild/gcc' make[2]: *** [Makefile:1059: cp/except.o] Error 1 make[1]: Leaving directory '/gccbuild' make[1]: *** [Makefile:3920: all-gcc] Error 2 make: *** [Makefile:865: all] Error 2 The command '/bin/sh -c wget http://mirror.keystealth.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz && tar xzf gcc-4.8.5.tar.gz && cd gcc-4.8.5 && sed -i 's/ftp/http/g' contrib/download_prerequisites && ./contrib/download_prerequisites && cd .. && mkdir gccbuild && cd gccbuild && ../gcc-4.8.5/configure --prefix="/opt/gcc" --enable-shared --with-system-zlib --enable-threads=posix --enable-__cxa_atexit --enable-checking --enable-gnu-indirect-function --enable-languages="c,c++" --disable-bootstrap && make all && make install' returned a non-zero code: 2
I need this particular OS and GCC version to build our old source code. Looking for any suggestions to install Gcc-4.8 in ubuntu-20.04-LTS.
Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
