powerpc/emu build failure
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 <[email protected]>
* 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'
Makefile.core.def +1 -1
@@ -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)';
Signature · 1 line
Colin Watson [[email protected]]
Quoted 9 lines · Colin Watson
It seems to me that we should probably include the emu implementation of
grub_arch_sync_cachesin the kernel when building for the emu platform. Does this patch look sane?2010-11-23 Colin Watson <[email protected]>
* grub-core/Makefile.core.def (kernel): Add
kern/emu/cache.Sfor emu platforms.
(grub-emu-lite): Removekern/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.
Signature · 1 line
Colin Watson [[email protected]]
Quoted 8 lines · Colin Watson
Quoted 6 lines · Colin Watson
It seems to me that we should probably include the emu implementation of
grub_arch_sync_cachesin the kernel when building for the emu platform. Does this patch look sane?2010-11-23 Colin Watson <[email protected]>
Quoted 9 lines
Quoted 4 lines
* grub-core/Makefile.core.def (kernel): Add
kern/emu/cache.Sfor emu platforms.
(grub-emu-lite): Removekern/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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'include/grub/gpt_partition.h'
grub/gpt_partition.h +1 -1
@@ -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'
grub/types.h +7 -0
@@ -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 */
Quoted 12 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 11 lines · Colin Watson
Quoted 9 lines · Colin Watson
It seems to me that we should probably include the emu implementation of
grub_arch_sync_cachesin the kernel when building for the emu platform. Does this patch look sane?2010-11-23 Colin Watson <[email protected]>
* grub-core/Makefile.core.def (kernel): Add
kern/emu/cache.Sfor emu platforms.
(grub-emu-lite): Removekern/emu/cache.S.
Quoted 6 lines
Quoted 3 lines
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:
grub/types.h line 150
Quoted 2 lines
grub/types.h +2
-0+#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,
Signature · 1 line
Colin Watson [[email protected]]