From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N0MPw-000760-As for mharc-grub-devel@gnu.org; Tue, 20 Oct 2009 17:38:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0MPu-00075n-Gg for grub-devel@gnu.org; Tue, 20 Oct 2009 17:38:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0MPp-00075I-Ri for grub-devel@gnu.org; Tue, 20 Oct 2009 17:38:53 -0400 Received: from [199.232.76.173] (port=47831 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0MPp-00075F-M2 for grub-devel@gnu.org; Tue, 20 Oct 2009 17:38:49 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:45481 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N0MPp-00017D-1G for grub-devel@gnu.org; Tue, 20 Oct 2009 17:38:49 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1N0MPi-0006WE-HW; Tue, 20 Oct 2009 23:38:42 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1N0MPh-0002U7-Ub; Tue, 20 Oct 2009 23:38:41 +0200 Date: Tue, 20 Oct 2009 23:38:41 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20091020213841.GA8854@thorin> References: <20091012.032838.82254107.davem@davemloft.net> <4AD70E53.80004@gmail.com> <1255646501.13480.32.camel@mj> <20091016.054440.193711272.davem@davemloft.net> <1255742496.2746.26.camel@mj> <20091017101110.GA11305@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: <20091017101110.GA11305@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: phcoder@gmail.com, bean123ch@gmail.com, David Miller Subject: [PATCH] auto-generate libgcc.h 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, 20 Oct 2009 21:38:54 -0000 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This should be a much cleaner option than maintaining libgcc.h by hand. Only tested on sparc, but it should also cast out the build problems on powerpc. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." --UugvWAfsgieZRqgk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="libgcc.diff" 2009-10-20 Robert Millan * genlibgcc_h.sh.in: New file. * conf/powerpc-ieee1275.rmk (MOSTLYCLEANFILES): Add `libgcc.h'. (libgcc.h): New rule. (kernel_syms.lst): Add `libgcc.h' to header list. * conf/sparc64-ieee1275.rmk: Likewise. * include/grub/sparc64/libgcc.h: Remove. Update all users. * include/grub/powerpc/libgcc.h: Likewise. * configure.ac: Stop checking for libgcc symbols. * include/grub/misc.h [!GRUB_UTIL] (memset, memcmp): New prototypes (provided by libc.so or kernel.img, NOT libgcc). Index: conf/powerpc-ieee1275.rmk =================================================================== --- conf/powerpc-ieee1275.rmk (revision 2641) +++ conf/powerpc-ieee1275.rmk (working copy) @@ -10,19 +10,22 @@ script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -MOSTLYCLEANFILES += symlist.c kernel_syms.lst +MOSTLYCLEANFILES += symlist.c kernel_syms.lst libgcc.h DEFSYMFILES += kernel_syms.lst kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \ - symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ + symbol.h term.h time.h types.h loader.h partition.h \ msdos_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ command.h +libgcc.h: genlibgcc_h.sh + /bin/sh $< > $@ || (rm -f $@; exit 1) + symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) libgcc.h config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Programs Index: conf/sparc64-ieee1275.rmk =================================================================== --- conf/sparc64-ieee1275.rmk (revision 2641) +++ conf/sparc64-ieee1275.rmk (working copy) @@ -23,14 +23,14 @@ diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,0x4200 diskboot_img_FORMAT = binary -MOSTLYCLEANFILES += symlist.c kernel_syms.lst +MOSTLYCLEANFILES += symlist.c kernel_syms.lst libgcc.h DEFSYMFILES += kernel_syms.lst kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ list.h handler.h command.h \ - sparc64/libgcc.h ieee1275/ieee1275.h machine/kernel.h \ + ieee1275/ieee1275.h machine/kernel.h \ sparc64/ieee1275/ieee1275.h kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ @@ -54,7 +54,10 @@ kernel_img_FORMAT = binary symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh +libgcc.h: genlibgcc_h.sh + /bin/sh $< > $@ || (rm -f $@; exit 1) + +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) libgcc.h config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. Index: configure.ac =================================================================== --- configure.ac (revision 2642) +++ configure.ac (working copy) @@ -411,9 +411,6 @@ AC_SUBST(TARGET_ASFLAGS) AC_SUBST(TARGET_CPPFLAGS) AC_SUBST(TARGET_LDFLAGS) -# Check for libgcc symbols (must be performed before we add -nostdlib to LDFLAGS) -AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) - # Set them to their new values for the tests below. CC="$TARGET_CC" if test "x$TARGET_APPLE_CC" = x1 ; then @@ -615,7 +612,7 @@ else rm -rf include/grub/machine cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null fi -AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh]) +AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh genlibgcc_h.sh]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_OUTPUT [ Index: include/grub/misc.h =================================================================== --- include/grub/misc.h (revision 2641) +++ include/grub/misc.h (working copy) @@ -78,6 +78,8 @@ grub_strncat (char *dest, const char *src, int c) #if !defined (GRUB_UTIL) || !defined (APPLE_CC) void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); +void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); +int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); #endif int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); Index: include/grub/sparc64/libgcc.h =================================================================== --- include/grub/sparc64/libgcc.h (revision 2641) +++ include/grub/sparc64/libgcc.h (working copy) @@ -1,31 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include - -void EXPORT_FUNC (memset) (void); - -#ifdef HAVE___BSWAPSI2 -typedef int SItype __attribute__ ((mode (SI))); -SItype EXPORT_FUNC (__bswapsi2) (SItype); -#endif - -#ifdef HAVE___BSWAPDI2 -typedef int DItype __attribute__ ((mode (DI))); -DItype EXPORT_FUNC (__bswapdi2) (DItype); -#endif Index: include/grub/powerpc/libgcc.h =================================================================== --- include/grub/powerpc/libgcc.h (revision 2641) +++ include/grub/powerpc/libgcc.h (working copy) @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -void EXPORT_FUNC (memset) (void); -void EXPORT_FUNC (__ashldi3) (void); -void EXPORT_FUNC (__ashrdi3) (void); -void EXPORT_FUNC (__lshrdi3) (void); -void EXPORT_FUNC (__trampoline_setup) (void); -void EXPORT_FUNC (__ucmpdi2) (void); Index: genlibgcc_h.sh.in =================================================================== --- genlibgcc_h.sh.in (revision 0) +++ genlibgcc_h.sh.in (revision 0) @@ -0,0 +1,31 @@ +#! /bin/sh +# +# Copyright (C) 2006,2009 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +### The configure script will replace these variables. + +: ${srcdir=@srcdir@} +: ${CC=@CC@} + + +cat <