Use mipsel- rather than mips- in directories involving mipsel ports to

allow both endiannesses coexist.

	* configure.ac: proparate target_cpu=mipsel rather than resetting to
	mips. All conditions adjusted.
	* tests/util/grub-shell-tester.in: Remove gratuitious target_cpu
	variable.
	* util/grub-install.in: Adjust conditions to take renaming into account.
	* util/grub-mkimage.c (image_targets): Likewise. New target
	mips-qemu_mips-elf for bigendian mips.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-05-17 22:48:20 +02:00
parent 35341bbc96
commit 4959e11109
5 changed files with 68 additions and 23 deletions

View file

@ -1,3 +1,16 @@
2011-05-17 Vladimir Serbinenko <phcoder@gmail.com>
Use mipsel- rather than mips- in directories involving mipsel ports to
allow both endiannesses coexist.
* configure.ac: proparate target_cpu=mipsel rather than resetting to
mips. All conditions adjusted.
* tests/util/grub-shell-tester.in: Remove gratuitious target_cpu
variable.
* util/grub-install.in: Adjust conditions to take renaming into account.
* util/grub-mkimage.c (image_targets): Likewise. New target
mips-qemu_mips-elf for bigendian mips.
2011-05-17 Vladimir Serbinenko <phcoder@gmail.com>
Avoid unnecessary copying on MIPS.

View file

@ -72,7 +72,7 @@ case "$target_cpu" in
amd64) target_cpu=x86_64 ;;
sparc) target_cpu=sparc64 ;;
mipsel|mips64el)
target_cpu=mips;
target_cpu=mipsel;
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
;;
mips|mips64)
@ -96,7 +96,8 @@ if test "x$with_platform" = x; then
powerpc-*) platform=ieee1275 ;;
powerpc64-*) platform=ieee1275 ;;
sparc64-*) platform=ieee1275 ;;
mips-*) platform=loongson ;;
mipsel-*) platform=loongson ;;
mips-*) platform=arc ;;
ia64-*) platform=efi ;;
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
esac
@ -126,10 +127,12 @@ case "$target_cpu"-"$platform" in
ia64-efi) ;;
mips-qemu_mips) ;;
mips-qemu-mips) platform=qemu_mips;;
mips-yeeloong) platform=loongson ;;
mips-fuloong) platform=loongson ;;
mips-loongson) ;;
mips-arc) ;;
mipsel-qemu_mips) ;;
mipsel-qemu-mips) platform=qemu_mips;;
mipsel-yeeloong) platform=loongson ;;
mipsel-fuloong) platform=loongson ;;
mipsel-loongson) ;;
*-emu) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
esac
@ -167,10 +170,14 @@ case "$platform" in
arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
esac
case "$target_cpu" in
mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
esac
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
if test x${target_cpu} = xmipsel ; then
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
else
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
fi
HOST_CPPFLAGS="$HOST_CPPFLAGS $machine_CPPFLAGS"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
@ -405,7 +412,7 @@ if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
fi
if test "${target_cpu}-${platform}" = mips-loongson; then
if test "${target_cpu}-${platform}" = mipsel-loongson; then
AC_CACHE_CHECK([whether -march=loongson2f works], [grub_cv_cc_march_loongson2f], [
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -march=loongson2f"
@ -958,12 +965,12 @@ AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform =
AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmips -a x$platform = xloongson])
AM_CONDITIONAL([COND_mips_qemu_mips], [test x$target_cpu = xmips -a x$platform = xqemu_mips])
AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
AM_CONDITIONAL([COND_mips_arc], [test x$target_cpu = xmips -a x$platform = xarc])
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips])
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
@ -985,19 +992,23 @@ AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
# Output files.
cpudir="${target_cpu}"
if test x${cpudir} = xmipsel; then
cpudir=mips;
fi
grub_CHECK_LINK_DIR
if test x"$link_dir" = xyes ; then
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu])
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
if test "$platform" != emu ; then
AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform])
AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
fi
else
mkdir -p include/grub 2>/dev/null
rm -rf include/grub/cpu
cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
if test "$platform" != emu ; then
rm -rf include/grub/machine
cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
fi
fi

View file

@ -27,7 +27,6 @@ builddir=@builddir@
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@
# Force build directory components
PATH=${builddir}:$PATH

View file

@ -554,13 +554,13 @@ fi
case "${target_cpu}-${platform}" in
sparc64-ieee1275) mkimage_target=sparc64-ieee1275-raw ;;
mips-loongson) mkimage_target=mipsel-loongson-elf ;;
mipsel-loongson) mkimage_target=mipsel-loongson-elf ;;
*) mkimage_target="${target_cpu}-${platform}" ;;
esac
case "${target_cpu}-${platform}" in
i386-efi | x86_64-efi) imgext=efi ;;
mips-loongson | i386-coreboot | i386-multiboot | i386-ieee1275 \
mipsel-loongson | i386-coreboot | i386-multiboot | i386-ieee1275 \
| powerpc-ieee1275) imgext=elf ;;
*) imgext=img ;;
esac
@ -569,7 +569,7 @@ esac
"$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${grubdir}/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
# Backward-compatibility kludges
if [ "${target_cpu}-${platform}" = "mips-loongson" ]; then
if [ "${target_cpu}-${platform}" = "mipsel-loongson" ]; then
cp "${grubdir}/core.${imgext}" "${bootdir}"/grub.elf
elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then
cp "${grubdir}/core.${imgext}" "${grubdir}/grub"

View file

@ -274,7 +274,7 @@ struct image_target_desc image_targets[] =
.elf_target = EM_X86_64,
},
{
.dirname = "mips-loongson",
.dirname = "mipsel-loongson",
.names = { "mipsel-yeeloong-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
@ -296,7 +296,7 @@ struct image_target_desc image_targets[] =
.default_compression = COMPRESSION_NONE
},
{
.dirname = "mips-loongson",
.dirname = "mipsel-loongson",
.names = { "mipsel-fuloong-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
@ -318,7 +318,7 @@ struct image_target_desc image_targets[] =
.default_compression = COMPRESSION_NONE
},
{
.dirname = "mips-loongson",
.dirname = "mipsel-loongson",
.names = { "mipsel-loongson-elf", "mipsel-yeeloong-elf",
"mipsel-fuloong-elf", NULL },
.voidp_sizeof = 4,
@ -445,7 +445,7 @@ struct image_target_desc image_targets[] =
.default_compression = COMPRESSION_NONE
},
{
.dirname = "mips-qemu_mips",
.dirname = "mipsel-qemu_mips",
.names = { "mipsel-qemu_mips-elf", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
@ -466,6 +466,28 @@ struct image_target_desc image_targets[] =
.link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN,
.default_compression = COMPRESSION_NONE
},
{
.dirname = "mips-qemu_mips",
.names = { "mips-qemu_mips-elf", NULL },
.voidp_sizeof = 4,
.bigendian = 1,
.id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.prefix = GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX,
.prefix_end = GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX_END,
.raw_size = 0,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.compressed_size = TARGET_NO_FIELD,
.kernel_image_size = TARGET_NO_FIELD,
.section_align = 1,
.vaddr_offset = 0,
.install_dos_part = TARGET_NO_FIELD,
.install_bsd_part = TARGET_NO_FIELD,
.link_addr = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR,
.elf_target = EM_MIPS,
.link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN,
.default_compression = COMPRESSION_NONE
},
};
#define grub_target_to_host32(x) (grub_target_to_host32_real (image_target, (x)))