LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-24-2014, 07:49 AM   #1
Shaggy1
Member
 
Registered: Oct 2010
Posts: 111

Rep: Reputation: 3
building and installing gcc 4.9.1 - libiberty not installed in install step


Hi

I have been attempting to build and install gcc 4.9.1 to a non-standard location on a machine where a different version of gcc is already installed (and
I do not have write access to the standard install areas).

I am using a rhel6 system:
$ uname -a
Linux lb-cbga-eq 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed May 15 10:48:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

Before building gcc I also built and installed mpfr, gmp and mpc to my local area.

I used the following command to configure:
../gcc-4.9.1/configure --prefix=/lb-cbga-eq/usr/local/gcc --with-mpfr=/lb-cbga-eq/usr/local/mpfr --with-gmp=/lb-cbga-eq/usr/local/gmp --with-mpc=/lb-cbga-eq/usr/local/mpc --enable-languages=c,c++ --disable-multilib --disable-bootstrap

gcc seemed to compile ok and indeed the compilation tests I have run seem fine but, not having done this before, I'm still not entirely sure everything has run correctly.

I'd like to ask a few questions to help me ascertain whether gcc has indeed been built correctly, and if not get some advice on how to find out where/why things have gone wrong.

1)
One of the reasons I wanted to install gcc is so that libiberty.a was built with fpic, which would then allow me to build cairo.
I noticed that there were three versions of libiberty.a built:
./build-x86_64-unknown-linux-gnu/libiberty/libiberty.a
./libiberty/pic/libiberty.a
./libiberty/libiberty.a

Does anyone know why three different versions are created ?
Are the different versions of these supposed to be used in different context or do I choose (any) one ?
Should I be using a configure option to say which library I want built ?

2)
When I typed 'make install' I expected the libraries to be installed in the location specified by --prefix, however it seems libiberty.a (and several others) were not installed.
Does this mean something has gone wrong, or are these libraries not installed automatically ?
Do I need to use a configure option to have these libraries installed in the install step ?

3)
I did a 'make check' after I built gcc and though everything built it seems there were quite a lot of 'expected' failures reported:
=== gcc Summary ===

# of expected passes 104993
# of expected failures 251
# of unsupported tests 1758

Does anyone know of a way I can confirm these failures are ok ?
 
Old 09-24-2014, 09:08 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Have you paid for your rhel6? If so then you can contact their support line for help with your problem. If you haven't paid for rhel6 then you shouldn't be using it. You can try CentOS instead.
jdk
 
Old 09-24-2014, 12:37 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The "libiberty.a" from gcc is never installed. Not required.

And libiberty.a is already present in binutils-devel :
/usr/lib64/libiberty.a



-

Last edited by knudfl; 09-24-2014 at 12:39 PM.
 
Old 09-24-2014, 02:44 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
also be advised

RHEL6 uses gcc 4.3
almost none of the programs built for rhel6 will YET build using gcc 4.9
you will be needing to rewright almost every program you try to build using gcc 4.9

if you MUST use gcc 4.9
i would install Fedora 20 or the "still in testing" Fedora 21

fedora 21 uses gcc 4.9.1
 
Old 10-02-2014, 03:54 AM   #5
Shaggy1
Member
 
Registered: Oct 2010
Posts: 111

Original Poster
Rep: Reputation: 3
Hi

Thank you for your replies.

