On Sun, Feb 12, 2012 at 02:02:29AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > On 12.02.2012 01:02, Lennart Sorensen wrote: > > On Sat, Feb 11, 2012 at 12:38:41AM +0100, Vladimir 'φ-coder/phcoder' > > Serbinenko wrote: > >> === modified file 'configure.ac' > >> --- configure.ac 2012-02-10 15:48:48 +0000 > >> +++ configure.ac 2012-02-10 23:28:12 +0000 > >> @@ -373,9 +373,9 @@ > >> LIBS="" > >> > >> # debug flags. > >> -WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration > >> -Wold-style-definition -Wpointer-arith -Wmissing-prototypes -Wundef > >> -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined > >> -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch > >> -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization > >> -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal > >> -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k > >> -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration > >> -Wimplicit-int -Winit-self -Winline -Wint-to-pointer-cast -Winvalid-pch > >> -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces > >> -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn > >> -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat > >> -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type > >> -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector > >> -Wstrict-aliasing -Wstrict-overflow -Wswitch -Wsync-nand -Wtrigraphs > >> -Wtype-limits -Wundef > -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused > -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result > -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var > -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type > -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign" > >> +WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration > >> -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress > >> -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align > >> -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated > >> -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero > >> -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul > >> -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers > >> -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self > >> -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations > >> -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers > >> -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar > >> -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses > >> -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point > >> -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch > >> -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized > >> -Wunknown-pragmas -Wunreachable > -code -Wunused -Wunused-function -Wunused-label -Wunused-parameter > -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros > -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations > -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs > -Wstrict-prototypes -Wpointer-sign" > >> HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS" > >> -TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls" > >> +TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls > >> -Wmissing-prototypes" > >> TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g" > >> > >> # Force no alignment to save space on i386. > >> > >> === modified file 'docs/grub.texi' > >> --- docs/grub.texi 2012-01-31 21:59:32 +0000 > >> +++ docs/grub.texi 2012-02-10 17:11:59 +0000 > >> @@ -20,7 +20,7 @@ > >> This manual is for GNU GRUB (version @value{VERSION}, > >> @value{UPDATED}). > >> > >> -Copyright @copyright{} 1999,2000,2001,2002,2004,2006,2008,2009,2010 Free > >> Software Foundation, Inc. > >> +Copyright @copyright{} > >> 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012 Free Software > >> Foundation, Inc. > >> > >> @quotation > >> Permission is granted to copy, distribute and/or modify this document > >> > >> === modified file 'gentpl.py' > >> --- gentpl.py 2011-12-24 14:09:26 +0000 > >> +++ gentpl.py 2012-02-10 17:10:18 +0000 > >> @@ -1,4 +1,19 @@ > >> #! /usr/bin/python > >> +# GRUB -- GRand Unified Bootloader > >> +# Copyright (C) 2010,2011 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 <http://www.gnu.org/licenses/>. > >> > >> # > >> # This is the python script used to generate Makefile.tpl > >> > >> === modified file 'grub-core/disk/diskfilter.c' > >> --- grub-core/disk/diskfilter.c 2012-02-09 22:43:43 +0000 > >> +++ grub-core/disk/diskfilter.c 2012-02-10 19:54:58 +0000 > >> @@ -260,6 +260,24 @@ > >> return list; > >> } > >> > >> +void > >> +grub_diskfilter_print_partmap (grub_disk_t disk) > >> +{ > >> + struct grub_diskfilter_lv *lv = disk->data; > >> + struct grub_diskfilter_pv *pv; > >> + > >> + if (lv->vg->pvs) > >> + for (pv = lv->vg->pvs; pv; pv = pv->next) > >> + { > >> + grub_size_t s; > >> + if (!pv->disk) > >> + grub_util_error (_("Couldn't find physical volume `%s'." > >> + " Check your device.map"), pv->name); > >> + for (s = 0; pv->partmaps[s]; s++) > >> + grub_printf ("%s ", pv->partmaps[s]); > >> + } > >> +} > >> + > >> static const char * > >> grub_diskfilter_getname (struct grub_disk *disk) > >> { > >> @@ -964,6 +982,19 @@ > >> pv->part_start = grub_partition_get_start (disk->partition); > >> pv->part_size = grub_disk_get_size (disk); > >> > >> +#ifdef GRUB_UTIL > >> + { > >> + grub_size_t s = 1; > >> + grub_partition_t p; > >> + for (p = disk->partition; p; p = p->parent) > >> + s++; > >> + pv->partmaps = xmalloc (s * sizeof (pv->partmaps[0])); > >> + s = 0; > >> + for (p = disk->partition; p; p = p->parent) > >> + pv->partmaps[s++] = xstrdup (p->partmap->name); > >> + pv->partmaps[s++] = 0; > >> + } > >> +#endif > >> if (start_sector != (grub_uint64_t)-1) > >> pv->start_sector = start_sector; > >> pv->start_sector += pv->part_start; > >> > >> === modified file 'grub-core/kern/emu/full.c' > >> --- grub-core/kern/emu/full.c 2012-02-09 22:15:27 +0000 > >> +++ grub-core/kern/emu/full.c 2012-02-10 20:37:43 +0000 > >> @@ -50,7 +50,7 @@ > >> grub_no_autoload = 1; > >> } > >> > >> -#ifdef __ia64__ > >> +#if defined (__ia64__) || defined (__powerpc__) > >> void grub_arch_dl_get_tramp_got_size (const void *ehdr __attribute__ > >> ((unused)), > >> grub_size_t *tramp, grub_size_t *got) > >> { > >> > >> === modified file 'grub-core/script/execute.c' > >> --- grub-core/script/execute.c 2012-02-04 11:21:21 +0000 > >> +++ grub-core/script/execute.c 2012-02-10 22:24:15 +0000 > >> @@ -26,6 +26,7 @@ > >> #include <grub/lib/arg.h> > >> #include <grub/normal.h> > >> #include <grub/extcmd.h> > >> +#include <grub/i18n.h> > >> > >> /* Max digits for a char is 3 (0xFF is 255), similarly for an int it > >> is sizeof (int) * 3, and one extra for a possible -ve sign. */ > >> @@ -312,8 +313,8 @@ > >> struct grub_script_arg *arg = 0; > >> struct grub_script_argv result = { 0, 0, 0 }; > >> > >> - auto int append (char *s, int escape_type); > >> - int append (char *s, int escape_type) > >> + auto int append (const char *s, int escape_type); > >> + int append (const char *s, int escape_type) > >> { > >> int r; > >> char *p = 0; > >> @@ -379,12 +380,20 @@ > >> break; > >> > >> case GRUB_SCRIPT_ARG_TYPE_TEXT: > >> - if (grub_strlen (arg->str) && > >> + if (arg->str[0] && > >> grub_script_argv_append (&result, arg->str, > >> grub_strlen (arg->str))) > >> goto fail; > >> break; > >> > >> + case GRUB_SCRIPT_ARG_TYPE_GETTEXT: > >> + { > >> + const char *t = _(arg->str); > >> + if (grub_script_argv_append (&result, t, grub_strlen (t))) > >> + goto fail; > >> + } > >> + break; > >> + > >> case GRUB_SCRIPT_ARG_TYPE_DQSTR: > >> case GRUB_SCRIPT_ARG_TYPE_SQSTR: > >> if (append (arg->str, 1)) > >> > >> === modified file 'grub-core/script/yylex.l' > >> --- grub-core/script/yylex.l 2012-02-03 10:56:49 +0000 > >> +++ grub-core/script/yylex.l 2012-02-10 22:20:27 +0000 > >> @@ -131,15 +131,17 @@ > >> SQCHR [^\'] > >> DQCHR {ESC}|[^\\\"] > >> DQSTR \"{DQCHR}*\" > >> +I18NSTR \$\"{DQCHR}*\" > >> SQSTR \'{SQCHR}*\' > >> SPECIAL \?|\#|\*|\@ > >> VARIABLE > >> ${NAME}|$\{{NAME}\}|${DIGITS}|$\{{DIGITS}\}|${SPECIAL}|$\{{SPECIAL}\} > >> -WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+ > >> +WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE}|{I18NSTR})+ > >> > >> MULTILINE {WORD}?((\"{DQCHR}*)|(\'{SQCHR}*)|(\\\n)) > >> > >> %x SPLIT > >> %x DQUOTE > >> +%x I18NQUOTE > >> %x SQUOTE > >> %x VAR > >> > >> @@ -215,6 +217,10 @@ > >> yy_push_state (SQUOTE, yyscanner); > >> ARG (GRUB_SCRIPT_ARG_TYPE_TEXT); > >> } > >> + "\$\"" { > >> + yy_push_state (I18NQUOTE, yyscanner); > >> + ARG (GRUB_SCRIPT_ARG_TYPE_GETTEXT); > >> + } > >> \$ { > >> yy_push_state (VAR, yyscanner); > >> ARG (GRUB_SCRIPT_ARG_TYPE_TEXT); > >> @@ -280,6 +286,18 @@ > >> (.|\n) { COPY (yytext, yyleng); } > >> } > >> > >> +<I18NQUOTE>{ > >> + \\\\ { COPY ("\\", 1); } > >> + \\\" { COPY ("\"", 1); } > >> + \\\n { /* ignore */ } > >> + [^\"\\\n]+ { COPY (yytext, yyleng); } > >> + \" { > >> + yy_pop_state (yyscanner); > >> + ARG (GRUB_SCRIPT_ARG_TYPE_GETTEXT); > >> + } > >> + (.|\n) { COPY (yytext, yyleng); } > >> +} > >> + > >> <<EOF>> { > >> yypop_buffer_state (yyscanner); > >> yyextra->lexerstate->eof = 1; > >> > >> === modified file 'include/grub/diskfilter.h' > >> --- include/grub/diskfilter.h 2012-01-29 13:28:01 +0000 > >> +++ include/grub/diskfilter.h 2012-02-10 19:53:29 +0000 > >> @@ -72,6 +72,9 @@ > >> struct grub_diskfilter_pv *next; > >> /* Optional. */ > >> grub_uint8_t *internal_id; > >> +#ifdef GRUB_UTIL > >> + char **partmaps; > >> +#endif > >> }; > >> > >> struct grub_diskfilter_lv { > >> @@ -186,6 +189,8 @@ > >> struct grub_diskfilter_pv * > >> grub_diskfilter_get_pv_from_disk (grub_disk_t disk, > >> struct grub_diskfilter_vg **vg); > >> +void > >> +grub_diskfilter_print_partmap (grub_disk_t disk); > >> #endif > >> > >> #endif /* ! GRUB_RAID_H */ > >> > >> === modified file 'include/grub/script_sh.h' > >> --- include/grub/script_sh.h 2011-11-11 19:34:37 +0000 > >> +++ include/grub/script_sh.h 2012-02-10 20:30:33 +0000 > >> @@ -53,6 +53,7 @@ > >> { > >> GRUB_SCRIPT_ARG_TYPE_VAR, > >> GRUB_SCRIPT_ARG_TYPE_TEXT, > >> + GRUB_SCRIPT_ARG_TYPE_GETTEXT, > >> GRUB_SCRIPT_ARG_TYPE_DQVAR, > >> GRUB_SCRIPT_ARG_TYPE_DQSTR, > >> GRUB_SCRIPT_ARG_TYPE_SQSTR, > >> > >> === modified file 'util/getroot.c' > >> --- util/getroot.c 2012-02-10 12:17:12 +0000 > >> +++ util/getroot.c 2012-02-10 18:48:24 +0000 > >> @@ -372,7 +372,7 @@ > >> char *buf = NULL; > >> size_t len = 0; > >> char **ret = NULL; > >> - int entry_len = 0, entry_max = 4; > >> + grub_size_t entry_len = 0, entry_max = 4; > >> struct mountinfo_entry *entries; > >> struct mountinfo_entry parent_entry = { 0, 0, 0, "", "", "", "" }; > >> int i; > >> @@ -1991,7 +1991,7 @@ > >> const grub_partition_t partition) > >> { > >> grub_disk_addr_t part_start = 0; > >> - grub_util_info ("Partition %d starts from %lu", > >> + grub_util_info ("Partition %d starts from %" PRIuGRUB_UINT64_T, > >> partition->number, partition->start); > >> > >> part_start = grub_partition_get_start (partition); > >> @@ -2022,7 +2022,7 @@ > >> return 0; > >> } > >> > >> - grub_util_info ("%s starts from %lu", os_dev, start); > >> + grub_util_info ("%s starts from %" PRIuGRUB_UINT64_T, os_dev, start); > >> > >> if (start == 0 && device_is_wholedisk (os_dev)) > >> return name; > >> > >> === modified file 'util/grub-mkimage.c' > >> --- util/grub-mkimage.c 2012-02-10 12:56:18 +0000 > >> +++ util/grub-mkimage.c 2012-02-10 23:30:37 +0000 > >> @@ -714,7 +714,7 @@ > >> grub_uint64_t start_address; > >> void *rel_section; > >> grub_size_t reloc_size, align; > >> - size_t decompress_size; > >> + size_t decompress_size = 0; > >> > >> if (comp == COMPRESSION_AUTO) > >> comp = image_target->default_compression; > >> > >> === modified file 'util/grub-mkimagexx.c' > >> --- util/grub-mkimagexx.c 2012-02-10 12:56:18 +0000 > >> +++ util/grub-mkimagexx.c 2012-02-10 23:34:17 +0000 > >> @@ -182,6 +182,7 @@ > >> > >> #define MASK20 ((1 << 20) - 1) > >> #define MASK19 ((1 << 19) - 1) > >> +#define MASK3 (~(grub_addr_t) 3) > >> > >> static void > >> add_value_to_slot_20b (grub_addr_t addr, grub_uint32_t value) > >> @@ -190,17 +191,17 @@ > >> switch (addr & 3) > >> { > >> case 0: > >> - p = (struct unaligned_uint32 *) ((addr & ~3ULL) + 2); > >> + p = (struct unaligned_uint32 *) ((addr & MASK3) + 2); > >> p->val = ((((((p->val >> 2) & MASK20) + value) & MASK20) << 2) > >> | (p->val & ~(MASK20 << 2))); > >> break; > >> case 1: > >> - p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & ~3ULL) + > >> 7); > >> + p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & MASK3) + > >> 7); > >> p->val = ((((((p->val >> 3) & MASK20) + value) & MASK20) << 3) > >> | (p->val & ~(MASK20 << 3))); > >> break; > >> case 2: > >> - p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & ~3ULL) + > >> 12); > >> + p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & MASK3) + > >> 12); > >> p->val = ((((((p->val >> 4) & MASK20) + value) & MASK20) << 4) > >> | (p->val & ~(MASK20 << 4))); > >> break; > >> @@ -227,15 +228,15 @@ > >> switch (addr & 3) > >> { > >> case 0: > >> - p = (struct unaligned_uint32 *) ((addr & ~3ULL) + 2); > >> + p = (struct unaligned_uint32 *) ((addr & MASK3) + 2); > >> p->val = ((add_value_to_slot_21_real (((p->val >> 2) & MASKF21), > >> value) & MASKF21) << 2) | (p->val & ~(MASKF21 << 2)); > >> break; > >> case 1: > >> - p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & ~3ULL) + > >> 7); > >> + p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & MASK3) + > >> 7); > >> p->val = ((add_value_to_slot_21_real (((p->val >> 3) & MASKF21), > >> value) & MASKF21) << 3) | (p->val & ~(MASKF21 << 3)); > >> break; > >> case 2: > >> - p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & ~3ULL) + > >> 12); > >> + p = (struct unaligned_uint32 *) ((grub_uint8_t *) (addr & MASK3) + > >> 12); > >> p->val = ((add_value_to_slot_21_real (((p->val >> 4) & MASKF21), > >> value) & MASKF21) << 4) | (p->val & ~(MASKF21 << 4)); > >> break; > >> } > >> @@ -457,8 +458,8 @@ > >> - target_section_addr - (offset & ~3)) >> 4; > >> tr++; > >> if (noff & ~MASK19) > >> - grub_util_error ("trampoline offset too big (%lx)", > >> - noff); > >> + grub_util_error ("trampoline offset too big (%" > >> + PRIxGRUB_UINT64_T ")", noff); > >> add_value_to_slot_20b ((grub_addr_t) target, noff); > >> } > >> break; > >> @@ -919,7 +920,7 @@ > >> grub_size_t kernel_size; > >> grub_size_t ia64jmp_off = 0, ia64_toff = 0, ia64_got_off = 0; > >> unsigned ia64jmpnum = 0; > >> - Elf_Shdr *symtab_section; > >> + Elf_Shdr *symtab_section = 0; > >> grub_size_t got = 0; > >> > >> *start = 0; > >> > >> === modified file 'util/grub-probe.c' > >> --- util/grub-probe.c 2012-02-10 11:57:00 +0000 > >> +++ util/grub-probe.c 2012-02-10 19:56:18 +0000 > >> @@ -87,6 +87,9 @@ > >> for (part = disk->partition; part; part = part->parent) > >> printf ("%s ", part->partmap->name); > >> > >> + if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID) > >> + grub_diskfilter_print_partmap (disk); > >> + > >> /* In case of LVM/RAID, check the member devices as well. */ > >> if (disk->dev->memberlist) > >> { > >> @@ -304,7 +307,7 @@ > >> raid_level = probe_raid_level (disk); > >> if (raid_level >= 0) > >> { > >> - printf ("raid "); > >> + printf ("diskfilter "); > >> if (disk->dev->raidname) > >> printf ("%s ", disk->dev->raidname (disk)); > >> } > >> > >> === modified file 'util/import_gcry.py' > >> --- util/import_gcry.py 2012-02-10 15:48:48 +0000 > >> +++ util/import_gcry.py 2012-02-10 23:26:06 +0000 > >> @@ -325,7 +325,7 @@ > >> confutil.write (" common = grub-core/%s;\n" % src) > >> if modname == "gcry_rijndael" or modname == "gcry_md4" or > >> modname == "gcry_md5" or modname == "gcry_rmd160" or modname == > >> "gcry_sha1" or modname == "gcry_sha256" or modname == "gcry_sha512" or > >> modname == "gcry_tiger": > >> # Alignment checked by hand > >> - conf.write (" cflags = '$(CFLAGS_GCRY) > >> -Wno-cast-align';\n"); > >> + conf.write (" cflags = '$(CFLAGS_GCRY) -Wno-cast-align > >> -Wno-strict-aliasing';\n"); > >> else: > >> conf.write (" cflags = '$(CFLAGS_GCRY)';\n"); > >> conf.write (" cppflags = '$(CPPFLAGS_GCRY)';\n"); > >> > > Well that seems to build (when ignoring warnings). I have to fix the > > packaging scripts a it now that grub-mkdevice has gone away, but that's > > not that big a deal. > > > > I have attached the build log, to see what the warnings remaining > > are (about 5000 lines of warning: when building powerpc-emu and > > powerpc-ieee1275) at this point. > > > Looks like they all come from double-linked list code. This should help: > === modified file 'include/grub/list.h' > --- include/grub/list.h 2012-01-29 17:09:53 +0000 > +++ include/grub/list.h 2012-02-12 01:00:48 +0000 > @@ -24,6 +24,10 @@ > #include <grub/types.h> > #include <grub/misc.h> > > +struct grub_list __attribute__ ((may_alias)); > +struct grub_named_list __attribute__ ((may_alias)); > +struct grub_prio_list __attribute__ ((may_alias)); > + > struct grub_list > { > struct grub_list *next;
I think you got it. Doing a clean build to be sure. -- Len Sorensen _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel