From: Johan Rydberg <jrydberg@night.trouble.net>
To: Marco Gerards <metgerards@student.han.nl>
Cc: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: multiboot
Date: Wed, 08 Dec 2004 16:32:33 +0100 [thread overview]
Message-ID: <873bygpzzi.fsf@night.trouble.net> (raw)
In-Reply-To: <878y887s7s.fsf@marco.marco-g.com> (Marco Gerards's message of "Wed, 08 Dec 2004 14:57:43 +0000")
Marco Gerards <metgerards@student.han.nl> writes:
> Johan Rydberg <jrydberg@night.trouble.net> writes:
>
>> The initial problem was that AC_CHECK_SIZEOF doesn't work if you're
>> cross-compiling. I fixed this by using AC_COMPILE_CHECK_SIZEOF [1]
>> instead.
>
> This sounds right to me, but I do not see this in the patch...
Of course not. I didn't include it :) I'm sure you can download the
m4 macro, install it in acinclude.m4 and change AC_CHECK_SIZEOF to
AC_COMPILE_CHECK_SIZEOF. If you're as lazy as I am, I can include it
in a later patch.
>> But the major problem is that parts of GRUB2 requires a C library to
>> be installed, at least headers such as alloca.h and stdint.h. Is this
>> really a valid demand?
>
> Is this required for grubof? IIRC those headers are not a part of the
> C library, but a part of gcc or libgcc or so. Am I right about that?
My GCC installation (3.2.2 configured for powerpc-elf) installed the
following headers:
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/syslimits.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/stdarg.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/stddef.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/varargs.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/stdbool.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/iso646.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/ppc-asm.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/altivec.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/limits.h
/gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/float.h
And my native installation of GCC (3.3.4 configured for i486-linux)
includes:
/usr/lib/gcc-lib/i486-linux/3.3.4/include/iso646.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/float.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/limits.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/stdarg.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/stdbool.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/stddef.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/syslimits.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/unwind.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/varargs.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/mmintrin.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/emmintrin.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/pmmintrin.h
/usr/lib/gcc-lib/i486-linux/3.3.4/include/xmmintrin.h
A little more research shows that both stdint.h and alloca.h is part
of glibc:
$ head -2 /usr/include/stdint.h
/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
$ head -2 /usr/include/alloca.h
/* Copyright (C) 1992, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
So either we stop using then, or write our own versions.
> Instead of alloca we can also use something like:
> [...]
> In most cases that will remove the dependency on alloca. IMHO it is
> better not to use alloca.
It is also possible to use __builtin_alloca if alloca.h is missing,
provided that there's a requirement for GCC.
>> That brings us the next issue; BUILD_CC is used to build _everything_,
>> including the host-specific object files, and since BUILD_CC is set to
>> /usr/bin/gcc in my cross-compiler environment it will try to compile
>> PPC assembler sources with a i386 compiler. Not good.
>>
>> My suggestion is to create a new class for programs that should be
>> host-specific, and let Utilities be compiled on the build machine.
>> See the patch.
>
> Ok, that sounds sane. But what if you really want to cross-compile a
> complete system (including libc, GRUB, etc)?
Good call. I'm not sure what to do. Got any ideas?
> Can you make one big patch with a changelog entry so it can be
> committed after Okuji agrees with the patch?
I would prefer Okuji looked at the changes to genmk.rb before that.
~j
next prev parent reply other threads:[~2004-12-08 15:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-07 11:09 multiboot Johan Rydberg
2004-12-07 14:51 ` multiboot Marco Gerards
2004-12-08 10:44 ` multiboot Johan Rydberg
2004-12-08 11:59 ` multiboot Marco Gerards
2004-12-08 12:27 ` multiboot Johan Rydberg
2004-12-08 12:23 ` multiboot Marco Gerards
2004-12-08 13:24 ` multiboot Johan Rydberg
2004-12-08 13:34 ` multiboot Johan Rydberg
2004-12-08 14:57 ` multiboot Marco Gerards
2004-12-08 15:32 ` Johan Rydberg [this message]
2004-12-08 19:10 ` multiboot Marco Gerards
2004-12-09 2:16 ` multiboot Yoshinori K. Okuji
2004-12-09 11:42 ` multiboot Johan Rydberg
2004-12-09 13:51 ` multiboot Marco Gerards
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=873bygpzzi.fsf@night.trouble.net \
--to=jrydberg@night.trouble.net \
--cc=grub-devel@gnu.org \
--cc=metgerards@student.han.nl \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.