> And libiberty.a is already present in binutils-devel :
> /usr/lib64/libiberty.a
This little nudge in the direction of /usr/lib64/libiberty.a made me re-visit the original reason I ended up building gcc in the first place, which was because of an error while building cairo:
/tools/oss/packages/x86_64-rhel6/binutils/default/bin/ld: /tools/oss/packages/x86_64-rhel6/gcc/4.5.3/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/../../../../lib64/libiberty.a(cplus-dem.o): relocation R_X86_64_32S against `_sch_istable' can not be used when making a shared object; recompile with -fPIC
/tools/oss/packages/x86_64-rhel6/gcc/4.5.3/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/../../../../lib64/libiberty.a: could not read symbols: Bad value

It looks like cairo was picking up the version in the gcc tree
(/tools/oss/packages/x86_64-rhel6/gcc/4.5.3/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/../../../../lib64/libiberty.a)
which was not built with -fpic. However it seems that /usr/lib64/libiberty.a was, so I guess I just need to make sure I link with the /usr/lib64 version.

Can this be done simply by setting it in LD_LIBRARY_PATH ?


As an aside:
> The "libiberty.a" from gcc is never installed. Not required.
I was under the impression was part of gcc and that you had to build gcc to build it. Is it actually part of binutils ?


For completeness:
I also did plough on for a bit down the gcc path and indeed it does require a lot of rebuilding, a lot of time finding out what I need to rebuild, how to point to the correct paths etc. Very painful.

Yes the rhel6 version is fully paid for and I could get support for it, but this is simply to provide some tools in the lab, so I didn't think it worth going for full on support for it.

I have now set up a machine where I can install virtual machines, so I can, if I want, take the suggested alternate route of installing another release, but installing custom releases is generally frowned upon so I'll use that as a last resort.
 
Old 10-02-2014, 05:12 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← #5 .
Quote:
"libiberty.a" ..
I was under the impression was part of gcc and that you had to build gcc to build it
* libiberty.a is created also at gcc build time, for internal use.

I don't remember the reason.
Can probably be found in the gcc documentation, or / and the LFS book.

-
 
Old 10-02-2014, 08:19 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Cairo information : Cairo is always installed by default.
* You may be missing cairo-devel : # yum install cairo-devel
No Redhat license ? Then use the identical CentOS 6 repo :
http://wiki.centos.org/HowTos/MigrationGuide
( Redhat CentOS 6.x is the free version of RHEL 6.x ).

More cairo : Cairo does not require libiberty.a to build :
* cairo-1.13.1 ( is the Fedora 21 version )
BuildRequires: pkgconfig
BuildRequires: libXrender-devel
BuildRequires: libX11-devel
BuildRequires: libpng-devel
BuildRequires: libxml2-devel
BuildRequires: pixman-devel >= %{pixman_version}
BuildRequires: freetype-devel >= %{freetype_version}
BuildRequires: fontconfig-devel >= %{fontconfig_version}
BuildRequires: glib2-devel
BuildRequires: librsvg2-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libEGL-devel

# yum install \
freetype-devel fontconfig-devel glib2-devel libXrender-devel \
libpng-devel librsvg2-devel libxml2-devel mesa-libEGL-devel \
mesa-libGL-devel pixman-devel


* cairo-1.8.8 ( the el6 version )
BuildRequires: pkgconfig
BuildRequires: libXrender-devel
BuildRequires: libX11-devel
BuildRequires: libpng-devel
BuildRequires: libxml2-devel
BuildRequires: pixman-devel >= %{pixman_version}
BuildRequires: freetype-devel >= %{freetype_version}
BuildRequires: fontconfig-devel >= %{fontconfig_version}

-
 
Old 10-21-2014, 08:23 AM   #8
Shaggy1
Member
 
Registered: Oct 2010
Posts: 111

Original Poster
Rep: Reputation: 3
Thank you for your replies.

It does indeed seem that cairo and is already installed.
The end aim was to get the bless hex editor installed, which requires mono, which requires cairo.

I cleaned up completely and started again. I can build mono and bless, but bless is throwing an exception when I run it.
I guess that is one for another thread.

"More cairo : Cairo does not require libiberty.a to build"
The reason I thought Cairo required libiberty.a was the following error when I tried to build it:
/tools/oss/packages/x86_64-rhel6/binutils/default/bin/ld: /tools/oss/packages/x86_64-rhel6/gcc/4.5.3/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/../../../../lib64/libiberty.a(cplus-dem.o): relocation R_X86_64_32S against `_sch_istable' can not be used when making a shared object; recompile with -fPIC
/tools/oss/packages/x86_64-rhel6/gcc/4.5.3/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/../../../../lib64/libiberty.a: could not read symbols: Bad value
It may have been a red herring.
 
Old 10-21-2014, 03:06 PM   #9
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
The end aim was to get the bless hex editor installed, which requires mono,
why use a Microsoft windows " C#" program ???

you do know that GHEX is installed in gnome by default
or if not in the rhn repo

Code:
su -
yum install ghex
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] compiling gcc 4.5.2 without libiberty entz Linux - Software 2 12-07-2011 06:45 PM
Linux From Scratch - Version 6.7 GCC-4.5.1 - Pass 2 Error on libiberty.an antonio.moschini@nsn.com Linux From Scratch 3 03-28-2011 03:48 AM
error 396, on a variable (gcc), learning GCC step by step frenchn00b Programming 2 09-11-2009 01:03 PM
gcc-3.3.3 compling(configure-target-libiberty error 1) windus Linux - Software 0 04-18-2004 12:38 PM
Base install and building step by step. LearningToSlack Linux - Newbie 1 11-04-2003 12:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration