Ken Moffat wrote:
On Wed, 23 Feb 2005, Mike Liford wrote:

  
In Chapter 6, I installed the Sparc64 Linux-2.4 headers in /usr/include.
I tried to compile Glibc and got architecture errors. I tried passing
CFLAGS="-mcpu=v9" to the compiler. However, the linking command does not
appear to pick up the flag settings.

    

Hi Mike,

 As I said before, I know nothing about sparc, but are these the right
headers ?  If you're going to build a 64-bit kernel then that would need
different definitions of things from the 32-bit userspace, so _maybe_
you need two sets of headers (one for when you build a 64-bit toolchain,
another for the regular 32-bit userspace).  I'm sort of thinking you've
got to do some bi-arch stuff.  Take a look at Ryan's Cross-Lfs scripts
(http://www.linuxfromscratch.org/~ryan/scripts/cross-lfs) - use the
latest version of hte scripts.
  
Kernel headers are copied to /tools/include/asm (Chapter 5) or /usr/include/asm (Chapter 6). There are no instructions for maintaining two sets of headers. I tried the Sparc64 headers for the sparc64-unknown-linux-gnu host. When that failed, I replaced the headers with the Sparc headers for the sparc-unknown-linux-gnu host. I'm assuming this is correct.
  
Here is the end result of attempting to compile with CFLAGS and CXXFLAGS
unset, using the Sparc64 kernel headers, and running configure as shown
in Chapter 6 for Glibc. The configure script is choosing the host and
build system as "sparc64-unknown-linux-gnu".

    

Looking at gentoo stuff (e.g. glibc-2.3.2-r12.ebuild - google for it,
use wherever is nearest to you if it returns more than one) I get the
impression that the 32-bit build needs --host=sparcv9-unknown-linux-gnu
which ought to pass -mcpu=ultrasparc -Wa -Av9a to gcc.
  
Didn't know sparcv9-unknown-linux-gnu was an option. The GCC manual doesn't show it. I'll try it anyway.
Hopefully, finding this ebuild script will drop you into a gentoo
portage tree. glibc is in sys-libs/, binutils and gcc are in sys-devel/,
and I can see that 64-bit compilers for the kernel (egcs64-sparc,
gcc-sparc64) are separated.  It looks as if they have some experience
with sparc, so I suggest seeing what you can learn from the flags they
are using.

HTH.

Ken

  
I have Gentoo on my home PC. I've "emerged" plenty of ebuilds, but I've never looked at one. Guess I might take a look now.

Thanks for the reply,
Mike

-- 
Mike Liford, Senior Software Engineer
Lockheed Martin Information Technology
E-mail: [EMAIL PROTECTED]
Tel: (937) 429-0044 ext 113
Fax: (937) 429-1182
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to