Tomcat tcnative 在 solaris 上构建

标签 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'

最佳答案

您要构建 64 位吗?如果是这样,您必须使用 -kPIC/-kpic 进行编译或适当的 -xcode=picX选项,作为 Solaris 共享对象 pretty much require position-independent code , 还有 32 位的情况下你必须做同样的事情:

The code within a dynamic executable is typically position-dependent, and is tied to a fixed address in memory. Shared objects, on the other hand, can be loaded at different addresses in different processes. Position-independent code is not tied to a specific address. This independence allows the code to execute efficiently at a different address in each process that uses the code. Position-independent code is recommended for the creation of shared objects.

The compiler can generate position-independent code under the -K pic option.

If a shared object is built from position-dependent code, the text segment can require modification at runtime. This modification allows relocatable references to be assigned to the location that the object has been loaded. The relocation of the text segment requires the segment to be remapped as writable. This modification requires a swap space reservation, and results in a private copy of the text segment for the process. The text segment is no longer sharable between multiple processes. Position-dependent code typically requires more runtime relocations than the corresponding position-independent code. Overall, the overhead of processing text relocations can cause serious performance degradation.

关于Tomcat tcnative 在 solaris 上构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34179655/

相关文章:

java web 服务器 - 浏览器找不到新创建的文件,直到服务器重新启动

java - tomcat上的Spring Boot WAR文件部署显示错误404

c - c 中的 OpenSSL 命令获取 RSA 中公钥的模数

django - 如何在 Django 中安装 Solr 以与 Haystack 一起使用

java - Tomcat 安全约束 TRACE 不一致

linux - 无法通过 asdf 使用 openssl 安装 Erlang (Ubuntu 18.04.1)

java - 自定义 Tomcat Realm 和 Lib 目录中的一整套 JAR

java - Spring 3 + Tomcat 6 : Form validation exception - java. lang.NoSuchMethodError : javax. el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;

java - 存储由 java servlet (Tomcat) 检索的大数据的最佳位置

Azure Linux Web 应用程序 : change OpenSSL default security level?