grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* powerpc/emu build failure
@ 2010-11-23 16:21 Colin Watson
  2010-11-24 12:08 ` Colin Watson
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Watson @ 2010-11-23 16:21 UTC (permalink / raw)
  To: grub-devel

This is what I get for not building new snapshots for over three months:
I get to spend a couple of solid days fixing build failures. :-)

This time the failure's in the emu build on powerpc
(https://buildd.debian.org/fetch.cgi?pkg=grub2&arch=powerpc&ver=1.99~20101123-1&stamp=1290514876&file=log&as=raw):

  gcc-4.4 -Os -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -Werror -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1          -m32 -Wl,--build-id=none    -o grub-emu kern/emu/grub_emu-full.o grub_emu-grub_emu_init.o kernel.img trig.module                                                                                        regexp.module                           blocklist.module           boot.module          cat.module           cmp.module           configfile.module                  date.module            echo.module           extcmd.module         gptsync.module           halt.module           hashsum.module                   help.module           hexdump.module           keystatus.module             loadenv.module           ls.module           lsmmap.module                   memrw.module           minicmd.module           parttool.module           password.module           password_pbkdf2.module                  probe.module            read.module           reboot.module           search.module           search_fs_file.module           search_fs_uuid.module           search_label.module                  sleep.module             terminal.module           test.module           true.module                    videoinfo.module           videotest.module           xnu_uuid.module           dm_nv.module           loopback.module           lvm.module           mdraid09.module           mdraid1x.module           raid.module           raid5rec.module           raid6rec.module           scsi.module           memdisk.module                                           font.module          affs.module           afs.module           afs_be.module           befs.module           befs_be.module           btrfs.module           cpio.module           ext2.module           fat.module           fshelp.module           hfs.module           hfsplus.module           iso9660.module           jfs.module           minix.module           minix2.module           nilfs2.module           ntfs.module           ntfscomp.module           reiserfs.module           sfs.module           tar.module           udf.module           ufs1.module           ufs2.module           xfs.module            gettext.module           gfxmenu.module           hello.module           gzio.module           bufio.module          elf.module           crypto.module           pbkdf2.module                              setjmp.module                                                                      normal.module           part_acorn.module           part_amiga.module           part_apple.module           part_gpt.module           part_msdos.module           part_sun.module           part_bsd.module           part_sunpc.module           msdospart.module                  gfxterm.module                   terminfo.module                                functional_test.module           example_functional_test.module           bitmap.module          bitmap_scale.module              jpeg.module           png.module           tga.module            video_fb.module          video.module            sdl.module datehook.module           legacycfg.module  test_blockarg.module           xzio.module           testload.module            keylayouts.module          gcry_arcfour.module           gcry_twofish.module           gcry_tiger.module           gcry_whirlpool.module           gcry_md5.module           gcry_rfc2268.module           gcry_sha512.module           gcry_rmd160.module           gcry_crc.module           gcry_cast5.module           gcry_camellia.module           gcry_serpent.module           gcry_md4.module           gcry_seed.module           gcry_blowfish.module           gcry_sha256.module           gcry_rijndael.module           gcry_des.module           gcry_sha1.module            zfs.module           zfsinfo.module            -lncurses -lSDL   -ldevmapper    
  kernel.img: In function `grub_dl_flush_cache':
  /build/buildd-grub2_1.99~20101123-1-powerpc-mAsrpj/grub2-1.99~20101123/build/grub-emu/grub-core/../../../grub-core/kern/dl.c:484: undefined reference to `grub_arch_sync_caches'
  collect2: ld returned 1 exit status
  make[5]: *** [grub-emu] Error 1

It seems to me that we should probably include the emu implementation of
grub_arch_sync_caches in the kernel when building for the emu platform.
Does this patch look sane?

2010-11-23  Colin Watson  <cjwatson@ubuntu.com>

	* grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu
	platforms.
	(grub-emu-lite): Remove kern/emu/cache.S.

=== modified file 'grub-core/Makefile.core.def'
--- grub-core/Makefile.core.def	2010-11-14 22:36:20 +0000
+++ grub-core/Makefile.core.def	2010-11-23 15:59:05 +0000
@@ -162,6 +162,7 @@ kernel = {
   emu = disk/host.c;
   emu = gnulib/progname.c;
   emu = gnulib/error.c;
+  emu = kern/emu/cache.S;
   emu = kern/emu/console.c;
   emu = kern/emu/getroot.c;
   emu = kern/emu/hostdisk.c;
@@ -208,7 +209,6 @@ program = {
   name = grub-emu-lite;
 
   emu = kern/emu/lite.c;
-  emu = kern/emu/cache.S;
   emu_nodist = symlist.c;
 
   ldadd = 'kernel.img$(EXEEXT)';

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: powerpc/emu build failure
  2010-11-23 16:21 powerpc/emu build failure Colin Watson
@ 2010-11-24 12:08 ` Colin Watson
  2010-11-24 13:38   ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Watson @ 2010-11-24 12:08 UTC (permalink / raw)
  To: grub-devel

On Tue, Nov 23, 2010 at 04:21:14PM +0000, Colin Watson wrote:
> It seems to me that we should probably include the emu implementation of
> grub_arch_sync_caches in the kernel when building for the emu platform.
> Does this patch look sane?
> 
> 2010-11-23  Colin Watson  <cjwatson@ubuntu.com>
> 
> 	* grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu
> 	platforms.
> 	(grub-emu-lite): Remove kern/emu/cache.S.

