opensource-cobol icon indicating copy to clipboard operation
opensource-cobol copied to clipboard

Static linking error in RHEL9.x

Open n-isaka opened this issue 4 months ago • 0 comments

#59 の内容に関して、RHEL9.xで静的リンクに関するテストがエラーになっていました。 gccのバージョンに依存する問題と考えられ、cob_funcの重複定義が問題となっています。詳細なエラーは末尾に示します。 テストはオプション-z muldefsを付けることで一旦OKにしていますが、cobcでの解決を今後検討します。


Regarding #59, tests related to static linking failed in RHEL9.x. This appears to be a problem related to the version of gcc, and the duplicate definition of cob_func is causing the issue. Details of the error are shown at the end.

The details of the cobc renovation will be considered in the future.


gcc -pipe  -Wl,--export-dynamic -o prog caller.o callee.o  -L/usr/local/lib -lcob -lm -lvbisam -lgmp -lncurses
/usr/bin/ld: callee.o:(.bss+0x0): multiple definition of `cob_unifunc'; caller.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status

n-isaka avatar Aug 01 '25 12:08 n-isaka