mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Detect if x86 target is 32 or 64bit?
@ 2012-01-04 14:27 Alexander Stein
  2012-01-04 16:59 ` Michael Olbrich
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Stein @ 2012-01-04 14:27 UTC (permalink / raw)
  To: ptxdist

Hello,

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?

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
August-Bebel-Str. 29
D-07973 Greiz

Tel: +49-3661-6279-0, Fax: +49-3661-6279-99
eMail:    Alexander.Stein@systec-electronic.com
Internet: http://www.systec-electronic.com

Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Jena, HRB 205563

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-01-04 14:27 [ptxdist] Detect if x86 target is 32 or 64bit? Alexander Stein
@ 2012-01-04 16:59 ` Michael Olbrich
  2012-01-31  8:21   ` Alexander Stein
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2012-01-04 16:59 UTC (permalink / raw)
  To: ptxdist

Hi,

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

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

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-01-04 16:59 ` Michael Olbrich
@ 2012-01-31  8:21   ` Alexander Stein
  2012-01-31 14:12     ` Michael Olbrich
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Stein @ 2012-01-31  8:21 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

On Wednesday 04 January 2012 17:59:57 Michael Olbrich wrote:
> Hi,
> 
> 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?

Regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
August-Bebel-Str. 29
D-07973 Greiz

Tel: +49-3661-6279-0, Fax: +49-3661-6279-99
eMail:    Alexander.Stein@systec-electronic.com
Internet: http://www.systec-electronic.com

Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Jena, HRB 205563

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-01-31  8:21   ` Alexander Stein
@ 2012-01-31 14:12     ` Michael Olbrich
  2012-02-01 12:49       ` Alexander Stein
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2012-01-31 14:12 UTC (permalink / raw)
  To: ptxdist

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.

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

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-01-31 14:12     ` Michael Olbrich
@ 2012-02-01 12:49       ` Alexander Stein
  2012-02-06 20:08         ` Michael Olbrich
  2012-02-15  6:47         ` Andreas Bießmann
  0 siblings, 2 replies; 9+ messages in thread
From: Alexander Stein @ 2012-02-01 12:49 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

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

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
August-Bebel-Str. 29
D-07973 Greiz

Tel: +49-3661-6279-0, Fax: +49-3661-6279-99
eMail:    Alexander.Stein@systec-electronic.com
Internet: http://www.systec-electronic.com

Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Jena, HRB 205563

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-02-01 12:49       ` Alexander Stein
@ 2012-02-06 20:08         ` Michael Olbrich
  2012-02-15  6:47         ` Andreas Bießmann
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Olbrich @ 2012-02-06 20:08 UTC (permalink / raw)
  To: ptxdist

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

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-02-01 12:49       ` Alexander Stein
  2012-02-06 20:08         ` Michael Olbrich
@ 2012-02-15  6:47         ` Andreas Bießmann
  2012-02-15  7:30           ` Alexander Stein
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Bießmann @ 2012-02-15  6:47 UTC (permalink / raw)
  To: ptxdist

Dear Alexander Stein,

On 01.02.12 13:49, 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.

is there any conclusion to this discussion?
I startet to build a x86_64 rootfs (on top of i586-qemu-bsp) and failed
to build sylinux due to some wrong decisions in syslinux.make (another
discussion ..).
I started defining ARCH_X86_64 as optimization of ARCH_X86. Alexander,
are you building x86_64 stuff too ore did you only ask cause of the
ability to build gnu-efi for ia32, x86_32 and ia64?

> Another problem prio to this is a 64bit toolchain in ptxdist. Up to now there is no OSELAStoolchain for x86_64.

Can you please test my OSELAS.Toolchain x86_64 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.

best regards

