From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18166 invoked by alias); 10 Jun 2008 16:12:31 -0000 Received: (qmail 18013 invoked by uid 22791); 10 Jun 2008 16:12:29 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.171) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jun 2008 16:12:01 +0000 Received: by ug-out-1314.google.com with SMTP id m2so120186ugc.17 for ; Tue, 10 Jun 2008 09:11:58 -0700 (PDT) Received: by 10.210.102.16 with SMTP id z16mr4278891ebb.22.1213114318366; Tue, 10 Jun 2008 09:11:58 -0700 (PDT) Received: from ?192.168.0.190? ( [128.40.197.43]) by mx.google.com with ESMTPS id c22sm11537688ika.1.2008.06.10.09.11.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Jun 2008 09:11:57 -0700 (PDT) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <6C3D9E30-D1F7-41F6-961F-AFD711C5BBC4@gmail.com> Cc: Fortran List , GCC Development Content-Transfer-Encoding: quoted-printable From: FX Subject: Re: [RFC, Patch, gfortran] make -static-libgfortran work on darwin. Date: Tue, 10 Jun 2008 16:12:00 -0000 To: IainS X-Mailer: Apple Mail (2.753.1) Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00246.txt.bz2 > The solution is to name the libs differently (as is done elsewhere=20=20 > in gcc). Target libraries named differently? Which? libssp has three variants,=20=20 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=20=20=20=20=20= =20=20 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=20=20 > leave the shared name unchanged. I'd suggest "-static" instead of using an underscore, to follow=20=20 libstdc++, but that's a minor point. But more fundamentally, what is the reason that the linker can't be=20=20 persuaded to link a static library instead of a shared one? The=20=20 reason for that is that for darwin hosts, HAVE_LD_STATIC_DYNAMIC is=20=20 not defined. The description for that macro is "Define if your linker=20=20 supports -Bstatic/-Bdynamic option.". So, is there a way Darwin way=20=20 to achieve the same goal (according to my googling, there isn't, but=20=20 I might have missed something). Otherwise, wrt your patch: doesn't it create three libraries:=20=20 libgfortran.dylib, libgfortran.a and libgfortran_static.a? And, what=20=20 happens now if you do a -static compilation, does it pick=20=20 libgfortran_static automagically? Shouldn't we make that darwin-=20 specific, in order to not change the situation on the majority of=20=20 other systems that don't have a problem with the current situation? Thanks, FX --=20 Fran=E7ois-Xavier Coudert http://www.homepages.ucl.ac.uk/~uccafco/