- 开发者
- 鲲鹏移植专家服务
#鲲鹏移植专家服务#
-
图片文件无法查看 可以访问这篇文章【功能模块】移植netty-all-4.0.52.Final.jar 时遇到问题arm 配置如下[INFO] os.detected.name: linux [INFO] os.detected.arch: aarch_64 [INFO] os.detected.release: "kylin" [INFO] os.detected.release.version: V10 [INFO] os.detected.release.like."kylin": true [INFO] os.detected.classifier: linux-aarch_64在编译 netty-tcnative-netty-tcnative-parent-2.0.7.Final 下的子模块 openssl-dynamic 跟 openssl-static 需要的问题 (2个问题 前后有依赖关系)已参考: 主要是按照 (把孤独当做晚餐 的文档一步步走的)Spark-2.2.0-bin-hadoop2.6移植指南 for 中标麒麟7.5下 5.6 编译netty-all-4.0.43.Final.jar黄龙吐翠: netty-all-4.0.36.Final.jar 软件移植指导书皮卡皮卡@银河护卫队: netty-all-4.0.42-Final.jar编译指导 ★★★把孤独当做晚餐: netty-all-4.0.52.Final.jar 移植指南(CentOS 7.4)【操作步骤&问题现象】前置操作: 在编译时遇到的 apr 跟 openssl 问题 在编译前已经将所需要的包 统一下载并移动到指定目录wget https://archive.apache.org/dist/apr/apr-1.6.3.tar.gz wget https://ftp.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz wget http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.5.5.tar.gz mkdir -p openssl-static/target mkdir -p libressl-static/target cp apr-1.6.3.tar.gz openssl-static/target/ cp apr-1.6.3.tar.gz libressl-static/target/ cp openssl-1.0.2l.tar.gz openssl-static/target/ cp libressl-2.5.5.tar.gz libressl-static/target/部分 pom 注释下载与编译 1. netty-tcnative-parent pom 下的 屏蔽 <boringssl-static> 编译 <modules> <module>openssl-dynamic</module> <module>openssl-static</module> <!--<module>boringssl-static</module>--> <module>libressl-static</module> </modules> 2. 下载 apr-1.x.x.tar.gz <!--<get src="http://archive.apache.org/dist/apr/${aprArchiveFile}" dest="${project.build.directory}/${aprArchiveFile}" verbose="on" />--> <!--<get src="http://archive.apache.org/dist/apr/${aprTarGzFile}" dest="${project.build.directory}/${aprTarGzFile}" verbose="on" />--> 3. 下载 openssl-1.0.2j.tar.gz openssl-static/pom.xml 下三处下载 <!-- Download the openssl source. --> 都已经注释了 <!--<ftp action="get" server="ftp.openssl.org" remotedir="source" userid="anonymous" password="anonymous" passive="yes" verbose="yes"> <fileset dir="${project.build.directory}"> <include name="**/openssl-${opensslVersion}.tar.gz" /> </fileset> </ftp> -->其他依赖的版本如下1. jdk java version "1.8.0_281" Java(TM) SE Runtime Environment (build 1.8.0_281-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode) 2. mvn Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00) Maven home: /usr/local/maven Java version: 1.8.0_281, vendor: Oracle Corporation Java home: /usr/local/jdk/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "4.19.90-17.ky10.aarch64", arch: "aarch64", family: "unix" 3. openssl OpenSSL> version OpenSSL 1.0.2l 25 May 2017 4. gcc 使用内建 specs。 COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-linux-gnu/7.3.0/lto-wrapper 目标:aarch64-linux-gnu 配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --with-multilib-list=lp64 线程模型:posix gcc 版本 7.3.0 (GCC) 5. 如果还需要其他环境请指出 备注: 没有执行 解决-fsigned-char问题 相关的命令 (跟这个没有太大的关系吧)后序操作 (问题出现在这里):前置操作完成后 直接执行 mvn install -e -X 在编译到 OpenSSL - Dynamic 时出现的问题 (问题一)/usr/local/jdk/jre/bin/java: symbol lookup error: xxx /native/linux64/libnetty_tcnative.so: undefined symbol: SSLeay (完整的log日志信息一)疑问: xx.so 是在编译时 哪些 c 没有成功编译吗 由于是 测试文件 暂时使用 -Dmaven.test.skip=true 先跳过了[INFO] skip non existing resourceDirectory /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic/src/test/resources [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ netty-tcnative --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 2 source files to /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.15:test (default-test) @ netty-tcnative --- [INFO] Surefire report directory: /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running io.netty.internal.tcnative.CertificateVerifierTest /usr/local/jdk/jre/bin/java: symbol lookup error: /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic/target/test-classes/META-INF/native/linux64/libnetty_tcnative.so: undefined symbol: SSLeay Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Netty/TomcatNative [Parent] 2.0.7.Final ............ SUCCESS [ 4.739 s] [INFO] Netty/TomcatNative [OpenSSL - Dynamic] ............. FAILURE [ 34.116 s] [INFO] Netty/TomcatNative [OpenSSL - Static] .............. SKIPPED [INFO] Netty/TomcatNative [LibreSSL - Static] 2.0.7.Final . SKIPPED [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test (default-test) on project netty-tcnative: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? [ERROR] Command was/bin/sh -c cd /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic && /usr/local/jdk/jre/bin/java -server -dsa -da -ea:io.netty... -XX:+AggressiveOpts -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+UseFastAccessorMethods -XX:+OptimizeStringConcat -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -jar /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic/target/surefire/surefirebooter3240107816716701985.jar /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic/target/surefire/surefire2111163751593332808tmp /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-dynamic/target/surefire/surefire_08128177537678066406tmp [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging.出现单元测试部分的问题 尝试使用 mvn install -e -X -Dmaven.test.skip=true 继续执行在编译 OpenSSL-static 时出现了 问题 如下(.text+0x10c8): dangerous relocation: unsupported relocation (问题二) 目前卡在这里了[INFO] /usr/bin/ld: /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-static/target/ssl/lib/libcrypto.a(sha256-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC [INFO] /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-static/target/ssl/lib/libcrypto.a(sha256-armv8.o): in function `sha256_block_data_order': [INFO] (.text+0xf48): dangerous relocation: unsupported relocation [INFO] /usr/bin/ld: /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-static/target/ssl/lib/libcrypto.a(sha512-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC [INFO] /tmp/xliu/netty/netty-tcnative-netty-tcnative-parent-2.0.7.Final/openssl-static/target/ssl/lib/libcrypto.a(sha512-armv8.o): in function `sha512_block_data_order': [INFO] (.text+0x10c8): dangerous relocation: unsupported relocation [INFO] collect2: error: ld returned 1 exit status [INFO] make: *** [Makefile:490:libnetty_tcnative.la] 错误 1 [INFO] rc: 2 xxx [ERROR] Failed to execute goal org.fusesource.hawtjni:maven-hawtjni-plugin:1.11:build (build-native-lib) on project netty-tcnative-openssl-static: build failed: org.apache.maven.plugin.MojoExecutionException: make based build failed with exit code: 2 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.fusesource.hawtjni:maven-hawtjni-plugin:1.11:build (build-native-lib) on project netty-tcnative-openssl-static: build failed: org.apache.maven.plugin.MojoExecutionException: make based build failed with exit code: 2 【截图信息】题一截图问题二截图【日志信息】(可选,上传日志内容或者附件)问题一:mvn-install-netty-tcnative-netty-tcnative-parent-2.0.7.Final-1.log附件无法上传 请复制该链接并在 浏览器中打开 https://www.yuque.com/docs/share/b5989b19-3025-40a5-b09e-ffa034dc2854?# 《移植netty-all-4.0.52.Final.jar 时遇到问题》问题二: mvn-install-netty-tcnative-netty-tcnative-parent-2.0.7.Final-2.log附件无法上传 请复制该链接并在 浏览器中打开 https://www.yuque.com/docs/share/b5989b19-3025-40a5-b09e-ffa034dc2854?# 《移植netty-all-4.0.52.Final.jar 时遇到问题》
推荐直播
-
HDC深度解读系列 - Serverless与MCP融合创新,构建AI应用全新智能中枢2025/08/20 周三 16:30-18:00
张昆鹏 HCDG北京核心组代表
HDC2025期间,华为云展示了Serverless与MCP融合创新的解决方案,本期访谈直播,由华为云开发者专家(HCDE)兼华为云开发者社区组织HCDG北京核心组代表张鹏先生主持,华为云PaaS服务产品部 Serverless总监Ewen为大家深度解读华为云Serverless与MCP如何融合构建AI应用全新智能中枢
回顾中 -
关于RISC-V生态发展的思考2025/09/02 周二 17:00-18:00
中国科学院计算技术研究所副所长包云岗教授
中科院包云岗老师将在本次直播中,探讨处理器生态的关键要素及其联系,分享过去几年推动RISC-V生态建设实践过程中的经验与教训。
回顾中 -
一键搞定华为云万级资源,3步轻松管理企业成本2025/09/09 周二 15:00-16:00
阿言 华为云交易产品经理
本直播重点介绍如何一键续费万级资源,3步轻松管理成本,帮助提升日常管理效率!
回顾中
热门标签