2009-03-09 08:28:20 A problem when compiling multi-threads programs in uclinux
xiaofeng xu (CHINA)
Message: 70605
I have a problem when compiling multi-threads programs. This is the error information when I compiled the "threaddemos" which is in "/home/eflag-bfin/uClinux-dist/user/threaddemos" (I have not made any changes.) :
make[2]: Entering directory `/home/eflag-bfin/uClinux-dist/user/threaddemos'
bfin-elf-gcc -nostartfiles -Wl,-elf2flt /home/eflag-bfin/uClinux-dist/lib/uClibc/lib/crt0.o -o thdm thdm.o -lpthread -L/home/eflag-bfin/uClinux-dist/lib/uClibc/. -L/home/eflag-bfin/uClinux-dist/lib/uClibc/lib -L/home/eflag-bfin/uClinux-dist/lib/uClibc/libm -L/home/eflag-bfin/uClinux-dist/lib/libnet -L/home/eflag-bfin/uClinux-dist/lib/libdes -L/home/eflag-bfin/uClinux-dist/lib/libaes -L/home/eflag-bfin/uClinux-dist/lib/libpcap -L/home/eflag-bfin/uClinux-dist/lib/zlib -L/home/eflag-bfin/uClinux-dist/lib/libssl -L/home/eflag-bfin/uClinux-dist/lib/uClibc/libc -L/home/eflag-bfin/uClinux-dist/lib/uClibc/libcrypt
/home/eflag-bfin/install/bfin-elf/lib/gcc/bfin-elf/3.4.4/../../../../bfin-elf/bin/ld.real: cannot find -lpthread
collect2: ld returned 1 exit status
make[2]: *** [thdm] Error 1
make[2]: Leaving directory `/home/eflag-bfin/uClinux-dist/user/threaddemos'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/eflag-bfin/uClinux-dist/user'
make: *** [subdirs] Error 1
I think there may be something wrong with the "multi-thread" library. I notice that when I use "make" to install the uClibc, nothing is done to build the libthread.a, the detailed information is as follows:
make -C libm
make[3]: Entering directory `/home/eflag-bfin/uClinux-dist/uClibc/libm' (install libm.a)
bfin-elf-ar r libm.a e_acos.o e_acosh.o e_asin.o e_atan2.o e_atanh.o e_cosh.o e_exp.o e_fmod.o e_gamma.o e_gamma_r.o e_hypot.o e_j0.o e_j1.o e_jn.o e_lgamma.o e_lgamma_r.o e_log.o e_log10.o e_pow.o e_remainder.o e_rem_pio2.o e_scalb.o e_sinh.o e_sqrt.o k_cos.o k_rem_pio2.o k_sin.o k_standard.o k_tan.o s_asinh.o s_atan.o s_cbrt.o s_ceil.o s_copysign.o s_cos.o s_erf.o s_expm1.o s_fabs.o s_finite.o s_floor.o s_frexp.o s_ilogb.o s_ldexp.o s_lib_version.o s_log1p.o s_logb.o s_matherr.o s_modf.o s_nextafter.o s_rint.o s_scalbn.o s_signgam.o s_significand.o s_sin.o s_tan.o s_tanh.o w_acos.o w_acosh.o w_asin.o w_atan2.o w_atanh.o w_cabs.o w_cosh.o w_drem.o w_exp.o w_fmod.o w_gamma.o w_gamma_r.o w_hypot.o w_j0.o w_j1.o w_jn.o w_lgamma.o w_lgamma_r.o w_log.o w_log10.o w_pow.o w_remainder.o w_scalb.o w_sinh.o w_sqrt.o w_sqrtf.o fpmacros.o nan.o s_ceilf.o s_floorf.o
+ install -d ../lib
+ rm -f ../lib/libm.a
+ install -m 644 libm.a ../lib
make[3]: Leaving directory `/home/eflag-bfin/uClinux-dist/uClibc/libm'
make -C libpthread
make[3]: Entering directory `/home/eflag-bfin/uClinux-dist/uClibc/libpthread' (install nothing)
make[3]: Leaving directory `/home/eflag-bfin/uClinux-dist/uClibc/libpthread'
Not building shared libraries...
Finally finished compiling...
How to build the "multi-thread" library? Is there anything needs to be revised in the default "makefile" file ?
Thank you very much.
TranslateQuoteReplyEditDelete
2009-03-09 08:47:33 Re: A problem when compiling multi-threads programs in uclinux
Phil Wilshire (UNITED STATES)
Message: 70609
Hi
Using the 2008R1 release I get the following
after this
make user/threaddemos_clean
then this
make user/threaddemos_only
make[1]: Entering directory `/home/student-10/work/uClinux-dist/user'
touch threaddemos/.sgbuilt_user && make -j1 -C threaddemos
make[2]: Entering directory `/home/student-10/work/uClinux-dist/user/threaddemos'
bfin-linux-uclibc-gcc -pipe -Wall -O0 -g -mcpu=bf537-0.2 -DEMBED -D__uClinux__ -I/home/student-10/work/uClinux-dist -mcpu=bf537-0.2 -c -o thdm.o thdm.c
bfin-linux-uclibc-gcc -mcpu=bf537-0.2 -o thdm thdm.o -lpthread
bfin-linux-uclibc-gcc -pipe -Wall -O0 -g -mcpu=bf537-0.2 -DEMBED -D__uClinux__ -I/home/student-10/work/uClinux-dist -mcpu=bf537-0.2 -c -o mtdm.o mtdm.c
bfin-linux-uclibc-gcc -mcpu=bf537-0.2 -o mtdm mtdm.o -lpthread
bfin-linux-uclibc-gcc -pipe -Wall -O0 -g -mcpu=bf537-0.2 -DEMBED -D__uClinux__ -I/home/student-10/work/uClinux-dist -mcpu=bf537-0.2 -c -o bcdm.o bcdm.c
bfin-linux-uclibc-gcc -mcpu=bf537-0.2 -o bcdm bcdm.o -lpthread
make[2]: Leaving directory `/home/student-10/work/uClinux-dist/user/threaddemos'
make[1]: Leaving directory `/home/student-10/work/uClinux-dist/user'
You seem to be using an older version of the system
/home/eflag-bfin/install/bfin-elf/lib/gcc/bfin-elf/3.4.4/../../../../bfin-elf/bin/ld.real: cannot find -lpthread
And possibly the wrong compiler "bfin-elf-gcc"
Try a later system
Phil Wilshire
QuoteReplyEditDelete
2009-03-09 16:43:28 Re: A problem when compiling multi-threads programs in uclinux
Mike Frysinger (UNITED STATES)
Message: 70625
you're using a much older release. upgrade to 2008R1.5.
QuoteReplyEditDelete
2009-03-09 21:33:00 Re: A problem when compiling multi-threads programs in uclinux
xiaofeng xu (CHINA)
Message: 70638
OK, I will try it.
Thank you very much.