I noticed that -L didn't quite work for me also. Perhaps someone can shed
some light. In the meantime, PengZhao, just specify "yourpath/libinstr.a"
will work for you.
Sun
> -----Original Message-----
> From: Peng Zhao [mailto:pengzhao@xxxxxxxxxxxxxx]
> Sent: Sunday, May 06, 2001 1:35 PM
> To: David Stephenson
> Cc: sgi
> Subject: Re: "paths" problem in pro64
>
>
> On Sun, 6 May 2001, David Stephenson wrote:
>
> Thanks. There is only libinstr.a instead of libinstr.so (even in the
> INSTALL script). A little confusing.
>
> I tried both -l and -L, both fails:
>
>
> ls ~/lib/gcc-lib/ia64-sgi-linux/sgicc-1.0/libinstr*
> /usr/brule12/grad/pengzhao/lib/gcc-lib/ia64-sgi-linux/sgicc-1.
> 0/libinstr.a
>
> ls ~/lib
> gcc-lib/ libffio.a libfortran.a libmsgi.a libmv.a
>
>
> sgicc -fb_create ./test test.c -o test -linstr
> -L~/lib/gcc-lib/ia64-sgi-linux/sgicc-1.0
> -L~/lib
>
> /usr/lib/gcc-lib/ia64-hp-linux/2.9-ia64-000216/../../../../ia6
> 4-hp-linux/bin/ld:
> cannot find -linstr
> collect2: ld returned 1 exit status
>
> sgicc -fb_create ./test test.c -o test -linstr
> /usr/lib/gcc-lib/ia64-hp-linux/2.9-ia64-000216/../../../../ia6
> 4-hp-linux/bin/ld:
> cannot find -linstr
> collect2: ld returned 1 exit status
>
>
> > Peng Zhao wrote:
> >
> > > And is there any neat solution to avoid
> > > "undefined reference to `__profile_pu_init'" error when using
> > > special libraries? Following are the tries I made: Can
> somebody explain
> > > me the related environment varialbes?
> > >
> > > -------------------
> > >
> > > NUE>sgicc -fb_create ./test test.c -o test
> > >
> test.o:/usr/sakwatamau/brule12/grad/pengzhao/test/test.c:4: undefined
> > > reference to `__profile_init' test.o: In function `main':
> > > test.o(.text+0x72): undefined reference to `__profile_pu_init'
> > > test.o(.text+0x92): undefined reference to `__profile_invoke_init'
> > > test.o(.text+0xb2): undefined reference to `__profile_branch_init'
> > > test.o(.text+0xd2): undefined reference to `__profile_call_init'
> > > test.o(.text+0xf2): undefined reference to `__profile_invoke'
> > > test.o(.text+0x162): undefined reference to `__profile_branch'
> > > test.o(.text+0x1b2): undefined reference to `__profile_call_entry'
> > > test.o(.text+0x212): undefined reference to `__profile_call_exit'
> > > test.o(.text+0x252): undefined reference to `__profile_call_entry'
> > > test.o(.text+0x2b2): undefined reference to `__profile_call_exit'
> > > collect2: ld returned 1 exit status
> NUE:/usr/brule12/grad/pengzhao/test>
> > > -----------------------
> > > NUE>sgicc -fb_create ./test test.c -o test -linstr
> > >
> /usr/lib/gcc-lib/ia64-hp-linux/2.9-ia64-000216/../../../../ia6
> 4-hp-linux/bin/ld:
> > > cannot find -linstr collect2: ld returned 1 exit status
> > > ------------------------
> >
> >
> > __profile_init and the other undefined names are the names
> of procedures
> > in the libiinstr.so library used during instrumentation. During
> > compilation with instrumentation, calls to these procedures
> are inserted
> > into the WHIRL code of the program being compiled. When
> the instrumented
> > binary is run, these procedure perform the frequency counts
> and generate
> > the file of feedback data.
> >
> > The flag "-linstr" in the second example tells the linker
> to include the
> > libinstr.so library, but the linker is unable to find it.
> I suggest to
> > first make sure that you have build the libinstr.so
> library. Second,
> > compile using the flags "-linstr -L<path>", where <path> is
> the location
> > of the libinstr.so library.
> >
> > - David
> >
> >
>
> --
> Regards
>
> Peng
> Peng Zhao pengzhao@xxxxxxxxxxxxxx
> http://www.cs.ualberta.ca/~pengzhao
> TEL (Lab): (780)492-3725 Lab: CSC251
>
>
>
|