在Solaris上编译Mono

5
我将尝试在Solaris 10上编译mono。我尝试了从2.11.4版本到今天最新的5.xx版本,但是一直失败。
我使用的硬件是Sun-Fire-v240,其具有SPARC处理器。此外,操作系统版本为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上编译Mono?我已经寻找这个问题一段时间了,但对于我的情况,我没有得到有效的结果。我不太擅长UNIX系统,所以我想我可能遗漏了什么......

谢谢。 最好的祝福,Orhan。

1个回答

2

看起来这是一个两年前的Mono bug,Bug 31999 - C99和XPG5在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及以上版本中,只有使用XPG6/_XOPEN_SOURCE=600才能使用C99。完全省略_XOPEN_SOURCE定义并不是一个选项,因为没有它,<sys/socket.h>的结构体msghdr缺少msg_flags成员。


很抱歉告诉你,这个方法没有起作用。它仍然显示相同的错误。 - OrhanT
@OrhanT 如果你运行 grep PTHREAD_MUTEX_RECURSIVE /usr/include/*,你会看到什么? - Andrew Henle
它打印出/usr/include/pthread.h:#define PTHREAD_MUTEX_RECURSIVE 0x4 - OrhanT
基于 Solaris 11.3 上 GnuTLS 的同样错误,我认为您需要 CFLAGS+=("-D_XOPEN_SOURCE=600 -std=c99")CXXFLAGS+=("-std=c++03")。在 GnuTLS 的情况下,该项目正在使用 -std=gnu99 用于 C 文件。 - jww

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接