Solaris上的单声道编译

时间:2017-06-19 13:17:45

标签: c# mono mutex solaris sparc

我正在尝试在Solaris 10上编译mono。我已经尝试了很多版本,从2.11.4到今天最新的5.xx版本。但我一直都有失败。

我正在使用带有SPARC处理器的 Sun-Fire-v240 硬件。  此外,操作系统版本是 Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC

我得到的问题是:

checking for PTHREAD_MUTEX_RECURSIVE... no
configure: error: Posix system lacks support for recursive mutexes

有没有办法为Solaris编译单声道,我一直在搜索这个问题,但我的情况没有工作结果。我对UNIX系统不是那么好,所以我想我错过了一些东西......

谢谢。 最诚挚的问候,Orhan。

1 个答案:

答案 0 :(得分:2)

这似乎是一个有两年历史的Mono bug,Bug 31999 - C99 and XPG5 don't match on Solaris 10+

checking for PTHREAD_MUTEX_RECURSIVE... no configure: error: Posix
system lacks support for recursive mutexes

这是不正确的。在config.log中我找到了

configure:22190: checking for PTHREAD_MUTEX_RECURSIVE
configure:22206: gcc -m64 -R/vol/gnu/lib/amd64 -c -g -O2 -std=gnu99 -fno-strict-
aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Wall -Wunuse
d -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-pro
totypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-swi
tch -Wno-switch-enum -Wno-unused-value -mno-tls-direct-seg-refs -Wno-char-subscr
ipts -I/vol/mono-4.0/include -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENT
RANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS -g -W
all -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -W
missing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strin
gs -Wno-switch -Wno-switch-enum -Wno-unused-value -DLARGE_CONFIG  -D_XOPEN_SOURC
E=500 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED=1 conftest.c >&5

In file included from /usr/include/pthread.h:8:0,
                 from conftest.c:106:
/vol/gcc-4.8/lib/gcc/i386-pc-solaris2.11/4.8.0/include-fixed/sys/feature_test
s.h:363:2:
error: #error "Compiler or options invalid for pre-UNIX 03 X/Open
applications and pre-2001 POSIX applications"
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^
conftest.c:108:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
  ^
conftest.c:108:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 main ()
 ^
configure:22206: $? = 1
configure: failed program was:
[...]
configure:22213: result: no
configure:22215: error: Posix system lacks support for recursive mutexes

此错误是configure.ac具有

这一事实的假象
  CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"

在Solaris 10及更高版本上,C99只能与XPG6 / _XOPEN_SOURCE = 600一起使用。完全省略_XOPEN_SOURCE定义并不是一个选项,因为没有它,<sys/socket.h> struct msghdr缺少msg_flags成员。