From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LRrun-0004ml-BA for mharc-grub-devel@gnu.org; Tue, 27 Jan 2009 12:39:57 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRrul-0004ly-0Q for grub-devel@gnu.org; Tue, 27 Jan 2009 12:39:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRruj-0004lR-PK for grub-devel@gnu.org; Tue, 27 Jan 2009 12:39:54 -0500 Received: from [199.232.76.173] (port=51481 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRruj-0004lA-4R for grub-devel@gnu.org; Tue, 27 Jan 2009 12:39:53 -0500 Received: from mail-ew0-f20.google.com ([209.85.219.20]:50972) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRrui-0001bn-LG for grub-devel@gnu.org; Tue, 27 Jan 2009 12:39:52 -0500 Received: by ewy13 with SMTP id 13so2162211ewy.18 for ; Tue, 27 Jan 2009 09:39:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer; bh=vY08hPKYfdXYc9lJjifZzPfsifhiNuhvkgR0U0qttg4=; b=wFSKgx08BP7LXNzZVT12p3QgM38hva8aBM4WsYMOy4mLE5TlUZqnoTK3IqdtsxHQls URR0lXAAL8+5qW7dH88MRzmoAJNjux8a9pJIIScx9IzXkK4SdakuGj4te5b5URwgGuAY d6Nm/GG+u+Npq4fTTu4MJNZs7I3/9e8h8jlYM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer; b=KsDRLVdjqNtuYYbZvnMKi+13n/nvUfPBBLIPdrx2+o0s0E8sJmrGV7gb40QX8EGHXH QRZfPHHuEHVyp+LcI648x45cIyFZnRxY8i6stXO0/hIFGJoLSD2Ua2tJBeEXKAgKLdAW 0zq/BwVOwvI0XeXGLTQwE6qnaYw9m6IU3AOKg= Received: by 10.86.92.4 with SMTP id p4mr614589fgb.36.1233077990256; Tue, 27 Jan 2009 09:39:50 -0800 (PST) Received: from ?192.168.1.102? (213.37.137.93.dyn.user.ono.com [213.37.137.93]) by mx.google.com with ESMTPS id e11sm5553834fga.49.2009.01.27.09.39.48 (version=SSLv3 cipher=RC4-MD5); Tue, 27 Jan 2009 09:39:49 -0800 (PST) From: Javier =?ISO-8859-1?Q?Mart=EDn?= To: The development of GRUB 2 In-Reply-To: <497F42B0.3060201@t-online.de> References: <20090125231241.GA27873@thorin> <497E1596.7040802@t-online.de> <1233008230.24663.8.camel@localhost> <497F42B0.3060201@t-online.de> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-EX/umKfTdnQ9/U+aZg5Y" Date: Tue, 27 Jan 2009 18:40:09 +0100 Message-Id: <1233078009.2937.12.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] remove target_os X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2009 17:39:55 -0000 --=-EX/umKfTdnQ9/U+aZg5Y Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable El mar, 27-01-2009 a las 18:21 +0100, Christian Franke escribi=C3=B3: > Javier Mart=C3=ADn wrote: > >> Unfortunately, gcc has no '-fno_os' option to specify the bare CPU as=20 > >> target. > >> =20 > > > > Might -ffreestanding be what you are looking for? > > > > =20 >=20 > The option '-ffreestanding' is the same as '-fno-hosted'. >=20 > According to gcc (4.3.1) source, '-fno-hosted' clears variable=20 > 'flag_hosted' and sets '-fno-builtin'. The latter is already set within=20 > GRUB build. >=20 > A cleared 'flag_hosted' apparently has only 2 effects: > - disable the special handling of 'main()'. > - #define __STDC_HOSTED__ to 0 instead of 1 >=20 > There is no effect on the target_os dependent parts of the gcc code=20 > generation. For example, on i386, __enable_execute_stack() calls are=20 > generated for target_os netbsd, openbsd and cygwin, but not for linux.=20 > The emit call is hard-coded in=20 > gcc/configs/i386/i386.c:x86_initialize_trampoline(). In that case, we are dealing with a GCC bug. We might want to require the user to create a bare "no-OS" cross compiler. These thingies are most likely only known to OS developers, but you can build a perfectly good "i686-pc-elf" GCC (only with no libc, of course). This might be the Right Way (TM) of building boot code, instead of the current way of using the OS-targetter compiler and trying to tell it not to do what it was built to do. >=20 > Other workarounds are needed to support building GRUB with code=20 > generators tailored for various target_os. >=20 >=20 > >> > >>> AC_MSG_CHECKING([for command to convert module to ELF format]) > >>> -case "${host_os}:${target_os}" in > >>> - cygwin:cygwin) TARGET_OBJ2ELF=3D'grub-pe2elf' ;; > >>> +case "${host_os}" in > >>> + cygwin) TARGET_OBJ2ELF=3D'grub-pe2elf' ;; > >>> *) ;; > >>> esac > >>> =20 > >>> =20 > >> This won't work for a Linux cross compiler hosted on Cygwin. It would=20 > >> emit ELF format and does not need pe2elf. > >> =20 > > > > A, say, AMD64 Linux cross compiler hosted on x86 Cygwin would have > > $build=3Di686-pc-cygwin and $host=3Damd64-linux-gnu. Thus, no conflict = ought > > to arise even with cross compilation enabled. > > > > =20 >=20 > But the opposite won't work: $host=3Di686-pc-cygwin would enable=20 > grub-pe2elf, even if this gcc emits ELF for a linux target. "The opposite" of a the described situation would be a Linux AMD64 machine cross compiling for a Cygwin x86 machine, that is $build=3Damd64-linux-gnu and $host=3Di686-pc-cygwin. In that case, i686-pc-cygwin-gcc would generate PE executables, and thus grub-pe2elf _is_ required indeed. >=20 > Christian >=20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel --=-EX/umKfTdnQ9/U+aZg5Y Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAABAgAGBQJJf0b0AAoJEKSl+Fbdeo72eRgP/0xW8ReudJP3Sc8/05VaJh4c gyAXlm/OtCglFgOKgBocOD5WltTxAQJPsXXmcY1FqE4MYFlwkNfSS6H53t0BkSLI 7XV0rTNZtNa+P9WdR+ZuzDd998WAEU3d2bdtjC9vxA/lH0kP2CUFONsm5Dm0l/Qa GVnODpLF6dvzsAJ2AReJVS3t8+Voq4eBCwo8d4gBpoz7etF4mSJpXN7XorKZ65pW VLeyfJMdhCUROTytbdgT2PqRSojs7dYjIVvIcePnRlh/JvCjxqfCkQsYPYLJ1IM/ xpowKVKgxZU6N9p5B7fFnLGDWYg5cdbhrF6OKsh2ctfTxNV0kpXqcIV/mefU62o1 w2mZQ8tPeSni8IjReEH/+Q0JcHhMYIVbJMHUFE/mAcFxIY/gXuN6uW7syNn7Vdcv IDPzj6tmLSPSbEsZqGBPbHAW0YrpEU9D/SN2KRMbNbfZnZcBLis4MZDt1hk53gop qbVsWAKxv3OzCSW+0WG4Rd7zFVHEn7Fxe1D9lT7lVCJtcwrElR6ykmVAkwpduKKF oDpFqYWiXJgA1cw8BU/K9oXIyUnZB2UC/YWwQOmwJo+QgDCsxSWCP9TtmhvyUbjj WBnDtMFs4OZ5Ceep+RHSc3JnRUy0LV/lGKPN9hYtv0ZnJcordKG/no3o7Fv1o9pl U+DVLo7+QjkomTPV1MxB =NRFY -----END PGP SIGNATURE----- --=-EX/umKfTdnQ9/U+aZg5Y--