Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to compile the current glibc (2.17) from the official ftp on my machine (kernel 3.7.3). No patches or extras are applied.

For x86_64 everything works fine, but I need the 32-Bit libs as well.

According to the manual, I run this to configure (64-bit already installed):

../../src/glibc-2.17/configure --prefix=/home/user/glibc32 --enable-kernel=3.7.3 BUILD_CC='gcc' CC='gcc -mx32' CXX='g++ -mx32'

At first, I got the error specified in the following line from pread.c and pwrite.c

#ifdef __NR_pread64   /* Newer kernels renamed but it's the same.  */
# ifdef __NR_pread
#  error "__NR_pread and __NR_pread64 both defined???"
# endif
# define __NR_pread __NR_pread64
//Match __NR_pwrite* for pwrite.c accordingly

That didn't make any sense to me, so i changed those to:

#ifdef __NR_pread64   /* Newer kernels renamed but it's the same.  */
# ifndef __NR_pread
#  define __NR_pread __NR_pread64
# endif

Now my error is swapon (misc/swapon.c) not matching the prototype (sys/swap.h):

swapon (path)
    const char *path;
    __set_errno (ENOSYS);
    return -1;

stub_warning (swapon)

The prototype is:

/* Make the block special device PATH available to the system for swapping.
This call is restricted to the super-user.  */
extern int swapon (const char *__path, int __flags) __THROW;

This is clearly no match, but I have no idea, how to bypass this...

There must have been people before me who have tried this and I cant imagine there being this kind of errors in a glibc release.

What am i doing wrong?

Should i continue these kind of "fixes"? I cant really just pass 0 as the second parameter, or can I?

share|improve this question
Doesn't your distribution provide multiarch packages for glibc? Setting that up is a real bear... – vonbrand Jan 25 '13 at 19:34
@vonbrand: There is a multiarch package, i'm using debian squeeze; but it's simply too old for what i want to do (I'm a student). – Banyoghurt Jan 25 '13 at 21:07
can you please post the exact error messages as you got them from the compiler? – peterph Jan 25 '13 at 21:24
@Banyoghurt, isn't it easier to upgrade your distribution? If not possible, grab the source package and hack it to build the version you are after? Will even give you packages that you can install cleanly... – vonbrand Jan 25 '13 at 21:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.