This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



On 10 Jun 2008, at 20:58, Ralf Wildenhues wrote:


* IainS wrote on Tue, Jun 10, 2008 at 09:42:29PM CEST:
On 10 Jun 2008, at 20:06, Ralf Wildenhues wrote:

Can the driver use path/to/libgfortran.a instead of '-Lpath/to
-lgfortran' to avoid being hindered by missing -Bstatic/-Bdynamic?

this doesn't appear to work. [I've unset DYLD_LIBRARY_PATH in the following]

 ./dst-powerpc/usr/bin/gfortran-4.4.0 helloi.F90 /Volumes/UFSScratch/
GCC/gcc-44-build/dst-powerpc/usr/lib/gcc/powerpc-apple-darwin8/4.4.0/
libgfortran.a -o helloif

Well, what I meant was that on Dargin, gfortran could pass the argument
path/to/libgfortran.a


to collect2, instead of passing
  -Bstatic -lgfortran -Bdynamic

I guess.. [I'll have to try this another day ]
you can do "-nodefaultlibs" and then specify all the libs by hand. That works (I originally did this).
It seems then that the driver has to replicate the multilibs stuff...


I'm not sure that it would produce less darwin-specific code than renaming the lib.

we could campaign for a different linker on OSX/Darwin I guess...

What's the problem with just using the shared library? (Yeah, I knew that question was naive ... but hey, it works ;-)

I'm also happy to file a radar for missing Bstatic/Bdynamic.


We start to require that the end user has administration rights to
install into /usr simply in order to run a program?

I'm not sure whether I understand this comment. Isn't the link-time location of a shared library added to the search path anyway? (My experience with darwin is quite limited, so my memory may serve me wrong here.)

fortran is not part of any standard installation on OSX (yet..., of course, that could change).
On darwin 8 the gcc version is 4.0.1
I don't know whether the 4.2.1 version [from darwin 9] will be officially released
... I've back-ported it (but, that's not an end-user thing)


if you want to deliver any different you have to choose
(a) the end user must install with admin rights [to put stuff in / usr etc.]
(b) static linking of the missing bits


(b) is a lot simpler for me...

ttfn,
Iain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]