grub2: FTBFS on powerpc (__floatundisf in ls is not defined)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Any comments on this one?
It seems to me that the module dependency hack doesn't take into account gcc internal symbols.
Maybe skipping symbols starting with _ (or __?) would suffice ?
Quoted 37 lines · Philipp Kern
Package: grub2
Version: 1.95+20071004-2
Severity: seriousYour package fails to build on powerpc since version 1.95+20071004-2. Please fix this long-standing issue.
Automatic build of grub2_1.95+20071101-1 on voltaire by sbuild/powerpc 99.99 Build started at 20071106-1003
******************************************************************************
[...]
nm -u -P -p pre-elf.o | cut -f1 -d' ' >> und-elf.lst
echo 'gzio' > und-gzio.lst
nm -u -P -p pre-gzio.o | cut -f1 -d' ' >> und-gzio.lstcat kernel_syms.lst def-_linux.lst def-linux.lst def-normal.lst def-suspend.lst def-reboot.lst def-halt.lst def-_multiboot.lst def-multiboot.lst def-fshelp.lst def-fat.lst def-ufs.lst def-ext2.lst def-ntfs.lst def-minix.lst def-hfs.lst def-jfs.lst def-iso9660.lst def-xfs.lst def-affs.lst def-sfs.lst def-hfsplus.lst def-amiga.lst def-apple.lst def-pc.lst def-sun.lst def-acorn.lst def-gpt.lst def-raid.lst def-lvm.lst def-hello.lst def-boot.lst def-terminal.lst def-ls.lst def-cmp.lst def-cat.lst def-help.lst def-font.lst def-search.lst def-test.lst def-loopback.lst def-configfile.lst def-terminfo.lst def-blocklist.lst def-elf.lst def-gzio.lst /dev/null \ | mawk -f /build/buildd/grub2-1.95+20071101/genmoddep.awk und-_linux.lst und-linux.lst und-normal.lst und-suspend.lst und-reboot.lst und-halt.lst und-_multiboot.lst und-multiboot.lst und-fshelp.lst und-fat.lst und-ufs.lst und-ext2.lst und-ntfs.lst und-minix.lst und-hfs.lst und-jfs.lst und-iso9660.lst und-xfs.lst und-affs.lst und-sfs.lst und-hfsplus.lst und-amiga.lst und-apple.lst und-pc.lst und-sun.lst und-acorn.lst und-gpt.lst und-raid.lst und-lvm.lst und-hello.lst und-boot.lst und-terminal.lst und-ls.lst und-cmp.lst und-cat.lst und-help.lst und-font.lst und-search.lst und-test.lst und-loopback.lst und-configfile.lst und-terminfo.lst und-blocklist.lst und-elf.lst und-gzio.lst > moddep.lst \ || (rm -f moddep.lst; exit 1)
__floatundisfin ls is not defined
make[1]: *** [moddep.lst] Error 1
make[1]: Leaving directory `/build/buildd/grub2-1.95+20071101/build/grub-ieee1275'
make: *** [build/grub-ieee1275] Error 2
dpkg-buildpackage: failure: debian/rules build gave error exit status 2
******************************************************************************
Build finished at 20071106-1007
FAILED [dpkg-buildpackage died]The build log is available at [0].
Kind regards,
Philipp KernSignature · 4 lines
.''`. Philipp Kern (proud) Debian Developer : :' : http://philkern.de Ubuntu MOTU `. `' xmpp:[email protected] `- finger pkern/[email protected]
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call, if you are unable to speak? (as seen on /.)
Quoted 6 lines · Robert Millan
Any comments on this one?
It seems to me that the module dependency hack doesn't take into account gcc internal symbols.
Maybe skipping symbols starting with _ (or __?) would suffice ?
If this is easy, I think it would be better to add symbols defined in libgcc into kernel-defined symbols on ppc (as well as on sparc?).
Okuji
Quoted 10 lines · Yoshinori K. Okuji
Quoted 6 lines · Robert Millan
Any comments on this one?
It seems to me that the module dependency hack doesn't take into account gcc internal symbols.
Maybe skipping symbols starting with _ (or __?) would suffice ?
If this is easy, I think it would be better to add symbols defined in libgcc into kernel-defined symbols on ppc (as well as on sparc?).
Ah, I see there's a mechanism for that already.
Philipp, I'm attaching a patch for the __floatundisf. There might be others, though. Please, could you check and report ?
Thanks
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call, if you are unable to speak? (as seen on /.)
include/grub/powerpc/libgcc.h +1 -0
@@ -25,6 +25,7 @@void EXPORT_FUNC (__fixunsdfsi ) (void );void EXPORT_FUNC (__floatsidf ) (void );void EXPORT_FUNC (__floatsisf ) (void ); +void EXPORT_FUNC (__floatundisf ) (void );void EXPORT_FUNC (__lshrdi3 ) (void );void EXPORT_FUNC (__make_dp ) (void );void EXPORT_FUNC (__make_fp ) (void );
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Philipp Kern
Quoted 2 lines · Robert Millan
Philipp, I'm attaching a patch for the
__floatundisf. There might be others, though. Please, could you check and report ?With the patch applied, on Debian Lenny:
Quoted 9 lines
cc -o kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o -nostdlib -static-libgcc -lgcc -Wl,-N,-S,-Ttext,0x10000,-Bstatic kernel_elf-kernel_elf_symlist.o:(.data+0x584): undefined reference to `__make_dp'
kernel_elf-kernel_elf_symlist.o:(.data+0x58c): undefined reference to `__make_fp'
kernel_elf-kernel_elf_symlist.o:(.data+0x5bc): undefined reference to `__pack_d'
kernel_elf-kernel_elf_symlist.o:(.data+0x5c4): undefined reference to `__pack_f'
kernel_elf-kernel_elf_symlist.o:(.data+0x5dc): undefined reference to `__thenan_df'
kernel_elf-kernel_elf_symlist.o:(.data+0x5e4): undefined reference to `__thenan_sf'
kernel_elf-kernel_elf_symlist.o:(.data+0x5fc): undefined reference to `__unpack_d'
kernel_elf-kernel_elf_symlist.o:(.data+0x604): undefined reference to `__unpack_f'
Are those provided by libgcc on powerpc?
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call, if you are unable to speak? (as seen on /.)
Quoted 7 lines · Robert Millan
Quoted 6 lines · Philipp Kern
Quoted 2 lines · Robert Millan
Philipp, I'm attaching a patch for the
__floatundisf. There might be others, though. Please, could you check and report ?With the patch applied, on Debian Lenny:
Quoted 9 lines
Quoted 9 lines
cc -o kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o -nostdlib -static-libgcc -lgcc -Wl,-N,-S,-Ttext,0x10000,-Bstatic kernel_elf-kernel_elf_symlist.o:(.data+0x584): undefined reference to `__make_dp'
kernel_elf-kernel_elf_symlist.o:(.data+0x58c): undefined reference to `__make_fp'
kernel_elf-kernel_elf_symlist.o:(.data+0x5bc): undefined reference to `__pack_d'
kernel_elf-kernel_elf_symlist.o:(.data+0x5c4): undefined reference to `__pack_f'
kernel_elf-kernel_elf_symlist.o:(.data+0x5dc): undefined reference to `__thenan_df'
kernel_elf-kernel_elf_symlist.o:(.data+0x5e4): undefined reference to `__thenan_sf'
kernel_elf-kernel_elf_symlist.o:(.data+0x5fc): undefined reference to `__unpack_d'
kernel_elf-kernel_elf_symlist.o:(.data+0x604): undefined reference to `__unpack_f'
Those were present in older versions of gcc, but not anymore. The following patch fixes the problem (while also breaking backwards compatibility):
include/grub/powerpc/libgcc.h 2007-12-26 08:42:49.000000000 +0000 renamed from include/grub/powerpc/libgcc.h 2007-07-21 23:32:24.000000000 +0000 +1 -8
@@ -26,19 +26,12 @@ void EXPORT_FUNC (__floatsidf) (void); void EXPORT_FUNC (__floatsisf) (void); void EXPORT_FUNC (__lshrdi3) (void); -void EXPORT_FUNC (__make_dp) (void); -void EXPORT_FUNC (__make_fp) (void); void EXPORT_FUNC (__muldf3) (void); void EXPORT_FUNC (__mulsf3) (void); -void EXPORT_FUNC (__pack_d) (void); -void EXPORT_FUNC (__pack_f) (void); void EXPORT_FUNC (__subdf3) (void); void EXPORT_FUNC (__subsf3) (void); -void EXPORT_FUNC (__thenan_df) (void); -void EXPORT_FUNC (__thenan_sf) (void); void EXPORT_FUNC (__trampoline_setup) (void); void EXPORT_FUNC (__truncdfsf2) (void); -void EXPORT_FUNC (__unpack_d) (void); -void EXPORT_FUNC (__unpack_f) (void); void EXPORT_FUNC (__floatdisf) (void); +void EXPORT_FUNC (__floatundisf) (void); void EXPORT_FUNC (__cmpdi2) (void);
Is there any way we can preserve compatibility with gcc 3.x ? Perhaps obtain a list of symbols dynamicaly, but maybe this would bloat the kernel too much.
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call, if you are unable to speak? (as seen on /.)
Quoted 25 lines · Robert Millan
diff -ur
grub2-1.95+20071101/include/grub/powerpc/libgcc.hgrub2-1.95+20071101.new/include/grub/powerpc/libgcc.hinclude/grub/powerpc/libgcc.h 2007-12-26 08:42:49.000000000 +0000 renamed from include/grub/powerpc/libgcc.h 2007-07-21 23:32:24.000000000 +0000 +1
-8@@ -26,19 +26,12 @@ void EXPORT_FUNC (__floatsidf) (void); void EXPORT_FUNC (__floatsisf) (void); void EXPORT_FUNC (__lshrdi3) (void); -void EXPORT_FUNC (__make_dp) (void); -void EXPORT_FUNC (__make_fp) (void); void EXPORT_FUNC (__muldf3) (void); void EXPORT_FUNC (__mulsf3) (void); -void EXPORT_FUNC (__pack_d) (void); -void EXPORT_FUNC (__pack_f) (void); void EXPORT_FUNC (__subdf3) (void); void EXPORT_FUNC (__subsf3) (void); -void EXPORT_FUNC (__thenan_df) (void); -void EXPORT_FUNC (__thenan_sf) (void); void EXPORT_FUNC (__trampoline_setup) (void); void EXPORT_FUNC (__truncdfsf2) (void); -void EXPORT_FUNC (__unpack_d) (void); -void EXPORT_FUNC (__unpack_f) (void); void EXPORT_FUNC (__floatdisf) (void); +void EXPORT_FUNC (__floatundisf) (void); void EXPORT_FUNC (__cmpdi2) (void);
Quoted 2 lines
Is there any way we can preserve compatibility with gcc 3.x ? Perhaps obtain a list of symbols dynamicaly, but maybe this would bloat the kernel too much.
This is becoming a nightmare. I think it's better if we just exclude symbols starting with __ from our checks. They aren't really meant for us to mess with.
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call, if you are unable to speak? (as seen on /.)
Quoted 3 lines · Robert Millan
This is becoming a nightmare. I think it's better if we just exclude symbols starting with __ from our checks. They aren't really meant for us to mess with.
My original suggestion was that we could extract (required) symbols from libgcc, and export them from the kernel. I think this can be automated.
Okuji
Quoted 7 lines · Yoshinori K. Okuji
Quoted 3 lines · Robert Millan
This is becoming a nightmare. I think it's better if we just exclude symbols starting with __ from our checks. They aren't really meant for us to mess with.
My original suggestion was that we could extract (required) symbols from libgcc, and export them from the kernel. I think this can be automated.
Yes, but what's the point? Doesn't libgcc already provide those symbols?
The problem seems to be only with our checker scripts, not with linking itself.
Unless I missed something of course..
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call, if you are unable to speak? (as seen on /.)
Quoted 10 lines · Robert Millan
Quoted 7 lines · Yoshinori K. Okuji
Quoted 3 lines · Robert Millan
This is becoming a nightmare. I think it's better if we just exclude symbols starting with __ from our checks. They aren't really meant for us to mess with.
My original suggestion was that we could extract (required) symbols from libgcc, and export them from the kernel. I think this can be automated.
Yes, but what's the point? Doesn't libgcc already provide those symbols?
It does, but our kernel doesn't.
Quoted 4 lines
The problem seems to be only with our checker scripts, not with linking itself.
Unless I missed something of course..
From my point of view, ignoring all symbols starting with __ is a hack. I prefer to resolve symbols in the Right Way.
Okuji
Quoted 7 lines · Yoshinori K. Okuji
Quoted 3 lines · Robert Millan
This is becoming a nightmare. I think it's better if we just exclude symbols starting with __ from our checks. They aren't really meant for us to mess with.
My original suggestion was that we could extract (required) symbols from libgcc, and export them from the kernel. I think this can be automated.
Agreed, this is the best solution. The current one is a hack I introduced when I initiated the work on the PPC port. We need a structural solution.
--
Marco