Index: uspace/lib/c/generic/bitops.c
===================================================================
--- uspace/lib/c/generic/bitops.c	(revision fa24efa71b4a16342f94d5f63ee75d9242a727c6)
+++ uspace/lib/c/generic/bitops.c	(revision 0c96e6cbb2dc59f725618a8977250a3aa50919ad)
@@ -33,7 +33,13 @@
 #include <bitops.h>
 
-extern int __popcountsi2(int a)
+int __popcountsi2(int a)
 {
-	return __builtin_popcount(a);
+	int bits = 0;
+	for (unsigned int i = 0; i < sizeof(a) * 8; i++)	 {
+		if (((a >> i) & 1) != 0) {
+			bits++;
+		}
+	}
+	return bits;									
 }
 
