Globals definitions in library files

Gjerstad, Øyvind via Aubit4gl-discuss <[email protected]> Tue, 6 Feb 2024 14:30:20 +0000
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <GV1PR02MB87302FBCAD47830DB331D0588F462@GV1PR02MB8730.eurprd02.prod.outlook.com>
--===============5465993796153754851==
Content-Language: en-AU
Content-Type: multipart/alternative;
	boundary="_000_GV1PR02MB87302FBCAD47830DB331D0588F462GV1PR02MB8730eurp_"

--_000_GV1PR02MB87302FBCAD47830DB331D0588F462GV1PR02MB8730eurp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I have just started to recompile some legacy 4gl code on Red Hat EL 9 (or, =
rather in a docker container based on Red Hat UBI 9). The code is currently=
 in production on RHEL 7. It now seems like gcc 11 is installed on these im=
ages, and the default for "common" code blocks is to be put in the RSS segm=
ent, while on RHEL 7 it was in "common" code block.

I am now getting linker errors due to multiple definitions of the same code=
 in two files in the same library. I think the reason is that both of these=
 are containing the same content in the GLOBALS section in 4gl code.

I have tried to enforce the same behaviour as on RHEL 7 with the compiler o=
ption "-fcommon", but I can't get it to work, the resulting .o file shows n=
o difference regardless.

If I extract the common code into a separate file, and refer to that file i=
n the GLOBALS section, it may work, but how are global files handled in a s=
tatic library archive? How should the .glb.dat-file be handled if it is ins=
ide an archive?

Or, maybe I'm barking at the wrong tree. Is it possible to see what compile=
r options 4glpc is passing along to the C compiler?

--_000_GV1PR02MB87302FBCAD47830DB331D0588F462GV1PR02MB8730eurp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
I have just started to recompile some legacy 4gl code on Red Hat EL 9 (or, =
rather in a docker container based on Red Hat UBI 9). The code is currently=
 in production on RHEL 7. It now seems like gcc 11 is installed on these im=
ages, and the default for &quot;common&quot;
 code blocks is to be put in the RSS segment, while on RHEL 7 it was in &qu=
ot;common&quot; code block.&nbsp;<br>
<br>
I am now getting linker errors due to multiple definitions of the same code=
 in two files in the same library. I think the reason is that both of these=
 are containing the same content in the GLOBALS section in 4gl code.&nbsp;<=
br>
<br>
I have tried to enforce the same behaviour as on RHEL 7 with the compiler o=
ption &quot;-fcommon&quot;, but I can't get it to work, the resulting .o fi=
le shows no difference regardless.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
If I extract the common code into a separate file, and refer to that file i=
n the GLOBALS section, it may work, but how are global files handled in a s=
tatic library archive? How should the .glb.dat-file be handled if it is ins=
ide an archive?</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Or, maybe I'm barking at the wrong tree. Is it possible to see what compile=
r options 4glpc is passing along to the C compiler?</div>
</body>
</html>

--_000_GV1PR02MB87302FBCAD47830DB331D0588F462GV1PR02MB8730eurp_--


--===============5465993796153754851==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5465993796153754851==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

--===============5465993796153754851==--