public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Darwin multilibs
@ 2003-05-25  9:26 Dara Hazeghi
  2003-05-25 15:24 ` Geoff Keating
  0 siblings, 1 reply; 12+ messages in thread
From: Dara Hazeghi @ 2003-05-25  9:26 UTC (permalink / raw)
  To: gcc

Hello,

is there any reason we're still building soft-float libs on Darwin 
still? Stan Shebs mentioned in a message back in November 
(http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html) that multilibs 
weren't strictly necessary on Darwin. Would a patch disabling them then 
be welcome? Thanks,

Dara

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

* Re: Darwin multilibs
  2003-05-25  9:26 Darwin multilibs Dara Hazeghi
@ 2003-05-25 15:24 ` Geoff Keating
  2003-05-25 17:57   ` Dara Hazeghi
  2003-05-26 17:13   ` Stan Shebs
  0 siblings, 2 replies; 12+ messages in thread
From: Geoff Keating @ 2003-05-25 15:24 UTC (permalink / raw)
  To: Dara Hazeghi; +Cc: gcc

Dara Hazeghi <dhazeghi@yahoo.com> writes:

> Hello,
> 
> is there any reason we're still building soft-float libs on Darwin
> still? Stan Shebs mentioned in a message back in November
> (http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html) that multilibs
> weren't strictly necessary on Darwin. Would a patch disabling them
> then be welcome? Thanks,

I believe that soft-float is used for the kernel and drivers.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* Re: Darwin multilibs
  2003-05-25 15:24 ` Geoff Keating
@ 2003-05-25 17:57   ` Dara Hazeghi
  2003-05-25 18:39     ` H. J. Lu
  2003-05-26 20:23     ` Geoff Keating
  2003-05-26 17:13   ` Stan Shebs
  1 sibling, 2 replies; 12+ messages in thread
From: Dara Hazeghi @ 2003-05-25 17:57 UTC (permalink / raw)
  To: Geoff Keating; +Cc: gcc


--- Geoff Keating <geoffk@geoffk.org> wrote:
> Dara Hazeghi <dhazeghi@yahoo.com> writes:
> 
> > Hello,
> > 
> > is there any reason we're still building
> soft-float libs on Darwin
> > still? Stan Shebs mentioned in a message back in
> November
> > (http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html)
> that multilibs
> > weren't strictly necessary on Darwin. Would a
> patch disabling them
> > then be welcome? Thanks,
> 
> I believe that soft-float is used for the kernel and
> drivers.

Fair enough. But what about for other libraries than
libgcc2.a. With a checkout of mainline as of last
night, the following are other multilibbed:
libfrtbegin.a
libg2c.a
libiberty.a
libstdc++.a
libsupc++.a

Do these also need to be built as soft-float for the
benefit of the kernel? Thanks,

Dara

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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

* Re: Darwin multilibs
  2003-05-25 17:57   ` Dara Hazeghi
@ 2003-05-25 18:39     ` H. J. Lu
  2003-05-26 20:23     ` Geoff Keating
  1 sibling, 0 replies; 12+ messages in thread
From: H. J. Lu @ 2003-05-25 18:39 UTC (permalink / raw)
  To: Dara Hazeghi; +Cc: Geoff Keating, gcc

On Sun, May 25, 2003 at 10:02:50AM -0700, Dara Hazeghi wrote:
> 
> --- Geoff Keating <geoffk@geoffk.org> wrote:
> > Dara Hazeghi <dhazeghi@yahoo.com> writes:
> > 
> > > Hello,
> > > 
> > > is there any reason we're still building
> > soft-float libs on Darwin
> > > still? Stan Shebs mentioned in a message back in
> > November
> > > (http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html)
> > that multilibs
> > > weren't strictly necessary on Darwin. Would a
> > patch disabling them
> > > then be welcome? Thanks,
> > 
> > I believe that soft-float is used for the kernel and
> > drivers.
> 
> Fair enough. But what about for other libraries than
> libgcc2.a. With a checkout of mainline as of last
> night, the following are other multilibbed:
> libfrtbegin.a
> libg2c.a
> libiberty.a
> libstdc++.a
> libsupc++.a
> 
> Do these also need to be built as soft-float for the
> benefit of the kernel? Thanks,

Here is my old patch for Linux/ppc. You may borrow it for Darwin.


H.J.
---
2002-09-17  H.J. Lu <hjl@gnu.org>

	* config.gcc: Updated.

