LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GCC Problems..really need help. (https://www.linuxquestions.org/questions/linux-newbie-8/gcc-problems-really-need-help-321150/)

RoaCh Of DisCor 05-07-2005 08:55 PM

GCC Problems..really need help.
 
Well, it started off a problem configuring a kernel...and now I can compile nothing.


Firstly, I was trying to recompile my kernel...yet I ran into an unsual problem.

Code:

Linux:/usr/src/linux # make menuconfig
  HOSTCC  scripts/basic/fixdep
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld:/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../libc.so: file format not recognized; treating as linker script
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld:/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../libc.so:5: syntax error
collect2: ld returned 1 exit status
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
Linux:/usr/src/linux #

So, I went through yast...and re-installed glibcc.

..now...same problem as before with configuring the kernel..but I can no longer compile anything.

When I try..this is what happens.

Code:

Linux:/home/ravencrow/Downloads/alsa-utils-1.0.9rc2 # ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.

Needless to say, I'm lost.

Help appreciated...thanks.

-RoaCh

btmiller 05-07-2005 11:22 PM

Did you check the config.log? It should have the listing of the test program that it failed to compile and the exact error message(s). You could also try compiling a simple C program:

Code:

#include <stdio.h>

int main(void) {
  puts("Hello, world.");
  return 0;
}

eith gcc test.c -o test

and see what errors occur. Chances are, one of the gcc libraries got hosed and you'll need to reinstall the libgcc RPM.

Hopefully this will help some. I hate problems like this...

RoaCh Of DisCor 05-07-2005 11:28 PM

-edit

I'll post part of the config.log in a moment :)

RoaCh Of DisCor 05-07-2005 11:32 PM

maybe this will help....

Code:

## ----------- ##
## Core tests. ##
## ----------- ##

configure:1289: checking for a BSD-compatible install
configure:1343: result: /usr/bin/install -c
configure:1354: checking whether build environment is sane
configure:1397: result: yes
configure:1430: checking for gawk
configure:1446: found /bin/gawk
configure:1456: result: gawk
configure:1466: checking whether make sets $(MAKE)
configure:1486: result: yes
configure:1665: checking whether NLS is requested
configure:1674: result: yes
configure:1712: checking for msgfmt
configure:1743: result: /usr/bin/msgfmt
configure:1752: checking for gmsgfmt
configure:1783: result: /usr/bin/msgfmt
configure:1822: checking for xgettext
configure:1853: result: /usr/bin/xgettext
configure:1893: checking for msgmerge
configure:1923: result: /usr/bin/msgmerge
configure:1986: checking for style of include used by make
configure:2014: result: GNU
configure:2085: checking for gcc
configure:2111: result: gcc
configure:2355: checking for C compiler version
configure:2358: gcc --version </dev/null >&5
gcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2361: $? = 0
configure:2363: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.5/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib --enable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
configure:2366: $? = 0
configure:2368: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:2371: $? = 1
configure:2395: checking for C compiler default output
configure:2398: gcc    conftest.c  >&5
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld:/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../libc.so: file format not recognized; treating as linker script
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld:/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../libc.so:5: syntax error
collect2: ld returned 1 exit status
configure:2401: $? = 1
configure: failed program was:
| #line 2374 "configure"
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "alsa-utils"
| #define VERSION "1.0.9rc2"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|  ;
|  return 0;
| }
configure:2440: error: C compiler cannot create executables
See `config.log' for more details.


__J 05-08-2005 12:51 AM

what is the output of file on those two?


here is how mine is set up:

bash-3.00$ file libc.so.6
libc.so.6: symbolic link to `libc-2.3.4.so'

bash-3.00$ file libc-2.3.4.so
libc-2.3.4.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped

RoaCh Of DisCor 05-08-2005 02:32 AM

Well, I have a few...here's the output..

Code:

Linux:/home/ravencrow/Downloads/alsa-utils-1.0.9rc2 # file /lib/i686/libc.so.6
/lib/i686/libc.so.6: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
Linux:/home/ravencrow/Downloads/alsa-utils-1.0.9rc2 # file /lib/libc.so.6
/lib/libc.so.6: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
Linux:/home/ravencrow/Downloads/alsa-utils-1.0.9rc2 # file /lib/tls/libc.so.6
/lib/tls/libc.so.6: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
Linux:/home/ravencrow/Downloads/alsa-utils-1.0.9rc2 # file /usr/lib/libc.so
/usr/lib/libc.so: ASCII C program text
Linux:/home/ravencrow/Downloads/alsa-utils-1.0.9rc2 # file /usr/lib/nptl/libc.so
/usr/lib/nptl/libc.so: ASCII C program text
Linux:/home/ravencrow/Downloads/alsa-utils-1.0.9rc2 #


__J 05-08-2005 02:45 AM

not sure about the ASCII text :scratch:

my suggestion ( keep in mind this is my opinion) would be to try re-installing the development environment and see if that helps

chakkaradeepcc 05-08-2005 03:00 AM

hi,
just try this out,

Code:

#echo 'main(){}' > dummy.c
#cc dummy.c [or] gcc dummy.c
#readelf -l a.out | grep ': /lib'

if ur environment is proper u should get this output.,
[Requesting program interpreter: /lib/ld-linux.so.2]

if ur not getting this output, am sorry to tell u that ur development environment is corrupted and only one BEST solution is to re-install ur development environment.....

and remember Glibc doesnt work alone, it is part of The Toolchain which comprises of Binutils,Glibc and GCC.
The dynamic linker for which we are checking in above code is always shipped with Binutils and not with Glibc,Glibc contains the C libraries......
hope i made u clear a little bit..........anyway do post ur reply,

with regards,
C.C.Chakkaradeep

RoaCh Of DisCor 05-08-2005 11:45 AM

Quote:

Originally posted by chakkaradeepcc
hi,
just try this out,

Code:

#echo 'main(){}' > dummy.c
#cc dummy.c [or] gcc dummy.c
#readelf -l a.out | grep ': /lib'


Do I put that in a console and run it? I did that...it didn't do anything.

RoaCh Of DisCor 05-08-2005 01:41 PM

Quote:

Originally posted by __J
not sure about the ASCII text :scratch:

my suggestion ( keep in mind this is my opinion) would be to try re-installing the development environment and see if that helps

Ok, newbie question..thank god I'm in this forum :p.

What exactly is the development environment? :o :confused:

chakkaradeepcc 05-08-2005 10:17 PM

hi,

just open a Terminal if u r in Graphical Mode or type in the Console if u r Multi-user mode........and try those statements which i have posted before........if u r not getting the output which i have specified,then ur system's dynamic linker is corrupted and BEST way is to re-install linux!

I had this problem and atlast the only option left to me was Re-Installing the system!

with regards,
C.C.Chakkaradeep

RoaCh Of DisCor 05-10-2005 06:14 PM

I reinstalled alot of things..most importantly glibc and gcc...that appeared to fix things :)


All times are GMT -5. The time now is 05:23 AM.