Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 163078 - ADA compile error, /usr/bin/ld: cannot find -lgnat-3.4 for x86_64 (RHEL4-U1)
Summary: ADA compile error, /usr/bin/ld: cannot find -lgnat-3.4 for x86_64 (RHEL4-U1)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: comps
Version: 4.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Radovan Musil
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-12 19:20 UTC by Jack Pogue
Modified: 2011-12-13 20:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-13 20:24:27 UTC


Attachments (Terms of Use)

Description Jack Pogue 2005-07-12 19:20:56 UTC
Description of problem:
This appears to be an older problem that continues to exist in RHEL4 (U1) for 
x86_64 (I found similar problems from a google search on "lgnat-3.4").

When trying to compile ADA code, I get a /usr/bin/ld error when gnatlink runs.

The easiest way to recreate the error is by using gnatmake.
i.e.

>gnatmake hello.adb
gcc -c hello.adb
gnatbind -x hello.ali
gnatlink hello.ali
/usr/bin/ld: cannot find -lgnat-3.4
collect2: ld returned 1 exit status
gnatlink: cannot call /usr/bin/gcc
gnatmake *** link failed


I believe one problem might be that /usr/lib/gcc/x86_64_redhat-
linux/3.4.3/adalib/libgnat-3.4.so (and libgnarl-3.4.so) are symbolically 
linked to /usr/lib64/libgnat-3.4.so.1 (and libgnarl-3.4.so.1), but these files 
don't exist in /usr/lib64.  The files do exist in /usr/lib, but if I relink 
the files to the /usr/lib location, I receive an incompatibility error 
(saying "/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64_redhat-
linux/3.4.3/adalib/libgnat-3.4.so when searching for -lgnat-3.4")


Version-Release number of selected component (if applicable):
Standard for RHEL4 (U1)
gcc-3.4.3-22.1
gcc-gnat-3.4.3-22.1

How reproducible:
Everytime

Steps to Reproduce:
1.Load RHEL4 (U1) - x86_64
2.Set up gcc to run ADA (gcc-gnat, etc.)
3.Try to build an executable from ADA.  

Actual results:

>gnatmake hello.adb
gcc -c hello.adb
gnatbind -x hello.ali
gnatlink hello.ali
/usr/bin/ld: cannot find -lgnat-3.4
collect2: ld returned 1 exit status
gnatlink: cannot call /usr/bin/gcc
gnatmake *** link failed

Expected results:
Should have created an executable

Additional info:
Although this issue doesn't cause "crashes, loss of data, or severe memory 
leaks", I placed this bug in high severity because we are unable to use these 
servers until ADA is working properly.

Comment 1 Jakub Jelinek 2005-07-12 21:33:57 UTC
What the following commands prints on your box?
rpm -q --qf '%{name}-%{version}-%{release}.%{arch}\n' libgnat
Sounds like you don't have libgnat-3.4.*.x86_64.rpm installed.

Comment 2 Jack Pogue 2005-07-12 22:20:20 UTC
Apparently when the OS installs, libgnat-3.4.3-22.1.i386 is installed by 
default instead of libgnat-3.4.3-22.1.x86_64.  To fix the problem, I couldn't 
just upgrade libgnat with the x86_64 version, had to remove gcc-gnat and 
libgnat PRIOR to reinstalling them.

Everything seems to be working fine now.

My only suggestion is that the default OS installation procedure should be 
changed to install the x86_64 version instead of the i386 version.

Thanks again.

Comment 3 Jakub Jelinek 2005-07-13 20:29:41 UTC
Did you install RHEL4 GA and then upgraded to RHEL4 U1 or installed RHEL4 U1?
RHEL4 GA did not include x86-64 libgnat (nor gcc-gnat), only U1+ does.
In any case, the default selection of packages is a comps issue.
IMHO neither gcc-gnat, nor libgnat.x86_64, nor libgnat.i386 should be the
default in any category, only optional.


Comment 4 Mike McLean 2005-07-13 21:05:00 UTC
libgnat is in the "Compatibility Arch Support".  All the packages in there
currently are either marked default or mandatory.  It's easy enough to mark it
optional, but I've got to wonder though if anyone out there relies upon it's
presence.

Oddly enough, it looks like the only package that requires libgnat is gcc-gnat
(which is basearchonly).  I wonder why libgnat was ever added as to the compat
arch list.  CC'ing notting.


Comment 7 Jack Pogue 2005-07-14 17:02:49 UTC
To answer your previous questions, I installed RHEL4 U1 from scratch (no 
upgrades).  Perhaps the reason libgnat is installed is in case users need to 
run precompiled ADA programs that weren't built to run entirely stand-alone, 
thus needing the libs?


Comment 8 Bill Nottingham 2005-07-14 17:13:20 UTC
Yes, the i386 libgnat is there to support running i386 Ada programs on x86-64.

Comment 10 Bill Nottingham 2011-12-13 20:24:27 UTC
This is not going to be changed in RHEL 4 at this time, sorry.


Note You need to log in before you can comment on or make changes to this bug.