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:
Created attachment 91494 [details] Output of gcc -v using gcc -v this is obviously a linking problem.
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.
I did a complete reinstall of redhat 9 last night, therefore forcing the rpm is not an issue. how do I solve this problem?
rpm -q binutils binutils-2.13.90.0.18-9
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.
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...
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.
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...
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?
Simple enough -- because the newer glibc required features provided only by the newer binutils.