This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [RFC, Patch, gfortran] make -static-libgfortran work on darwin.
- From: FX <fxcoudert at gmail dot com>
- To: IainS <developer at sandoe-acoustics dot co dot uk>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 10 Jun 2008 17:11:53 +0100
- Subject: Re: [RFC, Patch, gfortran] make -static-libgfortran work on darwin.
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:in-reply-to:references :mime-version:content-type:message-id:cc:content-transfer-encoding :from:subject:date:to:x-mailer; bh=AesjlALuIT5RPk4rssmPmQ1temy6riFhWyELksvzsvQ=; b=SwnBXnPX1BiJuuQSo63s6B+2jbnLG4l8UQ1YeNx9FNJ86hkpurd+UCDCElfvQQjp2B CcqknmqahAKl7KaQdQaNpaK4WAkfOdcDdzeuzz96aM6vkfuJ/52Fqy4Axf+QSqS+FoM0 zrNgS31S8FyeHqCIMyYCC+oWJ6A3+nqqSGdMM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=in-reply-to:references:mime-version:content-type:message-id:cc :content-transfer-encoding:from:subject:date:to:x-mailer; b=eUTfyZBFjQjlHJdm24kt0zm2J9lbSULZ127pBBalz7dKfiv0pXb+CcZUG/d6BtoDvI 1gRik10S4xqcrEP4oxp3zZ2sW/mvRd9m0xqHr3/qBS7iqhTGLnqveTbOuKthzmnUS+00 5y7BET/gMmur5xGDOXIvg19JR8mAOImu9PKM0=
- References: <A6664290-AFD1-4FCE-97E5-01DE56BB8B1D@sandoe-acoustics.co.uk>
The solution is to name the libs differently (as is done elsewhere
in gcc).
Target libraries named differently? Which? libssp has three variants,
which I don't really understand :)
$ ls libssp*
libssp.0.dylib libssp.dylib libssp_nonshared.a
libssp.a libssp.la libssp_nonshared.la
libgomp has shared and static libraries with the same name:
$ ls libgomp.*
libgomp.1.dylib libgomp.a libgomp.dylib libgomp.la
libgomp.spec
Only libstdc++ has the naming patter you mention, as far as I can tell:
$ ls libstdc++*
libstdc++-static.a libstdc++.6.0.4.dylib libstdc++.6.dylib
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.
But more fundamentally, what is the reason that the linker can't be
persuaded to link a static library instead of a shared one? The
reason for that is that for darwin hosts, HAVE_LD_STATIC_DYNAMIC is
not defined. The description for that macro is "Define if your linker
supports -Bstatic/-Bdynamic option.". So, is there a way Darwin way
to achieve the same goal (according to my googling, there isn't, but
I might have missed something).
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?
Thanks,
FX
--
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/