Bug 90177 - gcc does not compile simple programs
gcc does not compile simple programs
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
9
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-04 16:30 EDT by L.W.Johnstone
Modified: 2007-04-18 12:53 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-03 19:05:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Output of gcc -v (2.92 KB, text/plain)
2003-05-04 16:34 EDT, L.W.Johnstone
no flags Details

  None (edit)
Description L.W.Johnstone 2003-05-04 16:30:11 EDT
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 16:34:13 EDT
Created attachment 91494 [details]
Output of gcc -v

using gcc -v this is obviously a linking problem.
Comment 2 Jakub Jelinek 2003-05-04 16:39:12 EDT
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 16:43:32 EDT
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 16:45:30 EDT
rpm -q binutils 
binutils-2.13.90.0.18-9  
Comment 5 Jakub Jelinek 2003-05-04 16:47:56 EDT
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 17:39:08 EDT
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 17:41:29 EDT
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 17:44:44 EDT
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 18:25:18 EDT
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-04 22:55:50 EDT
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 19:05:01 EDT
Simple enough -- because the newer glibc required features
provided only by the newer binutils.

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