Hi all,
Another change I had to make for HPUX that I'm not 100% sure about:
The HPUX linker gets quite unhappy unless the gcc link line inside of winegcc is fed -fPIC. The problem is that the collect2 phase builds it's own temporary object file that gets included in the final link, and if that temp .o file isn't compiled with -fPIC, the HP linker complains. In order to get this to work, I had to add -fPIC to the list of link flags that winegcc recognizes:
diff -ur patched/wine-20040914/tools/winegcc/winegcc.c wine-20040914/tools/winegcc/winegcc.c --- patched/wine-20040914/tools/winegcc/winegcc.c 2004-10-12 10:28:37.000000000 -0400 +++ wine-20040914/tools/winegcc/winegcc.c 2004-10-12 10:10:07.000000000 -0400 @@ -616,7 +616,7 @@ { "-nostartfiles", "-nodefaultlibs", "-nostdlib", "-s", "-static", "-static-libgcc", "-shared", "-shared-libgcc", "-symbolic", - "-framework" + "-framework", "-fPIC" }; int j;
The question: is this going to be harmful on other platforms? I'm not sure whether I should protect it with ifdefs, or just leave it as is.
Any suggestions?
Thanks,
Warren
On Tue, Oct 12, 2004 at 10:42:37AM -0400, Warren_Baird/CSI@cimmetry.com wrote:
The question: is this going to be harmful on other platforms? I'm not sure whether I should protect it with ifdefs, or just leave it as is.
I think it should be fine: the gcc driver should be able to filter it out if it's not relevant.
"Dimitrie O. Paun" dpaun@rogers.com writes:
On Tue, Oct 12, 2004 at 10:42:37AM -0400, Warren_Baird/CSI@cimmetry.com wrote:
The question: is this going to be harmful on other platforms? I'm not sure whether I should protect it with ifdefs, or just leave it as is.
I think it should be fine: the gcc driver should be able to filter it out if it's not relevant.
Actually it could be argued that winegcc should add -fPIC itself if it's needed for linking, users shouldn't have to worry about that.
On Thu, Oct 14, 2004 at 09:03:53PM -0700, Alexandre Julliard wrote:
Actually it could be argued that winegcc should add -fPIC itself if it's needed for linking, users shouldn't have to worry about that.
Absolutely, the user shouldn't need to provide anything. It would be silly to have some internal winegcc computation/compilation fail because the user did not provide some flags.
In fact, I also had in mind the same thing, but I forgot the patch did not do that. As I was saying, I think we can just always provide it during link, gcc should be able to deal with it on all platforms.
Alexandre Julliard julliard@winehq.org wrote on 10/15/2004 12:03:53 AM:
Actually it could be argued that winegcc should add -fPIC itself if it's needed for linking, users shouldn't have to worry about that.
That makes a lot of sense - I'll mod the patch to do that... Should I make it platform specific, or (as Dimitrie suggests) just always add it?
Warren
Warren_Baird/CSI@cimmetry.com writes:
That makes a lot of sense - I'll mod the patch to do that... Should I make it platform specific, or (as Dimitrie suggests) just always add it?
It's probably better to do that at the configure level by adding it to LDDLLFLAGS in the case that needs it.
Alexandre Julliard julliard@winehq.org wrote on 10/18/2004 03:11:30 PM:
It's probably better to do that at the configure level by adding it to LDDLLFLAGS in the case that needs it.
Ok, that makes sense - I didn't realize we already had a hook directly from configure into winegcc.
I'll just submit an autoconf patch...
Thanks,
Warren