在 RHEL 上为 COBOL DB2 链接静态文件时出错

问题描述 投票:0回答:0

在遇到错误的 RHEL 8.6 服务器上为 DB2 编译/链接 COBOL 代码。

命令运行:

cob2 -F/etc/cob2.cfg -v myfile.cbl -L/opt/IBM/db2/V11.5/lib32 -I/opt/IBM/db2/V11.5/include/cobol_a -ldb2 -q"size(16384k)" -L. linkfile.a -o myfile.exe

db2level 信息标记为“DB2 v11.5.0.0”、“s1906101300”、“DYN1906101300AMD64”和 Fix Pack“0”。产品安装在“/opt/IBM/db2/V11.5”

cob2 -V Program cob2 Version 1.1.0 Built Mon Sep 27 10:39:30 2021

错误信息: /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib/Scrtl.0(.text+0x1c): 无法解析的 R_386_GOTOFF 重定位符号'__libc_csu_fini' /usr/bin/ld:最终链接失败:输出中不可表示的部分 collect2:错误 ld 返回 1 退出状态。

尝试更改各种选项但现在选项用完了。 我期待/希望有一个干净的编译和链接,以及可用的 .exe 文件。

没有设置 CFLAGS 和/或 LDFLAGS。

gcc -v 使用内置规范。 COLLECT GCC=gcc COLLECT LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 目标:x86_64-redhat-linux 配置为:../configure --enable -bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http:/ /bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable- __cxa_atexit --disable-libunwind-异常 --enable-gnu-unique-objext --enable-linkr-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable- initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune -generic --with-arch_32=x86-64 --build=x86_64-redhat-linux 线程模型:posix gcc version 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC)

cob2 的传入参数向量... [ 0] - 4: cpb2 [ 1] - 2: -# [ 2] - 15: -F/etc/cob2.cfg [ 3] - 2: -v [ 4] - 18:/tmp/out/myfile.cbl [5] - 10:linkfile.a [6] - 26:-L/opt/IBM/db2/V11.5/lib32 [7] - 36:-I/opt/ IBM/db2/V11.5/include/cobol_a [ 8] - 5: -ldb2 [ 9] - 14: -qsize(16384K) [10] - 2: -o [11] - 20: /code/bin/myfile .exe

传出环境变量... PATH: /opt/ibm/cobol/1.1.0/usr/bin/:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/user1/// bin/usr/bin/X11:/sbin:/:/code/bin:/code/scripts/home/user1//sqllib/bin LIBPATH: /home/user1//sqllib/lib:/usr/lib:/lib LD_LIBRARY_PATH: /opt/ibm/cobol/rte/usr/lib/:/opt/ibm/cobol/rte/:/opt/ibm/cobol1.1.0/usr/lib:home/user1/sqllib/lib32:/home/ user1//sqllib/lib32/gskit NLSPATH: /opt/ibm/cobol/rte/usr/lib/usr/share/locale/%L/%N:/opt/ibm/cobol/rte/usr/share/locale/ %L/%N:/opt/ibm/cobol/1.1.0/usr/share/locale/%L/%N:/opt/IBM/db2/V11.5/msg/%L/%N:/opt /IBM/db2/V11.5/msg/en_US/%N SYSLIB: /opt/IBM/db2/V11.5/include/cobol_a:/opt/IBM/db2/V11.5/include/cobol_a

/opt/ibm/cobol/1.1.0/usr/bin/cob3 的传出参数向量 ... [ 0] - 33 /opt/ibm/cobol/1.1.0/usr/bin/cob3 [ 1] - 14 -qsize(16384K)

exec: /opt/ibm/cobol/1.1.0/usr/bin/cob3 -qsize(16384K) /tmp/myfile.cbl

/usr/bin/gcc 的传出参数向量 ... [ 0] - 12: /usr/bin/gcc [ 1] - 4: -m32 [ 2] - 7: -shared [ 3] - 5: -fPIC [ 4] - 9: -rdynamic [ 5] - 28: -fasynchronous -unwind -tables [ 6] - 20: -W1, --hash-style=gnu [ 7] - 18: -W1, --export-dynam [ 8] - 14: -W1, -Bsymbolic [ 9] - 14: -W1, --build-id [10] - 22: -W1, --enable-new-dtags [11] - 11: -W1, -zrelro [12] - 9:-W1,-znow [13] - 10:-W1,-zdefs [14] - 18:-W1,-z,noexecstack [15] - 12:-W1,-znotext [16 ] - 27: -W1, ---allow-shlib-undefined [17] - 4: -pie [18] - 5: -fPIE [19] - 15: --fwhole-program [20] - 15: -W1 , --as-needed [21] - 8: myfile.o [22] - 10: linkfile.a [23] - 26: -L/opt/IBM/db2/V11.5/lib32 [24] - 5: ldb2 [25] - 2: -o [26] - 19: /code/bin/myfile.exe [27] - 15: -W1, --no-omagic [28] - 13: -W1, Bdynamic [29] - 15: -W1, --as-needed [30] - 31: L/opt/ibm/cobol/1.1.0/usr/lib/ [31] - 29: L/opt/ibm/cobol/rte/usr /lib/ [32] - 10: -lcob2_32s [33] - 10: -lcob2_32r [34] - 9: -ldfp_32r [35] - 3: -lm [36] - 9: -lpthread [37] - 150: - W1,-rpath,/opt/ibm/cobol/rte/usr/lib/:/opt/ibm/cobol/rte/:/opt/ibm/cobol/1.1.0/usr/lib/:/home/user1/ /sqllib/lib32:/home/user1/sqllib/lib32/gskit

exec: /usr/bin/gcc -m32 -shared -fPIC -rdynamic -fasynchronous -unwind -tables -W1, --hash-style=gnu -W1, --export-dynam -W1, -Bsymbolic -W1, - -build-id -W1, --enable-new-dtags -W1, -zrelro -W1, -znow -W1, -zdefs -W1, -z,noexecstack -W1, -znotext -W1, ---allow-shlib -undefined -pie -fPIE --fwhole-program -W1, --as-needed myfile.o linkfile.a -L/opt/IBM/db2/V11.5/lib32 ldb2 -o /code/bin/myfile.exe -W1, --no-omagic -W1, Bdynamic -W1, --as-needed L/opt/ibm/cobol/1.1.0/usr/lib/ L/opt/ibm/cobol/rte/usr/lib/ -lcob2_32s -lcob2_32r -ldfp_32r -lm -lpthread -W1, -rpath,/opt/ibm/cobol/rte/usr/lib/:/opt/ibm/cobol/rte/:/opt/ibm/cobol/1.1.0 /usr/lib/:/home/user1//sqllib/lib32:/home/user1/sqllib/lib32/gskit

gcc db2 linker-errors rhel cobol
© www.soinside.com 2019 - 2024. All rights reserved.