linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Marcus Sundberg <erammsu@kieraypc01.p.y.ki.era.ericsson.se>
To: Graham Stoney <greyham@research.canon.com.au>
Cc: linuxppc-embedded@lists.linuxppc.org, scott@broadlink.com,
	linuxppc-dev@lists.linuxppc.org
Subject: Re: GLIBC wont compile for MPC860
Date: Fri, 03 Sep 1999 14:18:13 +0200	[thread overview]
Message-ID: <37CFBC84.73A8BCAA@switchboard.ericsson.se> (raw)
In-Reply-To: 19990903021534.8F50974A@elph.research.canon.com.au


Graham Stoney wrote:
> Thanks for your great tips on building glibc for the '860. It would be great if
> we could get some mods into the next glibc release so that it would configure
> out-of-the-box without patching...

Yes definitely. I intend to submit some patches as soon as I've had
time to try out glibc 2.1.2pre3 and verified that there are no
problems with that. Don't know if I will have time before they
release the final 2.1.2 though. :(

> Marcus Sundberg writes:
> > Configuring gcc with --with-cpu=860 and --nfp will make the
> > _compiler_ default to -msoft-float. It will however _not_ make the
> > pre-processor define -D_SOFT_FLOAT by default, which will cause
> > all variable arguments functions taking floating point arguments
> > (like the *print[fs] family) to be mis-compiled.
> >
> > The fix is to add this code to your gcc's 'specs' file under the
> > section '*cpp_sysv':
> > %{!mhard-float: -D_SOFT_FLOAT}
> 
> Is this a general fix though; won't it cause _SOFT_FLOAT to be defined by
> default for all other cpu types as well?

Yes, it will cause _SOFT_FLOAT to be defined unless you pass
-mhard-float to gcc, but see below.

> The specs file from gcc 2.95.1 includes '%{mcpu=403: -D_SOFT_FLOAT}' in the
> cpp_sysv rule, and adding '%{mcpu=860: -D_SOFT_FLOAT}' has the advantage of not
> affecting other cpu types. Problem is, it only kicks in when I pass -mcpu=860
> explicitly, even though I configured gcc --with-cpu=860. I'm confused...

I'm not really sure what goes on in gcc. I configured my gcc with
--with-cpu=860 and --nfp, and even if I pass -mcpu=750 -mhard-float
it doesn't generate floating point instructions... This is not a problem
for me as I don't have any non-860 CPU's to compile code for, but this
also means that I don't know what you should do to build a compiler that
generates 860 code by default and also is capable of generate code for
other CPUs.

> > First you must remove the assumption that cachelines are 32 bytes:
> > Apply this diff, and simply move sysdeps/powerpc/memset.S out of the
> > way for now:
> 
> Perhaps the gcc specs file could have a #define for the cache line size, so
> this is also automatically set via the -mcpu option. Alternatively, a #define
> giving the -mcpu= value would allow the code to work this out, kind of like the
> __i386, __i486, __i586 family for x86 architectures. There doesn't seem to be
> an equivalent for PowerPC's at present.

I like the former solution. Having the compiler keep track of what
line sizes different CPUs have is good, but forcing other user-land
code to know this isn't nice IMHO.

> > My vote is to have a special sysctl entry for the cacheline size,
> > for fast and easy access (one syscall compared to the open()/read()/close()
> > triplet for normal /proc entries, and you also don't have to have the
> > /proc fs mounted), and then cache the result in a static variable.)
> 
> I'd be happy with a compile-time option, but I don't mind either way.

Yep, I have no problem with having it a compile-time option either,
but some people want to run standard LinuxPPC libraries and binaries
on 8xx, so then a run-time check is needed as well.

> > Secondly you will want to remove the floating point assembler.
> 
> Cool! It would be nice to get the fpu code re-arranged in the official glibc
> too...

Speaking of FPU code, I just noticed that there is an FPU emulator
for PPC included in Linux version 2.3.16. We really don't need that 
here, but others might find that very interresting...

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan/
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: mackan@stacken.kth.se

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  parent reply	other threads:[~1999-09-03 12:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30  1:12 GLIBC wont compile for MPC860 Brendan Simon
1999-08-30 18:26 ` Scott Wood
1999-08-31  0:39   ` Graham Stoney
1999-09-01 20:27     ` Scott Wood
1999-09-01 21:47       ` David Edelsohn
1999-09-02 12:27       ` Marcus Sundberg
1999-09-03  2:15         ` Graham Stoney
1999-09-03  2:40           ` Michael Meissner
1999-09-03 12:18           ` Marcus Sundberg [this message]
1999-09-03 15:48             ` Dan Malek
1999-09-03 15:53               ` Grant Erickson
1999-09-06  1:15               ` Graham Stoney
1999-09-06  5:57                 ` Dan Malek

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=37CFBC84.73A8BCAA@switchboard.ericsson.se \
    --to=erammsu@kieraypc01.p.y.ki.era.ericsson.se \
    --cc=greyham@research.canon.com.au \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=scott@broadlink.com \
    /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;
as well as URLs for NNTP newsgroup(s).