rudolf@muc.de writes:
Hi Gaius,
quite some time ago (20 May 2023) I reported problems with static linking
for my 'big squash1 program' (which I sent to you back in April). But I did
not find out how to work around these problems until today.
I played a bit with command line parameters and found that if (additionally)
using '-fm2-whole-program' static linking is working!
As reported, for dynamic linking I use this command:
gm2 -fiso -fsoft-check-all squash1.mod Ctv2.o unix.o -o squash1 -lc -lcrypt -lm
which is working fine.
Then I added '-static' and got the reported errors:
gm2 -fiso -fsoft-check-all squash1.mod Ctv2.o unix.o -o squash1 -lc -lcrypt -lm
-static
Now I use:
gm2 -fm2-whole-program -fiso -fsoft-check-all squash1.mod unix.o -o squash1 -lc
-lcrypt -lm -static
which in fact produces a static binary!
Note that Ctv2.o is missing from the command line. Otherwise I get
'multiple definition' of certain symbols.
My question now is: is this a 'valid workaround' for my problem or should
'-static' also work without '-fm2-whole-program'?
Hi Rudolf,
It should produce a static binary without -fm2-whole-program. What
commands were used to generate objects Ctvt.o unix.o ?
If you are able to email me the objects or source - I'll investigate,
regards,
Gaius