0

I am trying to compile glib 2.24.2 under Debian 64bit GNU/Linux 6.0.4 (squeeze) using:

gcc 4.0.3
glibc 2.3.6

Configure command:

 CPP="/home/swarkentin/externalBins/bin/cpp" \
 CC="/home/swarkentin/externalBins/bin/gcc" \
 CXX="/home/swarkentin/externalBins/bin/g++" \
 LDFLAGS="-L/home/swarkentin/externalBins/lib64 -L/home/swarkentin/externalBins/lib" \
 CFLAGS="-I /home/swarkentin/externalBins/include -O2 -fno-strict-aliasing -fno-omit-frame-pointer" \
 ./configure --prefix=/home/swarkentin/target   \
 --enable-static --disable-shared

I am getting an error:

checking thread related cflags... -D_REENTRANT
checking for pthread_create/pthread_join... no
checking for pthread_create/pthread_join in -lpthread... no
checking for pthread_create/pthread_join in -lpthread32... no
checking for pthread_create/pthread_join in -lpthreads... no
checking for pthread_create/pthread_join in -lthread... no
checking for pthread_create/pthread_join in -ldce... no
configure: error: I can't find the libraries for the thread implementation
        posix. Please choose another thread implementation or
        provide information on your thread implementation.
        You can also run 'configure --disable-threads'
        to compile without thread support.

How can I point/find posix thread libraries to make it past configure step?

Let's say, I include --disable-threads. Now I can finish configure, but make ends with an error:

gcancellable.c: In function 'IA__g_cancellable_reset':
gcancellable.c:372: error: 'g__cancellable_lock' undeclared (first use in this function)
gcancellable.c:372: error: (Each undeclared identifier is reported only once
gcancellable.c:372: error: for each function it appears in.)
gcancellable.c: In function 'IA__g_cancellable_disconnect':
gcancellable.c:764: error: 'g__cancellable_lock' undeclared (first use in this function)
make[5]: *** [gcancellable.lo] Error 1
1
  • Why are you compiling this? It looks like it is in Debian as libglib2.0-0. The squeeze version is 2.24.2-1. If you want to recompile, use the Debian sources, and recompile those using debuild or debuild binary. If you want to adjust what you use to compile it with, you can do that in debian/rules. Jul 28, 2012 at 17:24

1 Answer 1

1

You are probably missing the libc6-dev package.

Have you run apt-get install build-essential yet?

5
  • I do have that installed, but I want to build from a different glibc and gcc source. I updated my question with --disable-threads used, and get a different error altogether. Jul 19, 2012 at 22:50
  • @SheldonWarkentin If you aren't using the system's standard compiler and libraries, you need to mention that in your question! The problem could be due to a bad installation, or (more likely) to not having pointed the compilation process at the custom compiler and libraries properly. Explain how and where you installed gcc and the C library development files, and how you configured Glib. Jul 19, 2012 at 23:54
  • I have updated my question with my configure command. My glibc is a static library. I narrowed down where the call fails. In config.log, on a call 'checking for pthread_create/pthread_join... no', I noticed that it references '/lib64/libpthread.so.0'. If I were to add --static to the gcc call, this would work with MY glibc. So... maybe I am just missing a flag that adds the '-static' parameter to gcc calls generate by glibc configure. Jul 23, 2012 at 16:10
  • It's called --static. If that's what you are wanting to do, then just add it to your CFLAGS and be done with it. Jul 23, 2012 at 16:16
  • Almost there I think... make fails at:: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ../../gio/.libs/libgio-2.0.a(libinotify_la-inotify-kernel.o)(.text+0x195): In function _ik_startup': : undefined reference to inotify_init' ../../gio/.libs/libgio-2.0.a(libinotify_la-inotify-kernel.o)(.text+0x35b): In function _ik_watch': : undefined reference to inotify_init' ... Jul 23, 2012 at 17:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .