cygwin fixes
This commit is contained in:
parent
83fb6e1d48
commit
2d465fb052
7 changed files with 54 additions and 29 deletions
|
@ -93,7 +93,7 @@ else
|
|||
fi
|
||||
grub_cv_prog_objcopy_absolute=yes
|
||||
for link_addr in 0x2000 0x8000 0x7C00; do
|
||||
if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC}$link_addr conftest.o -o conftest.exec]); then :
|
||||
if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},$link_addr conftest.o -o conftest.exec]); then :
|
||||
else
|
||||
AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
|
||||
fi
|
||||
|
|
|
@ -45,6 +45,9 @@ AC_CONFIG_HEADER([config.h])
|
|||
grub_coredir='grub-core'
|
||||
AC_SUBST(grub_coredir)
|
||||
|
||||
grub_utildir='.'
|
||||
AC_SUBST(grub_utildir)
|
||||
|
||||
m4_include([configure.common])
|
||||
|
||||
# Output files.
|
||||
|
|
|
@ -351,19 +351,22 @@ if test x$grub_cv_apple_target_cc = xyes ; then
|
|||
fi
|
||||
TARGET_IMG_LDSCRIPT=
|
||||
TARGET_IMG_CFLAGS="-static"
|
||||
TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
|
||||
TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
|
||||
TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
|
||||
TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
|
||||
TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
|
||||
else
|
||||
TARGET_APPLE_CC=0
|
||||
# Use linker script if present, otherwise use builtin -N script.
|
||||
if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
|
||||
TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
|
||||
TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT} -Wl,-Ttext,"
|
||||
TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc -Wl,-Ttext,"
|
||||
TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
|
||||
TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
|
||||
TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
|
||||
else
|
||||
TARGET_IMG_LDSCRIPT=
|
||||
TARGET_IMG_LDFLAGS='-Wl,-N -Wl,-Ttext,'
|
||||
TARGET_IMG_LDFLAGS_AC='-Wl,-N -Wl,-Ttext,'
|
||||
TARGET_IMG_LDFLAGS='-Wl,-N'
|
||||
TARGET_IMG_LDFLAGS_AC='-Wl,-N'
|
||||
TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
|
||||
fi
|
||||
TARGET_IMG_CFLAGS=
|
||||
fi
|
||||
|
@ -371,7 +374,7 @@ fi
|
|||
# For platforms where ELF is not the default link format.
|
||||
AC_MSG_CHECKING([for command to convert module to ELF format])
|
||||
case "${host_os}" in
|
||||
cygwin) TARGET_OBJ2ELF='grub-pe2elf';
|
||||
cygwin) TARGET_OBJ2ELF='$(grub_utildir)/grub-pe2elf';
|
||||
# FIXME: put proper test here
|
||||
AC_DEFINE([NEED_REGISTER_FRAME_INFO], 1,
|
||||
[Define to 1 if GCC generates calls to __register_frame_info()])
|
||||
|
@ -479,6 +482,7 @@ AC_SUBST(TARGET_CCASFLAGS)
|
|||
AC_SUBST(TARGET_IMG_LDSCRIPT)
|
||||
AC_SUBST(TARGET_IMG_LDFLAGS)
|
||||
AC_SUBST(TARGET_IMG_CFLAGS)
|
||||
AC_SUBST(TARGET_IMG_BASE_LDOPT)
|
||||
|
||||
AC_SUBST(HOST_CFLAGS)
|
||||
AC_SUBST(HOST_LDFLAGS)
|
||||
|
@ -523,7 +527,7 @@ if test "x$target_cpu" = xi386; then
|
|||
if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then
|
||||
if test ! -z "$TARGET_IMG_LDSCRIPT"; then
|
||||
# Check symbols provided by linker script.
|
||||
CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC}8000 -Wl,--defsym,___main=0x8100"
|
||||
CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100"
|
||||
fi
|
||||
grub_CHECK_BSS_START_SYMBOL
|
||||
grub_CHECK_END_SYMBOL
|
||||
|
@ -830,4 +834,5 @@ AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
|
|||
AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
|
||||
AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
|
||||
AM_CONDITIONAL([COND_GRUB_FSTEST], [test x$enable_grub_fstest = xyes])
|
||||
AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
|
||||
AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
|
||||
|
|
|
@ -176,8 +176,8 @@ BUILT_SOURCES += symlist.c
|
|||
|
||||
noinst_DATA += kernel_syms.lst
|
||||
kernel_syms.lst: $(KERNEL_HEADER_FILES) config.h
|
||||
if grep "^#define HAVE_ASM_USCORE" config.h; then u="_"; else u=""; fi
|
||||
$(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DGRUB_SYMBOL_GENERATOR=1 $^ >kernel_syms.input
|
||||
if grep "^#define HAVE_ASM_USCORE" config.h; then u="_"; else u=""; fi; \
|
||||
cat kernel_syms.input | grep -v '^#' | sed -n \
|
||||
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
|
||||
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
|
||||
|
|
|
@ -45,6 +45,9 @@ AC_CONFIG_HEADER([config.h])
|
|||
grub_coredir='.'
|
||||
AC_SUBST(grub_coredir)
|
||||
|
||||
grub_utildir='..'
|
||||
AC_SUBST(grub_utildir)
|
||||
|
||||
m4_include([configure.common])
|
||||
|
||||
CC=$TARGET_CC
|
||||
|
|
|
@ -5,10 +5,15 @@ kernel = {
|
|||
|
||||
emu_ldflags = '-Wl,-r';
|
||||
x86_efi_ldflags = '-Wl,-r';
|
||||
i386_pc_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
|
||||
i386_qemu_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
|
||||
i386_coreboot_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
i386_multiboot_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
i386_qemu_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
i386_ieee1275_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
mips_yeeloong_ldflags = '-Wl,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
powerpc_ieee1275_ldflags = '-Wl,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
|
||||
|
@ -258,10 +263,13 @@ module = {
|
|||
image = {
|
||||
name = boot;
|
||||
i386_pc = boot/i386/pc/boot.S;
|
||||
i386_pc_ldflags = "-Wl,-Ttext=0x7C00";
|
||||
|
||||
i386_qemu = boot/i386/qemu/boot.S;
|
||||
i386_qemu_ldflags = '-Wl,-Ttext,$(GRUB_BOOT_MACHINE_LINK_ADDR)';
|
||||
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
|
||||
|
||||
i386_qemu_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_BOOT_MACHINE_LINK_ADDR)';
|
||||
i386_qemu_ccasflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
|
||||
|
||||
sparc64_ieee1275 = boot/sparc64/ieee1275/boot.S;
|
||||
|
@ -271,24 +279,25 @@ image = {
|
|||
|
||||
image = {
|
||||
name = cdboot;
|
||||
source = boot/i386/pc/cdboot.S;
|
||||
ldflags = "-Wl,-Ttext=0x7C00";
|
||||
|
||||
i386_pc;
|
||||
i386_pc = boot/i386/pc/cdboot.S;
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
|
||||
};
|
||||
|
||||
image = {
|
||||
name = pxeboot;
|
||||
source = boot/i386/pc/pxeboot.S;
|
||||
ldflags = '-Wl,-Ttext=0x7C00';
|
||||
i386_pc = boot/i386/pc/pxeboot.S;
|
||||
|
||||
i386_pc;
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
|
||||
};
|
||||
|
||||
image = {
|
||||
name = diskboot;
|
||||
i386_pc = boot/i386/pc/diskboot.S;
|
||||
i386_pc_ldflags = '-Wl,-Ttext=0x8000';
|
||||
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x8000';
|
||||
|
||||
sparc64_ieee1275 = boot/sparc64/ieee1275/diskboot.S;
|
||||
sparc64_ieee1275_ldflags = '-Wl,-Ttext=0x4200';
|
||||
|
@ -296,10 +305,10 @@ image = {
|
|||
|
||||
image = {
|
||||
name = lnxboot;
|
||||
source = boot/i386/pc/lnxboot.S;
|
||||
ldflags = '-Wl,-Ttext=0x6000';
|
||||
i386_pc = boot/i386/pc/lnxboot.S;
|
||||
|
||||
i386_pc;
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x6000';
|
||||
};
|
||||
|
||||
module = {
|
||||
|
|
11
modules.def
11
modules.def
|
@ -177,6 +177,9 @@ program = {
|
|||
source = util/grub-pe2elf.c;
|
||||
|
||||
ldadd = libgrub.a;
|
||||
ldadd = '$(LIBINTL)';
|
||||
enable = COND_GRUB_PE2ELF;
|
||||
common;
|
||||
};
|
||||
|
||||
program = {
|
||||
|
@ -195,10 +198,12 @@ program = {
|
|||
mansection = 1;
|
||||
source = util/grub-mkfont.c;
|
||||
|
||||
ldadd = '$(LIBINTL)';
|
||||
ldadd = libgrub.a;
|
||||
cflags = '$(freetype_cflags)';
|
||||
ldflags = '$(freetype_libs)';
|
||||
|
||||
ldadd = libgrub.a;
|
||||
ldadd = '$(LIBINTL)';
|
||||
ldadd = '$(freetype_libs)';
|
||||
|
||||
common;
|
||||
enable = COND_GRUB_MKFONT;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue