public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Building a cross binutils for Solaris/x86 target
@ 2007-03-16 16:18 Alex Bennee
  2007-03-16 17:24 ` Ian Lance Taylor
  2007-03-19 15:52 ` Michael Wetherell
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Bennee @ 2007-03-16 16:18 UTC (permalink / raw)
  To: binutils

Hi,

One of the toolchains we use at work is a Solaris/x86 target hosted on
Linux/x86. One of my colleagues hacked up binutils 2.16.1 to enable it
to link a Solaris binary.

I'm in the process of porting them 2.17 and would very much like to
submit the patches upstream if I can do them neatly. However my autoconf
magic is a little rusty.

In the BFD the linker is specified in elf64-x86-64.c as "/lib/ld64.so.1"
when on Solaris is needs to be in "/lib/amd64/ld.so.1". Are there any
config variables passed to the C code that I can use to #ifdef this?

I had a brief scan through config.h but couldn't see anything helpful.

Regards,

-- 
Alex, homepage: http://www.bennee.com/~alex/
Mustgo, n.: Any item of food that has been sitting in the refrigerator
so long it has become a science project. -- Sniglets, "Rich Hall &
Friends"

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

* Re: Building a cross binutils for Solaris/x86 target
  2007-03-16 16:18 Building a cross binutils for Solaris/x86 target Alex Bennee
@ 2007-03-16 17:24 ` Ian Lance Taylor
  2007-03-19 12:02   ` Alex Bennee
  2007-03-19 15:52 ` Michael Wetherell
  1 sibling, 1 reply; 7+ messages in thread
From: Ian Lance Taylor @ 2007-03-16 17:24 UTC (permalink / raw)
  To: Alex Bennee; +Cc: binutils

Alex Bennee <kernel-hacker@bennee.com> writes:

> One of the toolchains we use at work is a Solaris/x86 target hosted on
> Linux/x86. One of my colleagues hacked up binutils 2.16.1 to enable it
> to link a Solaris binary.
> 
> I'm in the process of porting them 2.17 and would very much like to
> submit the patches upstream if I can do them neatly. However my autoconf
> magic is a little rusty.
> 
> In the BFD the linker is specified in elf64-x86-64.c as "/lib/ld64.so.1"
> when on Solaris is needs to be in "/lib/amd64/ld.so.1". Are there any
> config variables passed to the C code that I can use to #ifdef this?
> 
> I had a brief scan through config.h but couldn't see anything helpful.

This isn't properly expressed as an autoconf test.  Autoconf tests can
only test for host features.  You are talking about a target feature.
The way to implement this would be to clone the x86_64 target and just
change the interpreter string.  Then make your new target the default
in config.bfd.

Alternatively, GNU/Linux has the same issue.  The way it is handled
there is to arrange for gcc to always pass the appropriate
-dynamic-linker option when it invokes the linker.  That is the way to
go if you always use gcc.

Ian

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

* Re: Building a cross binutils for Solaris/x86 target
  2007-03-16 17:24 ` Ian Lance Taylor
@ 2007-03-19 12:02   ` Alex Bennee
  2007-03-19 12:30     ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Bennee @ 2007-03-19 12:02 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

On Fri, 2007-03-16 at 10:24 -0700, Ian Lance Taylor wrote:
> Alex Bennee <kernel-hacker@bennee.com> writes:
> 
> > One of the toolchains we use at work is a Solaris/x86 target hosted on
> > Linux/x86.
> <snip>
> > In the BFD the linker is specified in elf64-x86-64.c as "/lib/ld64.so.1"
> > when on Solaris is needs to be in "/lib/amd64/ld.so.1". Are there any
> > config variables passed to the C code that I can use to #ifdef this?
<snip>
> This isn't properly expressed as an autoconf test.  Autoconf tests can
> only test for host features.  You are talking about a target feature.
> The way to implement this would be to clone the x86_64 target and just
> change the interpreter string.  Then make your new target the default
> in config.bfd.

You mean create something like elf64-solaris-x86-64.c as a clone of the
original elf64-x86-64.c?

It does seem a little like a sledgehammer approach. Scanning through the
directory it looks like BFD is trying to keep the processor dependant
stuff purely that, dependant on the processor.

However if a patch creating a new variant and associated files is
acceptable to the binutils maintainers I'm happy to do that.

> Alternatively, GNU/Linux has the same issue.  The way it is handled
> there is to arrange for gcc to always pass the appropriate
> -dynamic-linker option when it invokes the linker.  That is the way to
> go if you always use gcc.

I shall investigate if I can build the OpenSolaris linker on a Linux
host. Otherwise I may have to go for remotely using a target machine to
link the final result.

-- 
Alex, homepage: http://www.bennee.com/~alex/
When a fellow says, "It ain't the money but the principle of the thing,"
it's the money. -- Kim Hubbard

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

* Re: Building a cross binutils for Solaris/x86 target
  2007-03-19 12:02   ` Alex Bennee