Andreas Bießmann

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-02-15  6:47         ` Andreas Bießmann
@ 2012-02-15  7:30           ` Alexander Stein
  2012-02-15  9:08             ` Andreas Bießmann
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Stein @ 2012-02-15  7:30 UTC (permalink / raw)
  To: Andreas Bießmann; +Cc: ptxdist

Hello Andreas,

Am Mittwoch, 15. Februar 2012, 07:47:04 schrieb Andreas Bießmann:
> is there any conclusion to this discussion?
> I startet to build a x86_64 rootfs (on top of i586-qemu-bsp) and failed
> to build sylinux due to some wrong decisions in syslinux.make (another
> discussion ..).
> I started defining ARCH_X86_64 as optimization of ARCH_X86. Alexander,
> are you building x86_64 stuff too ore did you only ask cause of the
> ability to build gnu-efi for ia32, x86_32 and ia64?

I didn't work on this topic again. But yes, I asked only for gnu-efi stuff. Until now we are only building 32bit.

> > Another problem prio to this is a 64bit toolchain in ptxdist. Up to now there is no OSELAStoolchain for x86_64.
> 
> Can you please test my OSELAS.Toolchain x86_64 patches?

IIRC from other mails, do you need a x86_64 host to use a x86_64 toolchain? Well, I'm running a x86_64 host, so this wouldn't be a problem.

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
August-Bebel-Str. 29
D-07973 Greiz

Tel: +49-3661-6279-0, Fax: +49-3661-6279-99
eMail:    Alexander.Stein@systec-electronic.com
Internet: http://www.systec-electronic.com

Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Jena, HRB 205563

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Detect if x86 target is 32 or 64bit?
  2012-02-15  7:30           ` Alexander Stein
@ 2012-02-15  9:08             ` Andreas Bießmann
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Bießmann @ 2012-02-15  9:08 UTC (permalink / raw)
  To: ptxdist; +Cc: Andreas Bießmann, Klaus.Hachmeister

Hi Alexander,

On 15.02.2012 08:30, Alexander Stein wrote:
> Hello Andreas,
> 
> Am Mittwoch, 15. Februar 2012, 07:47:04 schrieb Andreas Bießmann:
>> is there any conclusion to this discussion?
>> I startet to build a x86_64 rootfs (on top of i586-qemu-bsp) and failed
>> to build sylinux due to some wrong decisions in syslinux.make (another
>> discussion ..).
>> I started defining ARCH_X86_64 as optimization of ARCH_X86. Alexander,
>> are you building x86_64 stuff too ore did you only ask cause of the
>> ability to build gnu-efi for ia32, x86_32 and ia64?
> 
> I didn't work on this topic again. But yes, I asked only for gnu-efi stuff. Until now we are only building 32bit.

Ok.

>>> Another problem prio to this is a 64bit toolchain in ptxdist. Up to now there is no OSELAStoolchain for x86_64.
>>
>> Can you please test my OSELAS.Toolchain x86_64 patches?
> 
> IIRC from other mails, do you need a x86_64 host to use a x86_64 toolchain? Well, I'm running a x86_64 host, so this wouldn't be a problem.

No, that is a misunderstanding here.

You can build the x86_64-unknown-linux-gnu OSELAS.Toolchain on any host
you want (even Mac OS X as I did).
If you have a host that has the same GNU triplet as the target (and that
may be the fact for some users with x86 build host and x86 target
toolchain but not only he x86_64 toolchain) the autotools mechanism will
end up in deciding for native build which means e.g. gcc without
prefixed arch triplet. Therefore one of my patches adds explicit
'--build=' switch to cross-tools configure to fool the autotools
guessing mechanism by providing a non-guessable arch triplet (e.g.
x86_64-host-linux-gnu -> see GNU_HOST in <ptxdist>/rules/pre/Rules.make).
This let the autoconf logic think it has a x86_64-host-linux-gnu build
system building a x86_64-unknown-linux-gnu target toolchain running on a
x86_64-unknown-linux-gnu host system which would be 'cross compiling'.
The resulting tools have the arch triplet prefixed and everything should
be fine.

I hope this is clear now. Feel free to test the OSELAS.Toolchain
patches, would be great to get some feedback.

best regards

Andreas Bießmann

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2012-02-15  9:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-04 14:27 [ptxdist] Detect if x86 target is 32 or 64bit? 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
2012-02-15  6:47         ` Andreas Bießmann
2012-02-15  7:30           ` Alexander Stein
2012-02-15  9:08             ` Andreas Bießmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox