This patch to libgo, based on one from Bryan Hundven, fixes libgo's use of CPU_COUNT to check whether CPU_COUNT is defined, rather than checking the glibc version. This works with other libraries, like uclibc. This is issue 38 in the gofrontend issue tracker. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.9 branch.
Ian
diff -r ae56e39c190f libgo/runtime/getncpu-linux.c --- a/libgo/runtime/getncpu-linux.c Thu Oct 02 10:56:06 2014 -0700 +++ b/libgo/runtime/getncpu-linux.c Thu Oct 02 22:01:22 2014 -0700 @@ -6,7 +6,7 @@ #include <sched.h> // CPU_COUNT is only provided by glibc 2.6 or higher -#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6) +#ifndef CPU_COUNT #define CPU_COUNT(set) _CPU_COUNT((unsigned int *)(set), sizeof(*(set))/sizeof(unsigned int)) static int _CPU_COUNT(unsigned int *set, size_t len) { int cnt;