2001-12-27  H.J. Lu <hjl@gnu.org>

	* config.gcc (powerpc-*-linux-gnualtivec*): Always set
	enable_multilib to yes.
	(powerpc-*-linux*): Likewise.

--- gcc/config.gcc.ppc	Tue Sep 17 09:59:39 2002
+++ gcc/config.gcc	Tue Sep 17 10:02:14 2002
@@ -2072,11 +2072,17 @@ powerpc-*-linux-gnualtivec*)
 	tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h"
 	out_file=rs6000/rs6000.c
 	tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+	# We always enable mutilib for kernel compile as well as
+	# compiling crtbeginS.o and crtendS.o with -fPIC
+	enable_multilib=yes
 	;;
 powerpc-*-linux*)
 	tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
 	out_file=rs6000/rs6000.c
 	tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+	# We always enable mutilib for kernel compile as well as
+	# compiling crtbeginS.o and crtendS.o with -fPIC
+	enable_multilib=yes
 	;;
 powerpc-*-gnu-gnualtivec*)
 	tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h"

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

* Re: Darwin multilibs
  2003-05-25 15:24 ` Geoff Keating
  2003-05-25 17:57   ` Dara Hazeghi
@ 2003-05-26 17:13   ` Stan Shebs
  2003-05-26 22:33     ` Michael Meissner
  1 sibling, 1 reply; 12+ messages in thread
From: Stan Shebs @ 2003-05-26 17:13 UTC (permalink / raw)
  To: Geoff Keating; +Cc: Dara Hazeghi, gcc

Geoff Keating wrote:

>Dara Hazeghi <dhazeghi@yahoo.com> writes:
>
>
>>Hello,
>>
>>is there any reason we're still building soft-float libs on Darwin
>>still? Stan Shebs mentioned in a message back in November
>>(http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html) that multilibs
>>weren't strictly necessary on Darwin. Would a patch disabling them
>>then be welcome? Thanks,
>>
>
>I believe that soft-float is used for the kernel and drivers.
>
>
The reason I was doubtful about the right thing to do is that kernel
and kexts aren't supposed to be using floating point at all, and
-msoft-float is just used to prevent float reg refs from getting in
by accident.  What I think kernel folks would most like is a libgcc
where adddf3 etc is not defined at all, so that mistaken references
show up as a link error, but that's a pretty unusual variant of
multilib.

Stan


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

* Re: Darwin multilibs
  2003-05-25 17:57   ` Dara Hazeghi
  2003-05-25 18:39     ` H. J. Lu
@ 2003-05-26 20:23     ` Geoff Keating
  2003-05-27  1:57       ` Dara Hazeghi
  1 sibling, 1 reply; 12+ messages in thread
From: Geoff Keating @ 2003-05-26 20:23 UTC (permalink / raw)
  To: dhazeghi; +Cc: gcc

> X-Original-To: geoffk@foam.wonderslug.com
> Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm
> List-Unsubscribe: <mailto:gcc-unsubscribe-james=westongold.com@gcc.gnu.org>
> List-Archive: <http://gcc.gnu.org/ml/gcc/>
> List-Post: <mailto:gcc@gcc.gnu.org>
> List-Help: <http://gcc.gnu.org/ml/>
> Date: Sun, 25 May 2003 10:02:50 -0700 (PDT)
> From: Dara Hazeghi <dhazeghi@yahoo.com>
> Cc: gcc@gcc.gnu.org
> X-OriginalArrivalTime: 26 May 2003 17:55:42.0218 (UTC) FILETIME=[0639E6A0:01C323B0]
> 
> 
> --- Geoff Keating <geoffk@geoffk.org> wrote:
> > Dara Hazeghi <dhazeghi@yahoo.com> writes:
> > 
> > > Hello,
> > > 
> > > is there any reason we're still building
> > soft-float libs on Darwin
> > > still? Stan Shebs mentioned in a message back in
> > November
> > > (http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html)
> > that multilibs
> > > weren't strictly necessary on Darwin. Would a
> > patch disabling them
> > > then be welcome? Thanks,
> > 
> > I believe that soft-float is used for the kernel and
> > drivers.
> 
> Fair enough. But what about for other libraries than
> libgcc2.a. With a checkout of mainline as of last
> night, the following are other multilibbed:
> libfrtbegin.a
> libg2c.a
> libiberty.a
> libstdc++.a
> libsupc++.a
> 
> Do these also need to be built as soft-float for the
> benefit of the kernel? Thanks,