I went ahead and committed this; Manoel Rebelo Abranches seemed keen on
IRC, and it certainly doesn't break anything on x86 since the object is
essentially empty there.

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: powerpc/emu build failure
  2010-11-24 12:08 ` Colin Watson
@ 2010-11-24 13:38   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-11-24 14:09     ` Colin Watson
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-11-24 13:38 UTC (permalink / raw)
  To: grub-devel


[-- Attachment #1.1: Type: text/plain, Size: 900 bytes --]

On 11/24/2010 01:08 PM, Colin Watson wrote:
> On Tue, Nov 23, 2010 at 04:21:14PM +0000, Colin Watson wrote:
>   
>> It seems to me that we should probably include the emu implementation of
>> grub_arch_sync_caches in the kernel when building for the emu platform.
>> Does this patch look sane?
>>
>> 2010-11-23  Colin Watson  <cjwatson@ubuntu.com>
>>
>> 	* grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu
>> 	platforms.
>> 	(grub-emu-lite): Remove kern/emu/cache.S.
>>     
> I went ahead and committed this; Manoel Rebelo Abranches seemed keen on
> IRC, and it certainly doesn't break anything on x86 since the object is
> essentially empty there.
>
>   
Could you try the attached patch as a replacement for yours? Not that
your patch doesn't solve the problem but it's more annoying for maintenance.

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: endian.diff --]
[-- Type: text/x-diff; name="endian.diff", Size: 2009 bytes --]

=== modified file 'include/grub/gpt_partition.h'
--- include/grub/gpt_partition.h	2009-04-19 20:38:46 +0000
+++ include/grub/gpt_partition.h	2010-11-23 17:33:09 +0000
@@ -36,7 +36,7 @@
   }
 
 #define GRUB_GPT_PARTITION_TYPE_BIOS_BOOT \
-  { grub_cpu_to_le32 (0x21686148), grub_cpu_to_le16 (0x6449), grub_cpu_to_le16 (0x6e6f), \
+  { grub_cpu_to_le32_compile_time (0x21686148), grub_cpu_to_le16_compile_time (0x6449), grub_cpu_to_le16_compile_time (0x6e6f), \
     { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \
   }
 

=== modified file 'include/grub/types.h'
--- include/grub/types.h	2010-10-26 10:29:12 +0000
+++ include/grub/types.h	2010-11-23 17:32:43 +0000
@@ -146,6 +146,9 @@
    (grub_uint16_t) ((_x << 8) | (_x >> 8)); \
 })
 
+#define grub_swap_bytes16_compile_time(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))
+#define grub_swap_bytes32_compile_time(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24))
+
 #if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3)
 static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
 {
@@ -193,6 +196,8 @@
 # define grub_be_to_cpu16(x)	((grub_uint16_t) (x))
 # define grub_be_to_cpu32(x)	((grub_uint32_t) (x))
 # define grub_be_to_cpu64(x)	((grub_uint64_t) (x))
+# define grub_cpu_to_le32_compile_time(x)	grub_swap_bytes32_compile_time(x)
+# define grub_cpu_to_le16_compile_time(x)	grub_swap_bytes16_compile_time(x)
 #else /* ! WORDS_BIGENDIAN */
 # define grub_cpu_to_le16(x)	((grub_uint16_t) (x))
 # define grub_cpu_to_le32(x)	((grub_uint32_t) (x))
@@ -206,6 +211,8 @@
 # define grub_be_to_cpu16(x)	grub_swap_bytes16(x)
 # define grub_be_to_cpu32(x)	grub_swap_bytes32(x)
 # define grub_be_to_cpu64(x)	grub_swap_bytes64(x)
+# define grub_cpu_to_le16_compile_time(x)	((grub_uint16_t) (x))
+# define grub_cpu_to_le32_compile_time(x)	((grub_uint32_t) (x))
 #endif /* ! WORDS_BIGENDIAN */
 
 #endif /* ! GRUB_TYPES_HEADER */


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: powerpc/emu build failure
  2010-11-24 13:38   ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-11-24 14:09     ` Colin Watson
  0 siblings, 0 replies; 4+ messages in thread
From: Colin Watson @ 2010-11-24 14:09 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, Nov 24, 2010 at 02:38:22PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 11/24/2010 01:08 PM, Colin Watson wrote:
> > On Tue, Nov 23, 2010 at 04:21:14PM +0000, Colin Watson wrote:
> >> It seems to me that we should probably include the emu implementation of
> >> grub_arch_sync_caches in the kernel when building for the emu platform.
> >> Does this patch look sane?
> >>
> >> 2010-11-23  Colin Watson  <cjwatson@ubuntu.com>
> >>
> >> 	* grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu
> >> 	platforms.
> >> 	(grub-emu-lite): Remove kern/emu/cache.S.
> >
> > I went ahead and committed this; Manoel Rebelo Abranches seemed keen on
> > IRC, and it certainly doesn't break anything on x86 since the object is
> > essentially empty there.
> 
> Could you try the attached patch as a replacement for yours? Not that
> your patch doesn't solve the problem but it's more annoying for maintenance.

I think you meant to reply to
http://lists.gnu.org/archive/html/grub-devel/2010-11/msg00053.html
rather than to this thread.

Anyway, this looks fine and compiles fine, although I haven't tried
booting it.  One thing, though:

> +#define grub_swap_bytes16_compile_time(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))
> +#define grub_swap_bytes32_compile_time(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24))

Should the last one perhaps be 0xff000000UL, as in the grub_swap_bytes32
implementation?  I forget the exact rules here but it would at least
seem reasonable for the code to match as closely as possible for ease of
maintenance.

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-24 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23 16:21 powerpc/emu build failure Colin Watson
2010-11-24 12:08 ` Colin Watson
2010-11-24 13:38   ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-11-24 14:09     ` Colin Watson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).