[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Once more: -static linking
From: |
rudolf |
Subject: |
Once more: -static linking |
Date: |
Thu, 19 Oct 2023 15:16:41 +0200 (CEST) |
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'?
BR
Rudolf
--
Rudolf Schubert \
Kirchstr. 18a \ mailto:rudolf@muc.de
82054 Sauerlach > http://www.dose.muc.de
Deutschland / (alpine archkiste)
Tel. 08104/908311 /
- Once more: -static linking,
rudolf <=