Re: [RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread Yves Blusseau
Oh, I was wrong previously, gcc does respect __attribute__ ((__regparm__ (3))) flag (I forget to add -Os so it still uses stack to store value). And the bug is still there ! Try this test program: Compile with: gcc -m32 -mregparm=3 -Os test.c ./a.out 10 31 -6674368 gcc is 4.3.4 from debian.

Module autoloading?

2009-09-01 Thread Seth Goldberg
Hi, Has the idea come up of having a file that maps commands to module names along with the required code to autoload the corresponding module(s) when the corresponding commands are used (something like: :.mod [, .mod ...] i.e.: multiboot: multiboot.mod linux: linux.mod

Re: [RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread Bean
On Tue, Sep 1, 2009 at 11:43 PM, Bean wrote: > I make an assembly dump of the code generated by gcc-4.2. Apparently, > the "FIX" is achieved by ignoring the regparm attribute at all. > __attribute__ ((__regparm__ (3))) doesn't have any effect any more, it > always pass the parameters on the stack.

Re: [PATCH] Introduce xasprintf

2009-09-01 Thread Colin Watson
On Wed, Sep 02, 2009 at 02:49:39AM +0100, Colin Watson wrote: > I came across the idea of an xasprintf function in Gnulib a while back. > Using this both fixes the above class of warnings by always checking the > return value of asprintf, and also provides an IMO more intuitive > interface to forma

[PATCH] Introduce xasprintf

2009-09-01 Thread Colin Watson
Ubuntu builds with -D_FORTIFY_SOURCE=2 by default, and thus produces a bunch of warnings like this: util/grub-mkfont.c: In function ‘write_font’: util/grub-mkfont.c:366: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result I came across the idea of an xasp

Fix 'grub-probe -t fs' to do the comparison test it's meant to do

2009-09-01 Thread Colin Watson
I just committed this bug fix. It seemed obvious enough that it didn't need to be posted for review first. (If that was wrong, I'm sorry and I'll adjust my practices in future.) However, since it arranges to do a test that was clearly always meant to be performed but never was, it's theoretically p

Re: [RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread David Miller
From: Yves Blusseau Date: Tue, 1 Sep 2009 21:30:01 +0200 > > Le 1 sept. 09 à 17:43, Bean a écrit : > >> IMO, if we are to tackle the NESTED_FUNC_ATTR issue, we should do it >> properly by removing nested function, this also has other advantages, >> like allowing to run tools on systems like OSX

Re: Require at least gcc 4.2

2009-09-01 Thread David Miller
From: "Vladimir 'phcoder' Serbinenko" Date: Tue, 1 Sep 2009 19:02:39 +0200 > Even if it's not so I still think dropping support for old building > environments is a good thing since it decreases bug possibilities > and so maintainance work too. It also decreases your testing base. I think this

Re: Require at least gcc 4.2

2009-09-01 Thread David Miller
From: "Vladimir 'phcoder' Serbinenko" Date: Tue, 1 Sep 2009 16:12:20 +0200 > Even if gcc<4.2 seem to work ok I think we shouldn't waste resources > on it and officially declare a minimal requirement ("you're free to go > under requirement but don't post bugreports if you do") You're making it su

Re: [PATCH] Some distributions ship compilers that include -fPIE in the default specs (Gentoo Hardened)

2009-09-01 Thread richardvo...@gmail.com
Why not just check if the compiler accepts -fno-PIE and use it? No harm done if -fPIE wasn't default, right? On Tue, Sep 1, 2009 at 4:46 PM, Magnus Granberg wrote: > Hi > > On Gentoo Hardened we compile with -fPIE in the default specs and > grub fails to compile. > This patch check if the compile

[PATCH] Some distributions ship compilers that include -fPIE in the default specs (Gentoo Hardened)

2009-09-01 Thread Magnus Granberg
Hi On Gentoo Hardened we compile with -fPIE in the default specs and grub fails to compile. This patch check if the compiler use -fPIE in the default specs and add -fno-PIE to TARGET_CFLAGS. --- aclocal.m4.zorry2008-02-03 14:11:28.0 +0100 +++ aclocal.m4 2009-08-22 01:05:56.0

Re: [RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread Yves Blusseau
Le 1 sept. 09 à 17:43, Bean a écrit : On Tue, Sep 1, 2009 at 9:42 PM, Vladimir 'phcoder' Serbinenko wrote: Hello. NESTED_ATTR_FUNC was introduced 6 years ago to workaround a bug in compiler. Now it creates only problems. In particular if they are used wrong it creates a bug of argument passi

Re: [RFC] multiboot ammendment firmware info

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
On Tue, Sep 1, 2009 at 8:47 PM, Isaac Dupree wrote: > Vladimir 'phcoder' Serbinenko wrote: >>> >>> If flags[13] is set 2 fields are defined on addresses 104-107 resp >>> 108-116 >>> First field is firmware type >> >> 2 - BIOS. 16-bit mode BIOS interrupts are available. Second field is >> invalid >>

Re: [RFC] multiboot ammendment firmware info

2009-09-01 Thread Isaac Dupree
Vladimir 'phcoder' Serbinenko wrote: If flags[13] is set 2 fields are defined on addresses 104-107 resp 108-116 First field is firmware type 2 - BIOS. 16-bit mode BIOS interrupts are available. Second field is invalid 5 - 32-bit EFI. Second field contains pointer to EFI system table. What abou

Re: Require at least gcc 4.2

2009-09-01 Thread Seth Goldberg
Hi, Could you post a small test problem that illustrate the bug ? Yves Blusseau reported to me that modules compiled with gcc-4.0 based Apple's CC failed whereas the ones compiled with gcc-4.2 worked well. As MacOSX is the only OS I'm aware of which ships pre-4.2 gcc by default (the Unfort

Re: [RFC] multiboot ammendment firmware info

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
On Tue, Sep 1, 2009 at 5:45 PM, Vladimir 'phcoder' Serbinenko wrote: > Hello I propose to define following additional structures for multiboot: > If flags[11] is set the field in addresses 88-95 contains an address > of RSDT as defined in ACPI specification > If flags[12] is set the field in addres

Re: Require at least gcc 4.2

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
On Tue, Sep 1, 2009 at 4:19 PM, Bean wrote: > On Tue, Sep 1, 2009 at 10:12 PM, Vladimir 'phcoder' > Serbinenko wrote: >> On Tue, Sep 1, 2009 at 4:04 PM, Bean wrote: >>> On Tue, Sep 1, 2009 at 9:44 PM, Vladimir 'phcoder' >>> Serbinenko wrote: It looks like grub2's codebase triggers bugs in old

[PATCH] Filename default for grub-editenv

2009-09-01 Thread Colin Watson
(Per a discussion with Robert on IRC, this can be post-1.97 if you like.) Would it make sense for grub-editenv to have a default for the filename? I dislike hardcoding something in package maintainer scripts that needs to match a #define. The interface would be a little awkward since it's grub-edi

Re: Require at least gcc 4.2

2009-09-01 Thread Robert Millan
On Tue, Sep 01, 2009 at 03:44:18PM +0200, Vladimir 'phcoder' Serbinenko wrote: > > +AC_CACHE_CHECK([whether gcc is recent enough], grub_cv_cc_recent, [ > + CFLAGS= > + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ > +#if defined (__GNUC__) && (__GNUC__ < 4 || __GNUC_MINOR__ < 2) > +#error Use at least

Re: [RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread Bean
On Tue, Sep 1, 2009 at 11:43 PM, Bean wrote: > On Tue, Sep 1, 2009 at 9:42 PM, Vladimir 'phcoder' > Serbinenko wrote: >> Hello. NESTED_ATTR_FUNC was introduced 6 years ago to workaround a bug >> in compiler. Now it creates only problems. In particular if they are >> used wrong it creates a bug of a

Re: [RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread Robert Millan
On Tue, Sep 01, 2009 at 11:43:10PM +0800, Bean wrote: > On Tue, Sep 1, 2009 at 9:42 PM, Vladimir 'phcoder' > Serbinenko wrote: > > Hello. NESTED_ATTR_FUNC was introduced 6 years ago to workaround a bug > > in compiler. Now it creates only problems. In particular if they are > > used wrong it create

[RFC] multiboot ammendment firmware info

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
Hello I propose to define following additional structures for multiboot: If flags[11] is set the field in addresses 88-95 contains an address of RSDT as defined in ACPI specification If flags[12] is set the field in addresses 96-103 contains an address of SMBIOS anchor as defined in DMI specificati

Re: [RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread Bean
On Tue, Sep 1, 2009 at 9:42 PM, Vladimir 'phcoder' Serbinenko wrote: > Hello. NESTED_ATTR_FUNC was introduced 6 years ago to workaround a bug > in compiler. Now it creates only problems. In particular if they are > used wrong it creates a bug of argument passing. Such bugs are > difficult to find b

[RFC] Multiboot ammendment: non-VBE video

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
Hello. I'm implementing video part of multiboot specification. Currently the only defined interface is for providing VBE info. I propose following way to set fields if video is non VBE: vbe_control_info=0x When vbe_control_info is set to 0x all VBE-specific fields are invalid vbe_mo

Re: Require at least gcc 4.2

2009-09-01 Thread Bean
On Tue, Sep 1, 2009 at 10:12 PM, Vladimir 'phcoder' Serbinenko wrote: > On Tue, Sep 1, 2009 at 4:04 PM, Bean wrote: >> On Tue, Sep 1, 2009 at 9:44 PM, Vladimir 'phcoder' >> Serbinenko wrote: >>> It looks like grub2's codebase triggers bugs in old compiler. I don't >>> feel like we should support th

Re: Require at least gcc 4.2

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
On Tue, Sep 1, 2009 at 4:04 PM, Bean wrote: > On Tue, Sep 1, 2009 at 9:44 PM, Vladimir 'phcoder' > Serbinenko wrote: >> It looks like grub2's codebase triggers bugs in old compiler. I don't >> feel like we should support these compilers at all. Hence this patch. >> If someone wants to use older com

Re: Require at least gcc 4.2

2009-09-01 Thread Bean
On Tue, Sep 1, 2009 at 9:44 PM, Vladimir 'phcoder' Serbinenko wrote: > It looks like grub2's codebase triggers bugs in old compiler. I don't > feel like we should support these compilers at all. Hence this patch. > If someone wants to use older compiler he's free to patch this check > out but this

Require at least gcc 4.2

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
It looks like grub2's codebase triggers bugs in old compiler. I don't feel like we should support these compilers at all. Hence this patch. If someone wants to use older compiler he's free to patch this check out but this way he's aware that we don't support gcc prior to 4.2 -- Regards Vladimir '

[RFC] Eliminate NESTED_ATTR_FUNC

2009-09-01 Thread Vladimir 'phcoder' Serbinenko
Hello. NESTED_ATTR_FUNC was introduced 6 years ago to workaround a bug in compiler. Now it creates only problems. In particular if they are used wrong it creates a bug of argument passing. Such bugs are difficult to find because it usually results in strange behaviour and in grub-emu NESTED_FUNC_AT

Re: Report: compil error on OSX for target=i386

2009-09-01 Thread Robert Millan
On Mon, Aug 31, 2009 at 11:10:17PM +0200, Yves Blusseau wrote: >>> What about following compromise: >>> diff --git a/loader/i386/linux.c b/loader/i386/linux.c >>> index 4144384..1380eb8 100644 >>> --- a/loader/i386/linux.c >>> +++ b/loader/i386/linux.c >>> @@ -543,7 +543,8 @@ grub_linux_boot (void)

Re: [PATCH] reset USB controller

2009-09-01 Thread Robert Millan
On Mon, Aug 31, 2009 at 04:36:51PM +0300, Mikko Rantalainen wrote: > >> Is there some way we can make this simpler without compromising on boot > >> speed? Adding more setup burden to the user should be the last ressort > >> IMO. > >> > > [...] > > Another usage is if OS doesn't deal with situatio