我从源代码构建了工件netty-tcnative-openssl-static-2.0.20.Final-linux-x86_64.jar。但是我注意到libnetty_tcnative.so是动态链接到openssl的,而不是静态链接的:
[root@omega 2018-12-14--00-24-20 sb are you NRUSSEL? #]ldd META-INF/native/libnetty_tcnative.so
ldd: warning: you do not have execution permission for `META-INF/native/libnetty_tcnative.so'
linux-vdso.so.1 => (0x00007ffcd42c2000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007febf86b5000)
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007febf82cf000)
librt.so.1 => /lib64/librt.so.1 (0x00007febf80c7000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007febf7e90000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007febf7c72000)
libc.so.6 => /lib64/libc.so.6 (0x00007febf78de000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007febf769a000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007febf73b2000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007febf71ae000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007febf6f82000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007febf6d7d000)
libz.so.1 => /lib64/libz.so.1 (0x00007febf6b67000)
/lib64/ld-linux-x86-64.so.2 (0x0000563e43578000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007febf6964000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007febf6758000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007febf6555000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007febf633b000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007febf611b000)
这是正确的还是我的构建过程有问题?
答案 0 :(得分:0)
是的,不知道您在做什么,但我只是使用netty-tcnative的当前主分支进行了尝试,并且可以正常工作:
./mvnw -pl openssl-static clean package
完成此操作后,您将看到所有预期的结果:
[root@d7724df14184 code]# ldd openssl-static/target/native-lib-only/META-INF/native/linux64/libnetty_tcnative.so
ldd: warning: you do not have execution permission for `openssl-static/target/native-lib-only/META-INF/native/linux64/libnetty_tcnative.so'
linux-vdso.so.1 => (0x00007ffcbadb5000)
librt.so.1 => /lib64/librt.so.1 (0x00007faccd3b1000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007faccd17a000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007facccf5d000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007facccd59000)
libc.so.6 => /lib64/libc.so.6 (0x00007faccc9c5000)
/lib64/ld-linux-x86-64.so.2 (0x00007faccdae9000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007faccc7c2000)
例如,您可以将docker-compose文件用于centos,以确保您具有正确的env环境设置:
netty-tcnative git:(master) docker-compose -f docker/docker-compose.centos.yaml -f docker/docker-compose.centos-6.18.yaml run shell