I belive so, at least in general.  Drivers in darwin can use C++.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* Re: Darwin multilibs
  2003-05-26 17:13   ` Stan Shebs
@ 2003-05-26 22:33     ` Michael Meissner
  2003-05-27  5:40       ` Stan Shebs
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Meissner @ 2003-05-26 22:33 UTC (permalink / raw)
  To: gcc

On Mon, May 26, 2003 at 09:39:05AM -0400, Stan Shebs wrote:
> Geoff Keating wrote:
> 
> >Dara Hazeghi <dhazeghi@yahoo.com> writes:
> >
> >
> >>Hello,
> >>
> >>is there any reason we're still building soft-float libs on Darwin
> >>still? Stan Shebs mentioned in a message back in November
> >>(http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html) that multilibs
> >>weren't strictly necessary on Darwin. Would a patch disabling them
> >>then be welcome? Thanks,
> >>
> >
> >I believe that soft-float is used for the kernel and drivers.
> >
> >
> The reason I was doubtful about the right thing to do is that kernel
> and kexts aren't supposed to be using floating point at all, and
> -msoft-float is just used to prevent float reg refs from getting in
> by accident.  What I think kernel folks would most like is a libgcc
> where adddf3 etc is not defined at all, so that mistaken references
> show up as a link error, but that's a pretty unusual variant of
> multilib.

Note, at least when I was PowerPC maintainer several years ago, the register
allocator would often times use floating point registers for memory to memory
copies (particularly for block move operations), since it avoids extra spills.
Some Linux crashes were attributed to these optimizations in the kernel in code
run during interrupt handling (when the GPRs were saved, but not the FPRs), and
Linux started building with -msoft-float to prevent this.  I would imagine
Darwin has similar issues.

So, it is not to just prevent errant programmers from using floating point, but
also to suppress an optimization that is not valid in the kernel context.

-- 
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org

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

* Re: Darwin multilibs
  2003-05-26 20:23     ` Geoff Keating
@ 2003-05-27  1:57       ` Dara Hazeghi
  2003-05-27 16:36         ` Jason Thorpe
  0 siblings, 1 reply; 12+ messages in thread
From: Dara Hazeghi @ 2003-05-27  1:57 UTC (permalink / raw)
  To: Geoff Keating; +Cc: gcc


> than
> > libgcc2.a. With a checkout of mainline as of last
> > night, the following are other multilibbed:
> > libfrtbegin.a
> > libg2c.a
> > libiberty.a
> > libstdc++.a
> > libsupc++.a
> > 
> > Do these also need to be built as soft-float for
> the
> > benefit of the kernel? Thanks,
> 
> I belive so, at least in general.  Drivers in darwin
> can use C++.
> 

Okay. Thanks for the explanation. Seems a bit silly
consider it's been about 6 years since Apple shipped
the last Mac without an FPU, but I guess that's the
way of things!

Dara

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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

* Re: Darwin multilibs
  2003-05-26 22:33     ` Michael Meissner
@ 2003-05-27  5:40       ` Stan Shebs
  0 siblings, 0 replies; 12+ messages in thread
From: Stan Shebs @ 2003-05-27  5:40 UTC (permalink / raw)
  To: Michael Meissner; +Cc: gcc

Michael Meissner wrote:

>On Mon, May 26, 2003 at 09:39:05AM -0400, Stan Shebs wrote:
>
>>Geoff Keating wrote:
>>
>>
>>>Dara Hazeghi <dhazeghi@yahoo.com> writes:
>>>
>>>
>>>
>>>>Hello,
>>>>
>>>>is there any reason we're still building soft-float libs on Darwin
>>>>still? Stan Shebs mentioned in a message back in November
>>>>(http://gcc.gnu.org/ml/gcc/2002-04/msg01549.html) that multilibs
>>>>weren't strictly necessary on Darwin. Would a patch disabling them
>>>>then be welcome? Thanks,
>>>>
>>>>
>>>I believe that soft-float is used for the kernel and drivers.
>>>
>>>
>>>
>>The reason I was doubtful about the right thing to do is that kernel
>>and kexts aren't supposed to be using floating point at all, and
>>-msoft-float is just used to prevent float reg refs from getting in
>>by accident.  What I think kernel folks would most like is a libgcc
>>where adddf3 etc is not defined at all, so that mistaken references
>>show up as a link error, but that's a pretty unusual variant of
>>multilib.
>>
>
>Note, at least when I was PowerPC maintainer several years ago, the register
>allocator would often times use floating point registers for memory to memory
>copies (particularly for block move operations), since it avoids extra spills.
>Some Linux crashes were attributed to these optimizations in the kernel in code
>run during interrupt handling (when the GPRs were saved, but not the FPRs), and
>Linux started building with -msoft-float to prevent this.  I would imagine
>Darwin has similar issues.
>
>So, it is not to just prevent errant programmers from using floating point, but
>also to suppress an optimization that is not valid in the kernel context.
>
Yes, that is also the real reason for using -msoft-float on Darwin.
The explanation from a kernel developer is usually accompanied with
mild histrionics about how expensive it would be to save and restore
fprs on context switches. :-)

