This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
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
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-19 08:00 UTC by stefan.michel
Modified: 2016-12-03 02:27 UTC (History)
4 users (show)

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


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

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

https://github.com/mono/mono/pull/4032
Comment 4 Miguel de Icaza [MSFT] 2016-12-03 02:27:06 UTC
Mergerd

Note You need to log in before you can comment on or make changes to this bug.