@ 2007-03-19 12:30     ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2007-03-19 12:30 UTC (permalink / raw)
  To: Alex Bennee; +Cc: Ian Lance Taylor, binutils

On Mon, Mar 19, 2007 at 12:01:46PM +0000, Alex Bennee wrote:
> You mean create something like elf64-solaris-x86-64.c as a clone of the
> original elf64-x86-64.c?

No.  Take a look at the "FreeBSD support" comment at the bottom of
elf64-x86-64.c.

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: Building a cross binutils for Solaris/x86 target
  2007-03-16 16:18 Building a cross binutils for Solaris/x86 target Alex Bennee
  2007-03-16 17:24 ` Ian Lance Taylor
@ 2007-03-19 15:52 ` Michael Wetherell
  2007-03-19 18:21   ` Alex Bennee
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Wetherell @ 2007-03-19 15:52 UTC (permalink / raw)
  To: binutils

On Friday 16 Mar 2007 16:18, Alex Bennee wrote:
> One of the toolchains we use at work is a Solaris/x86 target hosted
> on Linux/x86. One of my colleagues hacked up binutils 2.16.1 to
> enable it to link a Solaris binary.
>
> I'm in the process of porting them 2.17 and would very much like to
> submit the patches upstream if I can do them neatly. However my
> autoconf magic is a little rusty.
>
> In the BFD the linker is specified in elf64-x86-64.c as
> "/lib/ld64.so.1" when on Solaris is needs to be in
> "/lib/amd64/ld.so.1". Are there any config variables passed to the C
> code that I can use to #ifdef this?
>
> I had a brief scan through config.h but couldn't see anything
> helpful.

Hi,

It should be working already, did you try a recent version?

Regards,
Mike

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

* Re: Building a cross binutils for Solaris/x86 target
  2007-03-19 15:52 ` Michael Wetherell
@ 2007-03-19 18:21   ` Alex Bennee
  2007-03-19 18:36     ` Michael Wetherell
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Bennee @ 2007-03-19 18:21 UTC (permalink / raw)
  To: Michael Wetherell; +Cc: binutils

On Mon, 2007-03-19 at 15:51 +0000, Michael Wetherell wrote:
> On Friday 16 Mar 2007 16:18, Alex Bennee wrote:
> > One of the toolchains we use at work is a Solaris/x86 target hosted
> > on Linux/x86. One of my colleagues hacked up binutils 2.16.1 to
> > enable it to link a Solaris binary.
> <snip>
> Hi,
> 
> It should be working already, did you try a recent version?

Erm, latest release 2.17. Is this something in CVS?

> 
> Regards,
> Mike
-- 
Alex, homepage: http://www.bennee.com/~alex/
Everything is controlled by a small evil group to which, unfortunately,
no one we know belongs.

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

* Re: Building a cross binutils for Solaris/x86 target
  2007-03-19 18:21   ` Alex Bennee
@ 2007-03-19 18:36     ` Michael Wetherell
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Wetherell @ 2007-03-19 18:36 UTC (permalink / raw)
  To: binutils

On Monday 19 Mar 2007 18:21, Alex Bennee wrote:
> > It should be working already, did you try a recent version?
>
> Erm, latest release 2.17. Is this something in CVS?

Yes try the CVS or a snapshot like binutils-070315.tar.bz2 from 
ftp://sourceware.org/pub/binutils/snapshots.

Regards,
Mike

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

end of thread, other threads:[~2007-03-19 18:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-16 16:18 Building a cross binutils for Solaris/x86 target Alex Bennee
2007-03-16 17:24 ` Ian Lance Taylor
2007-03-19 12:02   ` Alex Bennee
2007-03-19 12:30     ` Daniel Jacobowitz
2007-03-19 15:52 ` Michael Wetherell
2007-03-19 18:21   ` Alex Bennee
2007-03-19 18:36     ` Michael Wetherell

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).