Stan


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

* Re: Darwin multilibs
  2003-05-27  1:57       ` Dara Hazeghi
@ 2003-05-27 16:36         ` Jason Thorpe
  2003-05-27 21:33           ` Dara Hazeghi
  0 siblings, 1 reply; 12+ messages in thread
From: Jason Thorpe @ 2003-05-27 16:36 UTC (permalink / raw)
  To: Dara Hazeghi; +Cc: Geoff Keating, gcc


On Monday, May 26, 2003, at 05:05  PM, Dara Hazeghi wrote:

> Okay. Thanks for the explanation. Seems a bit silly
> consider it's been about 6 years since Apple shipped
> the last Mac without an FPU, but I guess that's the
> way of things!

It's not silly at all... if you had to save FP context at every 
interrupt, the kernel would be a lot slower.

         -- Jason R. Thorpe <thorpej@wasabisystems.com>

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

* Re: Darwin multilibs
  2003-05-27 16:36         ` Jason Thorpe
@ 2003-05-27 21:33           ` Dara Hazeghi
  2003-05-27 22:43             ` Michael Meissner
  0 siblings, 1 reply; 12+ messages in thread
From: Dara Hazeghi @ 2003-05-27 21:33 UTC (permalink / raw)
  To: Jason Thorpe; +Cc: gcc

> It's not silly at all... if you had to save FP
> context at every 
> interrupt, the kernel would be a lot slower.

Thanks for the point. You're the second one to point
out this fact to me! I guess it just seems strange to
me because I'm used to x86/Linux, which has no
multilibs (that I'm aware of)...

Dara

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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

* Re: Darwin multilibs
  2003-05-27 21:33           ` Dara Hazeghi
@ 2003-05-27 22:43             ` Michael Meissner
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Meissner @ 2003-05-27 22:43 UTC (permalink / raw)
  To: Dara Hazeghi; +Cc: Jason Thorpe, gcc

On Tue, May 27, 2003 at 01:09:30PM -0700, Dara Hazeghi wrote:
> > It's not silly at all... if you had to save FP
> > context at every 
> > interrupt, the kernel would be a lot slower.
> 
> Thanks for the point. You're the second one to point
> out this fact to me! I guess it just seems strange to
> me because I'm used to x86/Linux, which has no
> multilibs (that I'm aware of)...

Due to the 'crippled' nature of the x86 floating point stack, and the fact that
the xmm registers are only in the newer chips and aren't enabled unless you
specifically say to use them, you aren't likely to run into the condition where
you would need to use the -msoft-float option.  If it was likely that the
register allocator would allocate a floating point register, then the kernel
would presumably need to use a switch that disables the floating point
registers just like it does on the Alpha, SH, SPARC, PARISC Linux kernels.  In
the early days (on 386sx processors), it might have been advantageous to use
-msoft-float if glibc had ever been multilib'ed.

-- 
Michael Meissner
email: meissner@the-meissners.org
http://www.the-meissners.org

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

end of thread, other threads:[~2003-05-27 21:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-25  9:26 Darwin multilibs Dara Hazeghi
2003-05-25 15:24 ` Geoff Keating
2003-05-25 17:57   ` Dara Hazeghi
2003-05-25 18:39     ` H. J. Lu
2003-05-26 20:23     ` Geoff Keating
2003-05-27  1:57       ` Dara Hazeghi
2003-05-27 16:36         ` Jason Thorpe
2003-05-27 21:33           ` Dara Hazeghi
2003-05-27 22:43             ` Michael Meissner
2003-05-26 17:13   ` Stan Shebs
2003-05-26 22:33     ` Michael Meissner
2003-05-27  5:40       ` Stan Shebs

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