Re: Globals definitions in library files

Stansoft <[email protected]> Tue, 6 Feb 2024 17:36:29 -0500 (EST)
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323328-1971063528-1707258989=:32175
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

Try to compile this way:

4glpc -Xcompiler -fcommon

or

CFLAGS=3D-fcommon 4glpc


On Tue, 6 Feb 2024, Gjerstad, =D8yvind via Aubit4gl-discuss wrote:

> 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 current=
ly in production on RHEL 7. It now seems like gcc 11 is installed on these =
images, and the default for "common" code blocks is to be put in the RSS se=
gment, while on RHEL 7 it was in "common" code block.
>
> I am now getting linker errors due to multiple definitions of the same co=
de in two files in the same library. I think the reason is that both of the=
se 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=
 option "-fcommon", but I can't get it to work, the resulting .o file shows=
 no difference regardless.
>
> If I extract the common code into a separate file, and refer to that file=
 in the GLOBALS section, it may work, but how are global files handled in a=
 static library archive? How should the .glb.dat-file be handled if it is i=
nside an archive?
>
> Or, maybe I'm barking at the wrong tree. Is it possible to see what compi=
ler options 4glpc is passing along to the C compiler?
>
--8323328-1971063528-1707258989=:32175
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--8323328-1971063528-1707258989=:32175
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

--8323328-1971063528-1707258989=:32175--