[RFC, Patch, gfortran] make -static-libgfortran work on darwin.

IainS developer@sandoe-acoustics.co.uk
Tue Jun 10 16:40:00 GMT 2008


On 10 Jun 2008, at 17:11, FX wrote:

>> I opted to call the static library "libgfortran_static" and to  
>> leave the shared name unchanged.
>
> I'd suggest "-static" instead of using an underscore, to follow  
> libstdc++, but that's a minor point.

A minor point maybe, but, as you say, there seem to be several  
different schemes in use... a source of confusion for me whilst  
trying to figure out how to do this.

I was almost going to rename the shared one _s (as per libgcc) :-)

j/k aside is there a convention ?

I don't mind (I prefer '-' to '_' personally;    '_static'  and  
'_kext' were used in the 4.0.1 vendor release for darwin8).

> Otherwise, wrt your patch: doesn't it create three libraries:  
> libgfortran.dylib, libgfortran.a and libgfortran_static.a? And,  
> what happens now if you do a -static compilation, does it pick  
> libgfortran_static automagically? Shouldn't we make that darwin- 
> specific, in order to not change the situation on the majority of  
> other systems that don't have a problem with the current situation?

Yes, it does make three libs - only a temporary measure to avoid  
treading on anyone else whilst testing (see below).

The "-static-libgfortran" option causes it to pick up the _static  
version  (patch to gfortranspec.c).

AFAIK there is no point in doing a "-static" link on darwin [crt0 is  
not present] (unless you're making a kernel extension).
However, the proposed change makes no difference to what will happen  
if you do.

You are right;  of course, it should be darwin-specific (and only  
build the required libs per system)
-  but I am not familiar enough with the build process to know how  
best to achieve that... suggestions welcome.

Iain



More information about the Gcc mailing list