This is the mail archive of the gcc-patches@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: [patch, darwin] repost of a patch to make "-static-libgfortan" work.



On 23 Dec 2008, at 15:17, Paolo Bonzini wrote:


I haven't looked at the patch, but...

    gcc/config/x-darwin:  add a flag signalling that this host needs
distinct static library names.

This is a target-specific feature, not a host-specific feature. While
Darwin is almost always bootstrapped, you can still see the difference:
if I build a darwin-to-linux cross (build=host=darwin, target=linux) the
linker *will* have working -Bstatic/-Bdynamic.


You can put it in config/darwin.h.

actually, Paolo's comment led to a much simpler solution.


Ironically, the need to have different library names allows substitution in the SPECs. So there is no need to modify code.

so the patch becomes one line in the spec:
gcc/config/darwin.h: substitute -lgfortran-static for -lgfortran when '-static-libgfortran' or '-static' are in effect


and the necessary library re-naming:
libgfortran/Makefile.am : make separately named libgfortran-static.a if the host is darwin, don't generate libgfortran.a
libgfortran/configure.ac: provide a flag on darwin systems that require a separately named static library


	libgfortran/Makefile.in regenerated
	libgfortran/configure regenerated

regtested -m32/-m64 on i686-apple-darwin9
regtested -m32/-m64 on powerpc-apple-darwin8
(note, that to use this -m64 on darwin8, GCC must be built with dwarf-2 as the default debug format).


cheers,
Iain

Attachment: libgfortran-changed.diff.txt
Description: Text document


Attachment: libgfortran-regen.diff.txt
Description: Text document


Attachment: static-libgfortran-replace.diff.txt
Description: Text document




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