Subject: make fails with undefined reference to '__sched_cpucount'
From: "Feuerbacher, Alan" <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Sun, 28 Aug 2011 21:59:56 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Howdy,

I'm trying to compile coreutils-8.12 in a Dell Xeon workstation environment that runs Redhat 5 (RHEL5). After some time, make fails with:

+verbatim+
../lib/libcoreutils.a(nproc.o): In function `num_processors_via_affinity_mask':
/home/afbacher/GCC/coreutils-8.12/lib/nproc.c:137: undefined reference to `__sched_cpucount'
collect2: ld returned 1 exit status
make[3]: *** [nproc] Error 1
make[3]: Leaving directory `/home/afbacher/GCC/coreutils-8.12/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/afbacher/GCC/coreutils-8.12/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/afbacher/GCC/coreutils-8.12'
make: *** [all] Error 2
-verbatim-

I tracked the problem down to the fact that the RHEL5 system uses /lib64/libc.so.6 which apparently is version 2.5 of the GNU C Library, but this version does not contain "__sched_cpucount" - whatever that is. Apparently only version 2.6 and later contain this stuff.

One problem is that I'm not the sysadmin for this system, and I don't think this can be updated without breaking a lot of other stuff. How do I get around this? I'm only trying to compile a bunch of programs for my own use, not for the entire system.

I'm actually trying to compile glibc-2.14 for various reasons, along with a bunch of other basic GNU software (like gcc-4.6.), and I found that when glibc's installer installs various coreutils programs like rm, as soon as these get installed the programs quit working because of incompatible ABI's and such. That's why I thought I needed to install the latest coreutils.

I'm probably missing something badly, but I more than a bit confused about the order in which the various sets of software need to be installed in order to keep it all consistent.

One thing I've done is to make my $PATH contain the path to my newly built programs. That's why, when the glibc installer installs rm and such, various other programs quit working, because there's a lot of interdependence. So what's my best approach with all this?

Alan Feuerbacher