Tomcat tcnative在solaris上构建

时间:2015-12-09 13:08:55

标签: tomcat openssl tomcat7 solaris fips

我试图在我的solaris机器上安装tomcat tc-native

uname -a
SunOS ovtasun4 5.10 Generic_147440-01 sun4u sparc SUNW,Sun-Fire-V240
# which cc
/opt/solarisstudio12.4/bin/cc

我这样配置,

./configure --with-apr=/usr/local/apr/bin/apr-1-config --with-java-home=$JAVA_HOME --with-ssl=/usr/local/ssl --prefix=$CATALINA_HOME 

但是make命令在构建

时会出现此错误
dladdr                              0x85c       /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `libtcnative-1.la'
Current working directory /tomcat/apache-tomcat-8.0.29/bin/tomcat-native-1.1.33-src/jni/native
*** Error code 1
The following command caused the error:
otarget=`echo all-recursive | sed s/-recursive//`; \
list='src os/unix os/win32 '; \
for i in $list; do \
    if test -f "$i/Makefile"; then \
        target="$otarget"; \
        echo "Making $target in $i"; \
        if test "$i" = "."; then \
            made_local=yes; \
            target="local-$target"; \
        fi; \
        (cd $i && make $target) || exit 1; \
    fi; \
done; \
        if test "$otarget" = "all" && test -z "libtcnative-1.la"; then \
    made_local=yes; \
fi; \
if test "$made_local" != "yes"; then \
    make "local-$otarget" || exit 1; \
fi
make: Fatal error: Command failed for target `all-recursive'

1 个答案:

答案 0 :(得分:0)

你在构建64位吗?如果是这样,您必须使用-kPIC/-kpic或正确的-xcode=picX选项进行编译,作为Solaris共享对象pretty much require position-independent code,并且还有32位情况,您必须执行相同的操作:

  

动态可执行文件中的代码通常与位置有关,   并绑定到内存中的固定地址。共享对象,另一方面   手,可以在不同的进程中加载​​不同的地址。   与位置无关的代码与特定地址无关。这个   独立性允许代码在不同的地方有效地执行   在使用代码的每个进程中的地址。与位置无关的代码   建议用于创建共享对象。

     

编译器可以在-K pic下生成与位置无关的代码   选项。

     

如果共享对象是根据位置相关的代码构建的,则为文本   段可能需要在运行时进行修改。这种修改允许   可重定位引用被分配给该对象的位置   已经加载。文本段的重新定位需要   要重新映射为可写的段。此修改需要交换   空间预留,并产生文本段的私人副本   为了这个过程。文本段之间不再可共享   多个过程。与位置相关的代码通常需要更多   运行时重定位比相应的位置无关代码。   总的来说,处理文本重定位的开销可能会导致严重的问题   性能下降。