Check if compiler is apple cc
* Makefile.in (ASFLAGS): new variable
(TARGET_ASFLAGS): likewise
(TARGET_MODULE_FORMAT): likewise
(TARGET_APPLE_CC): likewise
(OBJCONV): likewise
(TARGET_IMG_CFLAGS): likewise
(TARGET_CPPFLAGS): add includedir
* configure.ac: call grub_apple_cc and grub_apple_target_cc
(TARGET_IMG_LDFLAGS): Add -Wl,-Ttext,. All users updated
Check for linker script only if compiler isn't Apple's CC
(TARGET_MODULE_FORMAT): set
(TARGET_APPLE_CC): likewise
(TARGET_ASFLAGS): likewise
(ASFLAGS): likewise
Check for objcopy only if compiler isn't Apple's CC
Check for BSS symbol only if compiler isn't Apple's CC
* genmk.rb: adapt nm options if we use Apple's utils
* aclocal.m4 (grub_apple_cc): new test
(grub_apple_target_cc): likewise
* aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Remove.
* configure.ac: Don't call grub_I386_CHECK_REGPARM_BUG. Define
NESTED_FUNC_ATTR using AH_BOTTOM. Use regparm(1) only when
compiling for the i386 targets, but not for the utilities.
* util/hostdisk.c (read_device_map): Use grub_util_get_disk_size
instead of stat in mingw environment.
* util/misc.c (grub_millisleep): Use Sleep in mingw environment.
* aclocal.m4 (grub_CHECK_LINK_DIR): New function.
* configure.ac: Use grub_CHECK_LINK_DIR to determine whether to use
AC_CONFIG_LINKS.
* common.rmk (bin_UTILITIES): Add grub-pe2elf.
(grub_pe2elf_SOURCES): New macro.
(CLEANFILES): Add grub-pe2elf.
* include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant.
(GRUB_PE32_SCN_ALIGN_2BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_4BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_8BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_16BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_32BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_64BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_SHIFT): Likewise.
(GRUB_PE32_SCN_ALIGN_MASK): Likewise.
(GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise.
(GRUB_PE32_SYM_CLASS_STATIC): Likewise.
(GRUB_PE32_SYM_CLASS_FILE): Likewise.
(GRUB_PE32_DT_FUNCTION): Likewise.
(GRUB_PE32_REL_I386_DIR32): Likewise.
(GRUB_PE32_REL_I386_REL32): Likewise.
(grub_pe32_symbol): New structure.
(grub_pe32_reloc): Likewise.
* util/grub-pe2elf.c: New file.
* configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for
start symbol in non pc platform.
* genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf.
The following patches are from Christian Franke.
* include/grub/dl.h: Remove .previous, gas supports this only
for ELF format.
* include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE):
Remove .type, gas supports this only for ELF format.
* kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing
nullbytes in symbol table. This fixes an infinite loop if table is
zero filled.
* Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT,
TARGET_IMG_LDFLAGS and EXEEXT.
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by
TARGET_IMG_LDFLAGS_AC.
(grub_CHECK_STACK_ARG_PROBE): New function.
* conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS.
* conf/i386-pc-cygwin-ld-img.sc: New linker script.
* configure.ac: Add check for linker script "conf/${target}-img-ld.c"
to set TARGET_IMG_LD* accordingly.
Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly.
Add call to grub_CHECK_STACK_ARG_PROBE.
Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols.
* genkernsyms.sh.in: Handle HAVE_ASM_USCORE case.
* genmk.rb: Add EXEEXT to CLEANFILES.
* aclocal.m4 (grub_PROG_TARGET_CC): New macro. Check if the
target compiler is functional.
* configure.ac: Call grub_PROG_TARGET_CC once all target flags
are set up.
* Makefile.in (MODULE_LDFLAGS): New variable.
* aclocal.m4 (grub_PROG_LD_BUILD_ID_NONE): New macro. Check if
the linker accepts --build-id=none.
* configure.ac: Call grub_PROG_LD_BUILD_ID_NONE. Substitute
MODULE_LDFLAGS.
* genmk.rb: Use MODULE_LDFLAGS when linking modules.
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text
section into account, newer toolchains generate unique build ids
* configure.ac: remove the test for --build-id=none acceptance,
we want build ids to bre preserved
* genmk.rb: add -R .note.gnu.build-id to objcopy, so build id
far from other sections don't cause the raw binary images grow
size
* fs/ufs.c (INODE_BLKSZ): Fix incorrect value.
(grub_ufs_get_file_block): Fix indirect block calculation problem.
* fs/xfs.c (grub_xfs_sblock): New member log2_dirblk.
(grub_xfs_btree_node): New structure.
(grub_xfs_btree_root): New structure.
(grub_xfs_inode): New members nblocks, extsize, nextents and btree.
(GRUB_XFS_EXTENT_OFFSET): Use exts instead of inode->data.extents.
(GRUB_XFS_EXTENT_BLOCK): Likewise.
(GRUB_XFS_EXTENT_SIZE): Likewise.
(grub_xfs_read_block): Support btree format type.
(grub_xfs_iterate_dir): Use NESTED_FUNC_ATTR in call_hook.
Use directory block as basic unit.
* fs/fshelp.c (grub_fshelp_read_file): Bug fix for sparse block.
* aclocal.m4 (grub_i386_CHECK_REGPARM_BUG): Define NESTED_FUNC_ATTR as
__attribute__ ((__regparm__ (1))).
linker. If yes, add it to TARGET_LDFLAGS. Build ID causes
objcopy to generate incorrect binary files (binutils
2.17.50.0.18-1 as shipped by Fedora 8).
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
linking, so that build ID doesn't break the test.
* aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Replace the test
program with another one, because the old one didn't detect a bug
in gcc-3.4. Always use regparm 2, because the new test is still
not enough for gcc-4.0. Someone must investigate a simple test
case which detects a bug in gcc-4.0.
All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
and grub_, respectively. Because the conversion is trivial and
mechanical, I omit the details here. Please refer to the CVS
if you need more information.