santosh
santosh

Reputation: 501

How to build glib library with specific gcc version

On my system default gcc version is 4.4.7 , But i want to build glib library with gcc 6.3 version. For that i tried running ./configure from glib source as shown below:

../configure  CC="/version/global/pkgs/gcc/v6.3.0/bin/gcc" CFLAGS='-fPIC' CXXFLAGS='-fPIC' --enable-static=yes --prefix=/home/kallel/glib_63/glib-2.56.1/new_glib63 --enable-libmount=no --with-pcre=/home/kallel/pcre_lib/pcre-8.20/pcre_library

Once after building glib library. To see on which gcc compiler version it got built with following command:-

strings -a libglib-2.0.so.0.5600.1 | grep "GCC: ("
o/p:-
 GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-9)
 GCC: (Synopsis) 6.3.0
 GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-4)

I could not understand why it is still showing output with 4.4.7, Please help me in understanding the output. Is there anything wrong in my ./configure command? How do we make sure that library was built with gcc 6.3

Upvotes: 0

Views: 292

Answers (1)

Employed Russian
Employed Russian

Reputation: 213375

I could not understand why it is still showing output with 4.4.7

Your library contains object code that you built, as well as parts of GLIBC that are required to support shared libraries (crti.o, crtn.o, etc.).

These parts will continue to show whatever GCC they were built with, regardless of what you build glib code with.

Upvotes: 1

Related Questions