Thanks for the reply. I don't think that is the problem because the first pthread function called in the hello.cpp was correctly found. I was looking inside the pthreads library generated and I noticed that this pthread_join function wasn't listed there. I really can't imagine a reason.
To create the library I executed the following two lines: sparc64-unknown-linux-gnu-gcc -c pthread.c -o m5pthread.o sparc64-unknown-linux-gnu-ar csr libm5pthread.a m5pthread.o Funny thing... On Tue, Apr 20, 2010 at 1:13 AM, nathan binkert <[email protected]> wrote: > > I have created a m5threads static linkable library for Sparc, with the > files > > available in the m5 repository. I used the Sparc compiler available in > the > > m5 website. > > The thing is: when I link my multithreaded helloworld app with this lib, > I > > get the following error: > > > > eberl...@bellatrix:~/UFSC/Wannabe/helloworld$ > sparc64-unknown-linux-gnu-g++ > > -static -L. -lm5pthread hello.cpp -o hello > > /tmp/ccfh1vud.o(.text+0x2b0): In function `main': > > : undefined reference to `pthread_join' > > collect2: ld returned 1 exit status > > I think your link order is bad. generally, -l options need to come > after object files, otherwise, the linker doesn't know to pull out the > relevant functions. (The linker processes files in order.) > _______________________________________________ > m5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/m5-users >
_______________________________________________ m5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
