mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Detect if x86 target is 32 or 64bit?
Date: Mon, 6 Feb 2012 21:08:37 +0100	[thread overview]
Message-ID: <20120206200837.GE32645@pengutronix.de> (raw)
In-Reply-To: <10381918.aAGBVVShah@ws-stein>

On Wed, Feb 01, 2012 at 01:49:22PM +0100, Alexander Stein wrote:
> On Tuesday 31 January 2012 15:12:08 Michael Olbrich wrote:
> > On Tue, Jan 31, 2012 at 09:21:30AM +0100, Alexander Stein wrote:
> > > On Wednesday 04 January 2012 17:59:57 Michael Olbrich wrote:
> > > > On Wed, Jan 04, 2012 at 03:27:46PM +0100, Alexander Stein wrote:
> > > > > how can I detect if a x86 target is 32 or 64bit? I'm working on a package 
> > > rule 
> > > > > for gnu-efi and elilo which need to know if it should generate ia32, 
> > > x86_64 
> > > > > (or ia64) binaries.
> > > > > I just know about PTXCONF_ARCH_X86 but this does not show what I want. 
> > > There 
> > > > > is also PTXCONF_KERNEL_ARCH_X86_64 for 64bit but this needs a linux kernel 
> > > > > configured. Any other ideas?
> > > > 
> > > > This is not yet supported. You'll need to add ARCH_X86_64 and ARCH_IA64 to
> > > > platforms/architecture.in and set the correct defaults for HAS_HARDFLOAT
> > > > etc.
> > > > Send patches :-)
> > > 
> > > I doubt it's the best way to just add ARCH_X86_64 (and maybe ARCH_IA64). A lot 
> > > of rules files use "ifdef PTXCONF_ARCH_X86". So this has to be reworked to be 
> > > useable in X86_64, as most cases don't make a difference to 32 or 64 Bit.
> > > Maybe it's better, to add a 64Bit entry in the optimization. Thoughts?
> > 
> > I have no idea which way will be easier to implement. But I don't think
> > adding to the optimization is the best. There will be places where you need
> > to separate 32 vs 64 bit (e.g. SIZEOF_LONG_DOUBLE).
> > So I guess you should start with a (ARCH_X86_32|ARCH_X86_64) choice and
> > check if any "ifdef PTXCONF_ARCH_X86" need to be changed.
> > If there are few/no uses of ARCH_X86 left then we can rename ARCH_X86_32 to
> > ARCH_X86.
> 
> Another problem prio to this is a 64bit toolchain in ptxdist. Up to now there is no OSELAStoolchain for x86_64.

Send patches :-)

> So I tried to use my host toolchain, but ptxdist cannot detect the sysroot in ptxd_init_sysroot_toolchain.
> At least my host toolchain has no --sysroot configure option set. I will assume an application is for 32bit, at the moment.

ptxdist only works with a real cross-toolchain. Otherwise You'll end up
with /usr/{include,lib} in the search paths and that won't work.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2012-02-06 20:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04 14:27 Alexander Stein
2012-01-04 16:59 ` Michael Olbrich
2012-01-31  8:21   ` Alexander Stein
2012-01-31 14:12     ` Michael Olbrich
2012-02-01 12:49       ` Alexander Stein
2012-02-06 20:08         ` Michael Olbrich [this message]
2012-02-15  6:47         ` Andreas Bießmann
2012-02-15  7:30           ` Alexander Stein
2012-02-15  9:08             ` Andreas Bießmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120206200837.GE32645@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox