Bug 90177

Summary: gcc does not compile simple programs
Product: [Retired] Red Hat Linux Reporter: L.W.Johnstone <les>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-03 23:05:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of gcc -v none

Description L.W.Johnstone 2003-05-04 20:30:11 UTC
Description of problem:
GCC doesn't link to the standard directories.

Version-Release number of selected component (if applicable):
gcc version 3.2.2 20

How reproducible:
Every time.

Steps to Reproduce:
1.Try to compile the program... (gcc program.c)
for example:
c program:
#include<stdio.h>
main()
{
printf("Hello world.\n");
}


   
Actual results:
compiler/linker output:
gcc hello.c -o hello                                                
/usr/lib/libc_nonshared.a(elf-init.oS): In function 
`__libc_csu_init':                      
elf-init.oS(.text+0xb): undefined reference to 
`__init_array_end'                           
elf-init.oS(.text+0x10): undefined reference to 
`__init_array_start'                        
elf-init.oS(.text+0x23): undefined reference to 
`__init_array_start'                        
/usr/lib/libc_nonshared.a(elf-init.oS): In function 
`__libc_csu_fini':                      
elf-init.oS(.text+0x36): undefined reference to 
`__fini_array_end'                          
elf-init.oS(.text+0x3b): undefined reference to 
`__fini_array_start'                        
elf-init.oS(.text+0x57): undefined reference to 
`__fini_array_start'                        
collect2: ld returned 1 exit status    

Expected results:
The program should compile.

Additional info:

Comment 1 L.W.Johnstone 2003-05-04 20:34:13 UTC
Created attachment 91494 [details]
Output of gcc -v

using gcc -v this is obviously a linking problem.

Comment 2 Jakub Jelinek 2003-05-04 20:39:12 UTC
You are not using RHL9 binutils. Don't.
RHL9 comes with binutils-2.13.90.0.18-9.
You either must have ignored package dependencies, or have obsolete binutils
somewhere in your search path.

Comment 3 L.W.Johnstone 2003-05-04 20:43:32 UTC
I did a complete reinstall of redhat 9 last night, therefore forcing the rpm is 
not an issue.

how do I solve this problem?

Comment 4 L.W.Johnstone 2003-05-04 20:45:30 UTC
rpm -q binutils 
binutils-2.13.90.0.18-9  

Comment 5 Jakub Jelinek 2003-05-04 20:47:56 UTC
Find where this binutils 2.11.93.0.2 is located on your disk (guess
which ld
ld --version
/usr/bin/ld --version
should reveal this) and either remove 2.11.93.0.2, or move it somewhere out
of your $PATH.

Comment 6 L.W.Johnstone 2003-05-04 21:39:08 UTC
Still not finding it...
I do have references (rpms) of binutils in copies of previous versions of redhat
and a few other places...
/usr/share/doc/binutils-2.13.90.0.18
/usr/share/doc/binutils-2.13.90.0.18/README
/usr/share/info/binutils.info-1.gz
/usr/share/info/binutils.info-2.gz
/usr/share/info/binutils.info-3.gz
/usr/share/info/binutils.info.gz
/usr/share/locale/da/LC_MESSAGES/binutils.mo
/usr/share/locale/es/LC_MESSAGES/binutils.mo
/usr/share/locale/fr/LC_MESSAGES/binutils.mo
/usr/share/locale/ja/LC_MESSAGES/binutils.mo
/usr/share/locale/sv/LC_MESSAGES/binutils.mo
/usr/share/locale/tr/LC_MESSAGES/binutils.mo
/usr/local/info/binutils.info
/usr/local/info/binutils.info-1 
/usr/local/info/binutils.info-2 
/usr/local/info/binutils.info-3
/usr/local/share/locale/fr/LC_MESSAGES/binutils.mo
/usr/local/share/locale/tr/LC_MESSAGES/binutils.mo
/usr/local/share/locale/ja/LC_MESSAGES/binutils.mo
/usr/local/share/locale/es/LC_MESSAGES/binutils.mo
/upgrade/valhalla/RedHat/RPMS/binutils-2.11.93.0.2-11.i386.rpm
/upgrade/valhalla/SRPMS/binutils-2.11.93.0.2-11.src.rpm
/upgrade/psyche/RedHat/RPMS/binutils-2.13.90.0.2-2.i386.rpm
/upgrade/psyche/SRPMS/binutils-2.13.90.0.2-2.src.rpm
/upgrade/bluebird/Mandrake/RPMS/binutils-2.11.92.0.12-6mdk.i586.rpm
/upgrade/bluebird/Mandrake/RPMS/libbinutils2-2.11.92.0.12-6mdk.i586.rpm
/upgrade/bluebird/Mandrake/RPMS3/libbinutils2-devel-2.11.92.0.12-6mdk.i586.rpm 

I have removed all suspect referents, but still i cannot compile...

