[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (Follow-up) Desperate for Help
From: |
Jeffrey Stephens |
Subject: |
Re: (Follow-up) Desperate for Help |
Date: |
Sat, 29 Sep 2001 12:17:38 -0400 |
Well, I tried something else, and I was getting kind of giddy thinking I
might
have it working, but, alas, still no cigar! First, after closely
observing the output
with the -v switch, I changed my initial compile command to:
$ gcc -dynamic-linker /usr/local/lib/ld-linux.so.2 verglibc.c
WOW!!!! All sorts of stuff starts scrolling across the screen faster
than the eye
can see. It went something like this:
|
|
--------partial listing of output----------
Entering state 302
Reducing via rule 389 (line 2135), parm -> parms
state stack now 0 1 3 21 49 122 110 206
Entering state 301
Next token is 41 (')')
Reducing via rule 387 (line 2129), parms -> parmlist_2
state stack now 0 1 3 21 49 122 110 206
Entering state 300
Next token is 41 (')')
Shifting token 41 (')'), Entering state 365
Reducing via rule 381 (line 2099), parmlist_2 ')' -> parmlist_1
state stack now 0 1 3 21 49 122 110 206
Entering state 299
Reducing via rule 398 (line 2206), parmlist_1 ->
parmlist_or_identifiers_1
state stack now 0 1 3 21 49 122 110 206
Entering state 303
Reducing via rule 397 (line 2201), @40 parmlist_or_identifiers_1 ->
parmlist_or_identifiers
state stack now 0 1 3 21 49 122 110
|
|
Now at end of input.
Data size 371932.
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1010 pts/0 S 0:00 221 289 1426 956 0.7 /bin/bash
1031 pts/0 S 0:00 111 58 1125 488 0.3 gcc
-dynamic-linker
/usr/local/lib/ld-lin
1033 pts/0 S 0:01 346 1619 1472 1732 1.3
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/
I really thought I had something here. No error messages, and when I
issued an ls command
look
what I got:
Articles verglibc.c verglibc.c.flow verglibc.c.loop
verglibc.c.stack
Desktop verglibc.c.addressof verglibc.c.flow2 verglibc.c.lreg
verglibc.o
Studies verglibc.c.bp verglibc.c.gcse verglibc.c.regmove
a.out verglibc.c.combine verglibc.c.greg verglibc.c.rtl
downloads verglibc.c.cse verglibc.c.jump verglibc.c.sched
nsmail verglibc.c.cse2 verglibc.c.jump2 verglibc.c.sched2
Hey, there's an a.out file there! Can this mean success? No way. When I
issued the
command:
$ ./a.out
I got:
bash: ./a.out: No such file or directory
How can this be? The file is there. The execute mode ('x') is set. The
file is 13505
bytes. This is maddening, and I still need help.
******************End Follow-up************************************
I have spent many hours compiling and installing a new gcc and glibc,
but I still can't get them to work. I have made posts to a number of
news groups, but without success. You are my last resort. I am cut/and
pasting a post that I made to one of the newsgroups below. I am hoping
you have the time to respond. Thanks much.
Regards,
Jeff Stephens
******copy of newsgroup post**********
Jeffrey Stephens wrote:
> I am running Redhat Linux 6.2, kernel 2.2.14-5.0, XFree86 4.1.0, and
> KDE 1.1.2. I decided I wanted to update gcc and glibc, so I
downloaded
> gcc 2.95.3 and glibc 2.2.4. I first compiled and installed gcc, then
> glibc.
> Both are installed in /usr/local. I still have the original gcc (egcs
> 2.91.66)
> and glibc (2.1.3) installed in /usr. I quickly found out something
was
> wrong. Even trying to compile the simple 'hello world' program
produces
> the
> following error:
>
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> /usr/local/lib/libc.so.6: undefined reference to
address@hidden'
>
> /usr/local/lib/libc.so.6: undefined reference to
> address@hidden'
> collect2: ld returned 1 exit status
>
> I started reading the gcc doc and tried compiling with the -v switch.
I
> got the
> same as above along with the below listed info. As you can see,
> everything
> seems to be pointing to /usr/local except '-dynamic-linker' which is
> pointing
> at /lib/ld-linux.so.2. I investigated and discovered several things:
1)
> /lib/ld-linux.so.2
> is a symbolic link to /lib/ld-2.1.3.so ; 2) there is also a
> ld-linux.so.2 in /usr/local/lib
> (the 2.2.4 install) and it points to /usr/local/lib/ld-2.2.4.so ; 3)
so,
> I figured, since
> all these errors begin with _dl_ which I believe to be dynamic linker,
> the dl must
> be the problem. gcc must be using the wrong one. So, I think, why
don't
> I just
> change the link in /lib (ld-linux.so.2 to point to ld-2.2.4.so in
> /usr/local/lib. So, I
> first DELETED /lib/ld-linux.so.2 intending to recreate it pointing to
> ld-2.2.4.so.
> WRONG!!!! Everything went belly up after I deleted this link. The
only
> way I was
> able to recreate it was by booting another complete Linux installation
I
> have on
> the same system, mounting the / partition from the installation I had
> just screwed
> up, and recreating the link. Now, at least, I'm back where I started,
a
> little wiser,
> but still with the same question. HOW can I get gcc 2.95.3 to use the
> right linker so
> I can compile something?
>
> Thanks for any help you can give.
>
> Regards,
> Jeff Stephens
>
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
> $ gcc -v verglibc.c
> Reading specs from
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs
>
> gcc version 2.95.3 20010315 (release)
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/cpp0 -lang-c -v
> -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__EL
> F__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__
> -D__linux__ -D__unix -D__linux -Asystem(po
> six) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686
> -Dpentiumpro -D__i686 -D__i686__ -D__
> pentiumpro -D__pentiumpro__ verglibc.c /tmp/ccl06xcJ.i
> GNU CPP version 2.95.3 20010315 (release) (i386 Linux/ELF)
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/local/include
>
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/../../../../i686-pc-linux-gnu/include
>
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include
> /usr/include
> End of search list.
> The following default directories have been omitted from the search
> path:
> n -o /tmp/ccalbrcl.s
> GNU C version 2.95.3 20010315 (release) (i686-pc-linux-gnu) compiled
by
> GNU C version 2.95.3 20010315 (release).
> /usr/local/i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccHApIk2.o
> /tmp/ccalbrcl.s
> GNU assembler version 2.11.2 (i686-pc-linux-gnu) using BFD version
> 2.11.2
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/collect2 -m elf_i386
> -dynamic-linker /lib/ld-linux.so.2 /usr/local/lib/crt1.o
> /usr/local/lib/crti.o
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/crtbegin.o
> -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3
> -L/usr/local/i686-pc-linux-gnu/lib -L/usr/local/lib /tmp/ccHApIk2.o
> -lgcc -lc -lgcc
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/crtend.o
> /usr/local/lib/crtn.o
I thought I might have discovered my problem when I read the glibc FAQ.
I tried the
following:
$ gcc --dynamic-linker=/usr/local/lib/ld-linux.so.2 verglibc.c
No luck! Got this error.
cc1: Invalid option `-fdynamic-linker=/usr/local/lib/ld-linux.so.2'
Then I tried:
$ gcc -Wl,--dynamic-linker=/usr/local/lib/ld-linux.so.2 verglibc.c
#that's W(small ell)
This doesn't work either!
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
/usr/local/lib/libc.so.6: undefined reference to address@hidden'
/usr/local/lib/libc.so.6: undefined reference to address@hidden'
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
/usr/local/lib/libc.so.6: undefined reference to address@hidden'
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
/usr/local/lib/libc.so.6: undefined reference to address@hidden'
/usr/local/lib/libc.so.6: undefined reference to
address@hidden'
collect2: ld returned 1 exit status
Still hoping for some help. Thanks
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: (Follow-up) Desperate for Help,
Jeffrey Stephens <=