public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Cross ld build problems
@ 2014-04-02 11:20 JonY
  2014-04-02 14:22 ` Nicholas Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: JonY @ 2014-04-02 11:20 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

Hi,

I am using a recent git master branch copy and I am running into
problems when crossing from 32bit Cygwin to 64bit mingw.

I can produce this problem using configure options:
--build=i686-pc-cygwin --host=i686-pc-cygwin
--target=x86_64-w64-mingw32. The problem only affects 32bit -> 64bit PE
targets I think, 64bit Cygwin ld seems smart enough to skip 32bit
objects when crossing to 32bit Windows.

In the Makefile, default-manifest.o is a prerequisite of
ld-new${EXEEXT}, when linking ld-new, the native 32bit linker picks up
on the local default-manifest.o, which is 64bit and groks about an
unrecognized file format.

I think the fix is to compile it as default-manifest-new.o but install
it as default-manifest.o, though I'm not too familiar with the Makefile
to do this.

For reference, I am building off revision
acd6540d35178e9fd1a98110798eeb8f878656e4.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross ld build problems
  2014-04-02 11:20 Cross ld build problems JonY
@ 2014-04-02 14:22 ` Nicholas Clifton
  2014-04-02 14:56   ` JonY
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Clifton @ 2014-04-02 14:22 UTC (permalink / raw)
  To: JonY, binutils

Hi Jon,

> I think the fix is to compile it as default-manifest-new.o but install
> it as default-manifest.o, though I'm not too familiar with the Makefile
> to do this.

The problem here is that if you are running a built but not installed 
linker then it will fail to find the default manifest.  Running an 
uninstalled linker is not uncommon either - I do it all the time when 
regression testing.

I am having second thoughts about using the linker as the agent to 
install the default manifest however.  IMHO it would be better if
gcc/libgcc did this - after all they already have the multilib mechanism
in place and they already build files like crt0.o and crtend.o.  Why
not add default-manifest.o to the list ?  The answer, as I understand
it, is that the Cygwin developers want the manifest added even if gcc
is not used to link the application.  So maybe it is time to impose a
requirement to use gcc to link all Cygwin and Mingw binaries ?

Cheers
   Nick



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross ld build problems
  2014-04-02 14:22 ` Nicholas Clifton
@ 2014-04-02 14:56   ` JonY
  2014-04-02 15:42     ` Nicholas Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: JonY @ 2014-04-02 14:56 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

On 4/2/2014 22:22, Nicholas Clifton wrote:
> Hi Jon,
> 
>> I think the fix is to compile it as default-manifest-new.o but install
>> it as default-manifest.o, though I'm not too familiar with the Makefile
>> to do this.
> 
> The problem here is that if you are running a built but not installed
> linker then it will fail to find the default manifest.  Running an
> uninstalled linker is not uncommon either - I do it all the time when
> regression testing.
> 

No, the error happens when gcc is linking ld-new.exe, consequently,
ld-new fails to link:

default-manifest.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

Removing default-manifest.o from the local directory and rerunning the
gcc command allows it to link again. I am not running the newly built
linker.

There is already a system default /usr/lib/default-manifest.o used by
the installed linker.





[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross ld build problems
  2014-04-02 14:56   ` JonY
@ 2014-04-02 15:42     ` Nicholas Clifton
  2014-04-02 22:10       ` JonY
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Clifton @ 2014-04-02 15:42 UTC (permalink / raw)
  To: JonY, binutils

Hi Jon,

>>> I think the fix is to compile it as default-manifest-new.o but install
>>> it as default-manifest.o, though I'm not too familiar with the Makefile
>>> to do this.
>>
>> The problem here is

> No, the error happens when gcc is linking ld-new.exe, consequently,
> ld-new fails to link:

Sorry - I mis-typed.  What I meant was "The problem with your proposed 
solution - of renaming the built manifest file - is ..."

Cheers
   Nick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross ld build problems
  2014-04-02 15:42     ` Nicholas Clifton
@ 2014-04-02 22:10       ` JonY
  0 siblings, 0 replies; 5+ messages in thread
From: JonY @ 2014-04-02 22:10 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

On 4/2/2014 23:41, Nicholas Clifton wrote:
> Hi Jon,
> 
>>>> I think the fix is to compile it as default-manifest-new.o but install
>>>> it as default-manifest.o, though I'm not too familiar with the Makefile
>>>> to do this.
>>>
>>> The problem here is
> 
>> No, the error happens when gcc is linking ld-new.exe, consequently,
>> ld-new fails to link:
> 
> Sorry - I mis-typed.  What I meant was "The problem with your proposed
> solution - of renaming the built manifest file - is ..."

True, I suppose the proper fix is to prevent the linker is somehow
picking up default-manifest.o from the current working directory if it
is already installed to the system libdir.




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-02 22:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02 11:20 Cross ld build problems JonY
2014-04-02 14:22 ` Nicholas Clifton
2014-04-02 14:56   ` JonY
2014-04-02 15:42     ` Nicholas Clifton
2014-04-02 22:10       ` JonY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).