RESOLVED FIXED132542
There is no HW_AVAILCPU on FreeBSD, NetBSD, and OpenBSD
https://bugs.webkit.org/show_bug.cgi?id=132542
Summary There is no HW_AVAILCPU on FreeBSD, NetBSD, and OpenBSD
Ting-Wei Lan
Reported 2014-05-03 23:09:58 PDT
Revision 167815 changes HW_NCPU to HW_AVAILCPU, which causes build failure on FreeBSD with the following message: /home/lantw44/gnome/source/webkit-trunk/Source/WTF/wtf/NumberOfCores.cpp:56:13: error: use of undeclared identifier 'HW_AVAILCPU' HW_AVAILCPU ^ /home/lantw44/gnome/source/webkit-trunk/Source/WTF/wtf/NumberOfCores.cpp:58:43: error: invalid application of 'sizeof' to an incomplete type 'int []' int sysctlResult = sysctl(name, sizeof(name) / sizeof(int), &result, &length, 0, 0); ^~~~~~ 2 errors generated. I run `grep -r HW_AVAILCPU /usr/include` on FreeBSD, NetBSD, OpenBSD, and there is no HW_AVAILCPU.
Attachments
Patch (1.55 KB, patch)
2014-05-05 00:45 PDT, Alberto Garcia
no flags
Patch (2.08 KB, patch)
2014-05-05 04:34 PDT, Alberto Garcia
msaboff: review+
Alberto Garcia
Comment 1 2014-05-05 00:45:10 PDT
Ting-Wei Lan
Comment 2 2014-05-05 02:09:50 PDT
(In reply to comment #1) > Created an attachment (id=230810) [details] > Patch > > It looks like it should be done using sysconf() as well, like we do in Linux: > > http://www.freebsd.org/cgi/man.cgi?query=sysconf&sektion=3&n=1 > http://www.openbsd.org/cgi-bin/man.cgi?query=sysconf&sektion=3&format=html > http://netbsd.gw.com/cgi-bin/man-cgi?sysconf++NetBSD-current > > Can someone try this patch? #include <unistd.h> is needed to use this patch on FreeBSD.
Alberto Garcia
Comment 3 2014-05-05 04:34:23 PDT
Created attachment 230819 [details] Patch > #include <unistd.h> is needed to use this patch on FreeBSD. Right, here's the updated version.
Michael Saboff
Comment 4 2014-05-05 09:10:54 PDT
Comment on attachment 230819 [details] Patch r=me
Ting-Wei Lan
Comment 5 2014-05-05 19:00:37 PDT
This patch fixes the build problem on FreeBSD.
Alberto Garcia
Comment 6 2014-05-06 03:58:41 PDT
Note You need to log in before you can comment on or make changes to this bug.