Page 1 of 1

Downgrade gcc 8.3.1 to gcc 4.8.5 on CENTOS 8 problem

Posted: 2021/05/03 06:13:55
by jing.xie
There are errors when I install gcc 4.8.5 on my machine. Can you help me figure out the problem?

CPU: AMD 5950X (Ryzen 9)
Centos version: CentOS Linux release 8.3.2011
The default gcc version: gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)

Below is what I did
$ dnf install -y gcc texinfo-tex flex zip libgcc.i686 glibc-devel.i686
It shows "Error: Unable to find a match: texinfo-tex"

Then, I dowloaded gcc 4.8.5 files
$ wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz
$tar zxf gcc-4.8.5.tar.gz
$cd gcc-4.8.5
$./contrib/download_prerequisites

$mkdir gcc-build-4.8.5
$cd gcc-build-4.8.5
$../configure --prefix=/usr
$make
Then many "warning" information occur and the final lines are below

-----------------Error Message -----
../../gcc/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space b 203/295
etween literal and string macro [-Wliteral-suffix] 203/295
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ 203/295
^

In file included from ../../gcc/cp/except.c:1008: 207/295
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inli 208/295
ne with ‘gnu_inline’ attributeh=] 209/295
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously decla 209/295
red here 210/295
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int 211/295
)’ used but never defined 212/295
make[3]: *** [Makefile:1059: cp/except.o] Error 1 213/295
make[3]: Leaving directory '/home/Software/gcc-4.8.5/gcc-build-4.8.5/gcc' bool, boo 214/295
make[2]: *** [Makefile:4163: all-stage1-gcc] Error 2 215/295
make[2]: Leaving directory '/home/Software/gcc-4.8.5/gcc-build-4.8.5'h=] 216/295
make[1]: *** [Makefile:23565: stage1-bubble] Error 2 217/295
make[1]: Leaving directory '/home/Software/gcc-4.8.5/gcc-build-4.8.5' 217/295
make: *** [Makefile:892: all] Error 2
---------------------------------------------------

Re: Downgrade gcc 8.3.1 to gcc 4.8.5 on CENTOS 8 problem

Posted: 2021/05/03 10:17:30
by jlehtone
jing.xie wrote:
2021/05/03 06:13:55
when I install gcc 4.8.5 on my machine
Why do you try to do that?

Re: Downgrade gcc 8.3.1 to gcc 4.8.5 on CENTOS 8 problem

Posted: 2021/05/03 14:52:24
by TrevorH
If you want gcc 4.8.5 then use CentOS 7 where it is the default compiler. It doesn't exist on CentOS 8.

Re: Downgrade gcc 8.3.1 to gcc 4.8.5 on CENTOS 8 problem

Posted: 2021/05/04 01:25:41
by jing.xie
Thanks for you answer.
I bought AMD 5950X cpu and install CENTOS 7 was failed and install CENTOS 8 succeeded. But the software I would like to use seems to denpend on the version of gcc.
Do you know a way to install CENTOS 7 on AMD 5950X cpu?

Re: Downgrade gcc 8.3.1 to gcc 4.8.5 on CENTOS 8 problem

Posted: 2021/05/04 06:22:57
by jlehtone
jing.xie wrote:
2021/05/04 01:25:41
the software I would like to use seems to denpend on the version of gcc.
I'm skeptic about such claims.

There are virtualization and containers, if one really has to.

Re: Downgrade gcc 8.3.1 to gcc 4.8.5 on CENTOS 8 problem

Posted: 2021/05/04 09:02:49
by TrevorH
You could run 7 in a VM on 8.