[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Undocumented cobc option: -static

From: Scott McKellar
Subject: [open-cobol-list] Undocumented cobc option: -static
Date: Thu, 13 Nov 2014 08:23:28 -0800

There appears to be an undocumented option to cobc: -static.

So far as I can tell, this option tells cobc to translate CALL statements to 
static calls instead of dynamic calls.

However I only discovered that by trial and error.  A program that wasn't 
working without -static is now working with it.  I also examined the generated 
C code to verify that it's different.  I don't know what other effects -static 
may have.

However, -static is not listed among the compile options in the FAQ, nor in the 
corresponding page in Gary Cutler's book (I'm looking at the FAQ for GnuCOBOL 
v1.1 and the Cutler book for v2.0).  My only clue that -static was even 
available was that I saw it used in a couple of examples on the FAQ page.  I 
took a wild guess at what it did, and it looks like I guessed right.

I'm glad I found out about -static because the default of dynamic linking could 
have been a deal-breaker.  Without -static I couldn't find a way to link to a 
static library (a *.a file on a UNIX or Linux system).  Migrating to GnuCOBOL 
would be even more disruptive if we had to use dynamic linking everywhere.  It 
might not even be possible; for all I know we may rely on a third party static 
library somewhere that isn't available as a shared library.


Have I interpreted -static correctly?

Does -static have any other effects that I didn't notice?

Will -static be available in v2.0?  (I'm currently doing my explorations using 

Could someone please please document -static in the FAQ and wherever else is 

Scott McKellar

reply via email to

[Prev in Thread] Current Thread [Next in Thread]