Comment 7 L.W.Johnstone 2003-05-04 21:41:29 UTC
Still not finding it...
I do have references (rpms) of binutils in copies of previous versions of redhat
and a few other places...
/usr/share/doc/binutils-2.13.90.0.18
/usr/share/doc/binutils-2.13.90.0.18/README
/usr/share/info/binutils.info-1.gz
/usr/share/info/binutils.info-2.gz
/usr/share/info/binutils.info-3.gz
/usr/share/info/binutils.info.gz
/usr/share/locale/da/LC_MESSAGES/binutils.mo
/usr/share/locale/es/LC_MESSAGES/binutils.mo
/usr/share/locale/fr/LC_MESSAGES/binutils.mo
/usr/share/locale/ja/LC_MESSAGES/binutils.mo
/usr/share/locale/sv/LC_MESSAGES/binutils.mo
/usr/share/locale/tr/LC_MESSAGES/binutils.mo
/usr/local/info/binutils.info
/usr/local/info/binutils.info-1 
/usr/local/info/binutils.info-2 
/usr/local/info/binutils.info-3
/usr/local/share/locale/fr/LC_MESSAGES/binutils.mo
/usr/local/share/locale/tr/LC_MESSAGES/binutils.mo
/usr/local/share/locale/ja/LC_MESSAGES/binutils.mo
/usr/local/share/locale/es/LC_MESSAGES/binutils.mo
/upgrade/valhalla/RedHat/RPMS/binutils-2.11.93.0.2-11.i386.rpm
/upgrade/valhalla/SRPMS/binutils-2.11.93.0.2-11.src.rpm
/upgrade/psyche/RedHat/RPMS/binutils-2.13.90.0.2-2.i386.rpm
/upgrade/psyche/SRPMS/binutils-2.13.90.0.2-2.src.rpm
/upgrade/bluebird/Mandrake/RPMS/binutils-2.11.92.0.12-6mdk.i586.rpm
/upgrade/bluebird/Mandrake/RPMS/libbinutils2-2.11.92.0.12-6mdk.i586.rpm
/upgrade/bluebird/Mandrake/RPMS3/libbinutils2-devel-2.11.92.0.12-6mdk.i586.rpm 

I have removed all suspect referents, but still i cannot compile...

Comment 8 Jakub Jelinek 2003-05-04 21:44:44 UTC
Have you run the commands I've mentioned?
Seeing /usr/local/info/binutils.info among your files, I find it very likely
that you have those old binutils in /usr/local, check /usr/local/bin/as,
/usr/local/bin/ld, etc.

Comment 9 L.W.Johnstone 2003-05-04 22:25:18 UTC
i've removed all referent files in /usr/local
updated the locate db
looked for binutils:
/home/stf/les/downloads/nachos/binutils-2.11.93.0.2.tar.bz2
/home/stf/les/downloads/nachos/binutils-2.11.93.0.2.tar
/usr/share/doc/binutils-2.13.90.0.18
/usr/share/doc/binutils-2.13.90.0.18/README
/usr/share/info/binutils.info-1.gz
/usr/share/info/binutils.info-2.gz
/usr/share/info/binutils.info-3.gz
/usr/share/info/binutils.info.gz
/usr/share/locale/da/LC_MESSAGES/binutils.mo
/usr/share/locale/es/LC_MESSAGES/binutils.mo
/usr/share/locale/fr/LC_MESSAGES/binutils.mo
/usr/share/locale/ja/LC_MESSAGES/binutils.mo
/usr/share/locale/sv/LC_MESSAGES/binutils.mo
/usr/share/locale/tr/LC_MESSAGES/binutils.mo
/upgrade/valhalla/RedHat/RPMS/binutils-2.11.93.0.2-11.i386.rpm
/upgrade/valhalla/SRPMS/binutils-2.11.93.0.2-11.src.rpm
/upgrade/psyche/RedHat/RPMS/binutils-2.13.90.0.2-2.i386.rpm
/upgrade/psyche/SRPMS/binutils-2.13.90.0.2-2.src.rpm
/upgrade/bluebird/Mandrake/RPMS/binutils-2.11.92.0.12-6mdk.i586.rpm
/upgrade/bluebird/Mandrake/RPMS/libbinutils2-2.11.92.0.12-6mdk.i586.rpm
/upgrade/bluebird/Mandrake/RPMS3/libbinutils2-devel-2.11.92.0.12-6mdk.i586.rpm
/info/binutils.info
/info/binutils.info-1
/info/binutils.info-2
/info/binutils.info-3
/share/locale/fr/LC_MESSAGES/binutils.mo
/share/locale/tr/LC_MESSAGES/binutils.mo
/share/locale/ja/LC_MESSAGES/binutils.mo
/share/locale/es/LC_MESSAGES/binutils.mo

still no compile....
not sure how to use ld...



Comment 10 L.W.Johnstone 2003-05-05 02:55:50 UTC
After a lot of searching i discovered some executables in the /bin directory 
and some libraries in the /share directory... and I was the culprit, trying to 
make a cross-compiler for nachos.

Deleted the files and we're compiling again ;-)

Thanks for your help, pointing me in the right direction.

My only concern is why could we compile prior to upgrade but not after?

Comment 11 Richard Henderson 2004-10-03 23:05:01 UTC
Simple enough -- because the newer glibc required features
provided only by the newer binutils.