Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MCVS4-0007UW-7N for mharc-grub-devel@gnu.org; Fri, 05 Jun 2009 05:11:04 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MCVS1-0007T5-LD for grub-devel@gnu.org; Fri, 05 Jun 2009 05:11:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MCVRx-0007Px-2A for grub-devel@gnu.org; Fri, 05 Jun 2009 05:11:00 -0400 Received: from [199.232.76.173] (port=35322 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MCVRw-0007PR-Hp for grub-devel@gnu.org; Fri, 05 Jun 2009 05:10:56 -0400 Received: from smarthost02.mail.zen.net.uk ([212.23.3.141]:56297) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MCVRv-0005zk-64 for grub-devel@gnu.org; Fri, 05 Jun 2009 05:10:55 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MCVRt-0002Av-8t; Fri, 05 Jun 2009 09:10:53 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) id 1MCVRs-000138-00; Fri, 05 Jun 2009 10:10:52 +0100 Date: Fri, 5 Jun 2009 10:10:52 +0100 From: Colin Watson To: The development of GRUB 2 Message-ID: <20090605091052.GN7367@riva.ucam.org> References: <200906032352.51827.dron@osrc.info> <200906050007.20241.dron@osrc.info> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost02-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Robert Millan Subject: Re: multiboot take partial mmap 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: Fri, 05 Jun 2009 09:11:02 -0000 On Fri, Jun 05, 2009 at 03:24:09AM +0200, Vladimir 'phcoder' Serbinenko wrote: > On Thu, Jun 4, 2009 at 10:07 PM, Andrey Valyaev wrote: > > PS: latest svn revision (from 2243) failed with message: > > > > gcc -Icommands -I./commands -I. -I./include -I./include -Wall -W  -Wall -W - > > Wshadow -Wpointer-arith -Wmissing-prototypes                  -Wundef - > > Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1 > > -m32 -fno-stack-protector -mno-stack-arg-probe -fno-builtin -mrtd -mregparm=3 > > -m32 -Werror -Wall -MD -c -o search_mod-commands_search.o commands/search.c > > cc1: warnings being treated as errors > > commands/search.c: In function 'search_fs': > > commands/search.c:42: error: generating trampoline in object (requires > > executable stack) > > commands/search.c: In function 'grub_cmd_search': > > commands/search.c:105: error: generating trampoline in object (requires > > executable stack) > > make[1]: *** [search_mod-commands_search.o] Error 1 > > > > $ gcc --version > > gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3 > > > This is because of commit 2243 by Robert Millan. The commit was about > floppy probing but also added -Wall -Werror to search.mod > I myself stepped on this mine once with adding -Wall -Werror to my xnu module. > I'll revert this change (only -Werror, not the rest of commit) as it > causes build error for all gentoo users. Sorry, Robert, but we can't > enable -Werror and still have nested functions. I don't think we > should use -Werror at all because different compilers, versions or > modifications of same compiler cause different warnings and imho > maintaintaining cost is too high and breaks are too frequent. Or > perhaps we can enable -Werror only on some compilers? Or perhaps > anyone has a better idea You could use -Wno-trampolines (IIRC that's the spelling) on Gentoo's patched GCC; it's generally good to minimise unwanted warnings even if they aren't errors. Here's the macro I use in man-db to add GCC warning options: # man-gcc-warning.m4 serial 1 dnl MAN_GCC_WARNING(WARNING) dnl Add -WWARNING to CFLAGS if it is supported by the compiler. AC_DEFUN([MAN_GCC_WARNING], [man_saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -W$1" AC_CACHE_CHECK([that GCC supports -W$1], [AS_TR_SH([man_cv_gcc_warning_$1])], [AS_TR_SH([man_cv_gcc_warning_$1])=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AS_TR_SH([man_cv_gcc_warning_$1])=yes])]) if test "$AS_TR_SH([man_cv_gcc_warning_$1])" = no; then CFLAGS="$man_saved_CFLAGS" fi]) # MAN_GCC_WARNING I then use this in configure.ac: if test "$GCC" = yes then MAN_GCC_WARNING([]) # -W MAN_GCC_WARNING([pointer-arith]) MAN_GCC_WARNING([write-strings]) MAN_GCC_WARNING([strict-prototypes]) MAN_GCC_WARNING([shadow]) MAN_GCC_WARNING([format-security]) MAN_GCC_WARNING([no-missing-field-initializers]) fi Feel free to use and adjust to taste if you want. -- Colin Watson [cjwatson@ubuntu.com]