Issue of Libgcc_s.so.1 version

Source: Internet
Author: User
Run File hints:
/usr/local/tools/fetion:/lib/libgcc_s.so.1:version ' gcc_4.2.0 ' not found (required by/usr/local/tools/fetion/lib/ libstdc++.so.6)
View/lib/libgcc_s.so.1 file exists, is a link
[Root@localhost tools]# Ll/lib/libgcc_s.so.1
lrwxrwxrwx 1 root 28 March 08:16/lib/libgcc_s.so.1-> libgcc_s-3.4.3-20041213.so.1
View the GCC version of the system is gcc (GCC) 3.4.3
[Root@localhost ~]# gcc--version
GCC (gcc) 3.4.3 20041212 (Red Hat 3.4.3-9.el4)
So want to upgrade GCC, did not find gcc_4.2.0 rpm package, download the source package directly

I. Pre-upgrade information
[Root@localhost ~]# Gcc-v
Reading Specs From/usr/lib/gcc/i386-redhat-linux/3.4.3/specs
Configured with:. /configure--prefix=/usr--mandir=/usr/share/man--infodir=/usr/share/info--enable-shared--enable-threads=posix-- Disable-checking--with-system-zlib--enable-__cxa_atexit--disable-libunwind-exceptions--ENABLE-JAVA-AWT=GTK-- Host=i386-redhat-linux
Thread Model:posix
GCC version 3.4.3 20041212 (Red Hat 3.4.3-9.el4)
[Root@localhost ~]# gcc--version
GCC (gcc) 3.4.3 20041212 (Red Hat 3.4.3-9.el4)
Copyright (C) Free Software Foundation, Inc.
This is free software; The source for copying conditions. There is NO
Warranty Not even for merchantability or FITNESS for A particular purpose.
second, the upgrade process
[root@localhost ~] #wget http://ftp.gnu.org/pub/pub/gnu/gcc/gcc-4.2.0/gcc-4.2.0.tar.bz2
[Root@localhost ~]# tar jxf gcc-4.2.0.tar.bz2
[Root@localhost ~]# MKDIR/USR/GCC4
[Root@localhost ~]# cd/gcc-4.2.0
[Root@localhost GCC-4.2.0]#./CONFIGURE--PREFIX=/USR/GCC4
[Root@localhost gcc-4.2.0]# make clean
[Root@localhost gcc-4.2.0]# make
Long Ah, after a few hours of compiling (information that all the components are almost compiled) for the next step
[Root@localhost gcc-4.2.0]# make check
Is this a test here? Long compilation in watching Bird's tutorial learning, how to hint there is wrong, regardless of the
MAKE[1]: Entering directory '/root/gcc-4.2.0 '
MAKE[2]: Entering directory '/root/gcc-4.2.0/host-i686-pc-linux-gnu/fixincludes '
Autogen-t HTTP://WWW.CNBLOGS.COM/./FIXINCLUDES/CHECK.TPL Http://www.cnblogs.com/./fixincludes/inclhack.def
MAKE[2]: Autogen: Command not found
MAKE[2]: * * * [Check] Error 127
MAKE[2]: Leaving directory '/root/gcc-4.2.0/host-i686-pc-linux-gnu/fixincludes '
MAKE[1]: * * * [Check-fixincludes] Error 2
MAKE[1]: Leaving directory '/root/gcc-4.2.0 '
Make: * * * * [Do-check] Error 2
[Root@localhost gcc-4.2.0]# make install
........
----------------------------------------------------------------------
Libraries have been installed in:
/usr/gcc4/lib
If you are ever happen to want to link against installed libraries
In a given directory, Libdir, your must either use Libtool, and
Specify the full pathname of the library, or use the '-llibdir '
Flag during linking and do at least one of the following:
-Add Libdir to the ' Ld_library_path ' environment variable
During execution
-Add Libdir to the ' Ld_run_path ' environment variable
During linking
-Use the '-WL,--RPATH-WL,LIBDIR ' linker flag
-Have your system administrator add Libdir to '/etc/ld.so.conf '
Operating system documentation about shared libraries for
More information, such as the LD (1) and ld.so (8) manual pages.
----------------------------------------------------------------------

Look at the version or the old version of the information, looking back, only to find that the above is to install GCC instead of the upgrade operation, followed by the new installation of the library links point to delete the old library link to see below.
....
The old version is installed with the source code, which gcc or whereis gcc view the path
[Root@localhost bin]# which GCC
/usr/bin/gcc
[Root@localhost bin]# Whereis gcc
GCC:/usr/bin/gcc/usr/lib/gcc/usr/libexec/gcc/usr/share/man/man1/gcc.1.gz
Replace the corresponding old folder/usr/lib file with gcc, g++, GCJ, respectively, under the newly installed/usr/gcc4/lib/
[Root@localhost ~]# Cd/usr/lib
[root@localhost bin]# mv GCC Gcc_bak
[Root@localhost bin]# MV g++ G++_bak
[Root@localhost bin]# MV GCJ Gcj_bak
[Root@localhost bin]# LN-SV/USR/GCC4/BIN/GCC gcc
[Root@localhost bin]# ln-sv/usr/gcc4/bin/g++ g++
[Root@localhost bin]# LN-SV/USR/GCC4/BIN/GCJ GCJ
Ldconfig-v to reload the library. We'll understand it later.
[Root@localhost bin]# Ldconfig-v
[Root@localhost bin]# Gcc-v
Use built in specs.
Goal: I686-pc-linux-gnu
Configured as:./configure--prefix=/usr/gcc4
Threading Model: POSIX
GCC version 4.2.0
OK,GCC version updated, run the program back to see
/usr/local/tools/fetion:/lib/libgcc_s.so.1:version ' gcc_4.2.0 ' not found (required by/usr/local/tools/fetion/lib/ libstdc++.so.6)
Xxd, after all this time, it's a primitive mistake.
[Root@localhost ~]# Find/-name libgcc*
/lib/libgcc_s-3.4.3-20041213.so.1 (linked files)
/LIB/LIBGCC_S.SO.1 (hint file)
......
/usr/gcc4/lib/libgcc_s.so.1 (Files under the new installation directory)
GCC4 the same structure directory also has this libgcc_s.so.1 file, replace the try
[Root@localhost ~]# Mv/lib/libgcc_s.so.1/lib/libgcc_s.so.1_bak
[Root@localhost ~]# ln-s/usr/gcc4/lib/libgcc_s.so.1/lib/libgcc_s.so.1
You can run the program again.

Third, PostScript
1, GCC4 should be installed in the/USR/LOCAL/GCC4 directory
2, have friends suggest Red hat with RPM-IVH gcc-4.1.2-33.i386.rpm this way to install will be better
3, on the Centos4 the same problem I directly with Yum update gcc This command can also solve the problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.