Bug 45683 - Add fallback implementation to compile with glibc that lacks CPU_COUNT
Summary: Add fallback implementation to compile with glibc that lacks CPU_COUNT
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-10-19 08:00 UTC by stefan.michel
Modified: 2016-12-03 02:27 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Add fallback implementation for CPU_COUNT (639 bytes, patch)
2016-10-19 08:39 UTC, stefan.michel

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description stefan.michel 2016-10-19 08:00:21 UTC
mono/utils/mono-proclib.c does not compile on CentOS release 6.6:

	../../doltcompile i686-cp-linux-gnu-gcc -m32 -mtune=i686 --sysroot=/opt/WR/WindRiverLinux-5.0-160520/sysroots/i686-cp-linux -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../mono -I../../libgc/include -I../../eglib/src -I../../eglib/src -fvisibility=hidden -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -D_FILE_OFFSET_BITS=64 -DUSE_COMPILER_TLS  -O2 -pipe -g -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Werror-implicit-function-declaration -MT mono-proclib.lo -MD -MP -MF $depbase.Tpo -c -o mono-proclib.lo mono-proclib.c &&\
	mv -f $depbase.Tpo $depbase.Plo
mono-proclib.c: In function 'mono_cpu_count':
mono-proclib.c:746:4: error: implicit declaration of function 'CPU_COUNT' [-Werror=implicit-function-declaration]
Comment 1 stefan.michel 2016-10-19 08:39:50 UTC
Created attachment 18118 [details]
Add fallback implementation for CPU_COUNT
Comment 2 stefan.michel 2016-10-19 09:16:29 UTC
the same patch needs to be applied to mono/profiler/proflog.c: 
proflog.c: In function 'mono_cpu_count':
proflog.c:2902:4: error: implicit declaration of function 'CPU_COUNT'
Comment 3 Miguel de Icaza [MSFT] 2016-11-28 03:04:53 UTC
Pull request with additional tests, as it is not clear that an #ifdef check for CPU_COUNT is correct

Comment 4 Miguel de Icaza [MSFT] 2016-12-03 02:27:06 UTC