Re: Understanding Threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6 June 2012 20:14, parc wrote:
>
> The error comes up, when xgcc, in the object directory, compiles the
> libgcc/unwind-dw2.c file from the source directory into the object
> directory. "/usr/local/zich" is the objdir ; "usr/local/gcc-4.7.0" the
> srcdir.
> Maybe i setup something wrong on the configuration. But the libpthread.so
> library seems to work fine when compiling code under gcc 4.6.1 with the
> "-phtread" compiler option. I think this option should somehow be invoked
> for the make scripts of gcc 4.7.0. But i don't know how and where to set it.

You don't need to.

Your problem is not a linker error.

> /usr/local/zich/./gcc/xgcc -B/usr/local/zich/./gcc/
> -B/usr/i686-linux-gnu/bin/ -B/usr/i686-linux-gnu/lib/ -isystem
> /usr/i686-linux-gnu/include -isystem /usr/i686-linux-gnu/sys-include    -g
> -O2 -O2  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
> -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
> ./include   -fpic -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector
> -fpic -I. -I. -I../.././gcc -I../../../gcc-4.7.0/./libgcc
> -I../../../gcc-4.7.0/./libgcc/. -I../../../gcc-4.7.0/./libgcc/../gcc
> -I../../../gcc-4.7.0/./libgcc/../include
> -I../../../gcc-4.7.0/./libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT
> -DUSE_TLS -o unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF unwind-dw2.dep
> -fexceptions -c ../../../gcc-4.7.0/./libgcc/unwind-dw2.c -fvisibility=hidden
> -DHIDE_EXPORTS
> In file included from ../../../gcc-4.7.0/./libgcc/gthr.h:150:0,
>                 from ../../../gcc-4.7.0/./libgcc/unwind-dw2.c:38:
> ./gthr-default.h:140:1: error: ‘pthread_once’ undeclared here (not in a
> function)

Something is wrong with your system, gthr-default.h should be a
symlink to gthr-posix.h which includes <pthread.h> which declares
pthread_once.  If pthread_once is undeclared then your <pthread.h> is
broken or there is another file of that name somewhere on your system.


> These are the configure options i made:
>
>  $ ../gcc-4.7.0/./configure --disable-multilib --enable-threads=posix
> --with-tune=generic --prefix=/usr --with-pkgversion=Ubuntu/Linaro
> 4.7.0-9ubuntu3 --enable-shared --libexecdir=/usr/lib --with-sysroot=/
> --enable-plugin --enable-libgomp --enable-objc-gc -disable-tls
> --enable-version-specific-runtime-libs --with-gmp=/usr/local/5.0.5
> --with-mpfr-include=/usr/include --with-mpfr-lib=/usr/lib
> --with-mpc-include=/usr/include --with-mpc-lib=/usr/lib

These options are unnecessary, /usr/include will always be searched
for headers and /usr/lib will be searched for libraries.

> --enable-gather-detailed-mem-stats --enable-coverage=opt
> --enable-checking=all --with-dwarf2 --with-fpmath=sse

Are you sure you want --enable-checking=all enabled?

> --with-endian=little,big --with-arch-32=i686

--with-endian doesn't do anything for i686, why are you using it?

> --enable-languages=c,ada,c++,fortran,go,java,lto,objc,obj-c++
> --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu

Have you tried simplifying your configure command, instead of using a
load of redundant or invalid options?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux