From c527fd1f14c27855a37f2e8ac5346ce8d940ced2 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 16 Oct 2014 03:05:19 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- meta/recipes-bsp/grub/files/cfg | 2 + .../grub/files/check-if-liblzma-is-disabled.patch | 33 ++++++ .../grub/files/fix-issue-with-flex-2.5.37.patch | 21 ++++ .../grub/files/grub-2.00-add-oe-kernel.patch | 53 +++++++++ .../grub-2.00-fix-enable_execute_stack-check.patch | 27 +++++ .../grub/files/grub-2.00-fpmath-sse-387-fix.patch | 24 ++++ .../grub-2.00-ignore-gnulib-gets-stupidity.patch | 28 +++++ ...allow-a-compilation-without-mcmodel-large.patch | 131 +++++++++++++++++++++ .../grub/files/grub-no-unused-result.patch | 19 +++ 9 files changed, 338 insertions(+) create mode 100644 meta/recipes-bsp/grub/files/cfg create mode 100644 meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch create mode 100644 meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch create mode 100644 meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch create mode 100644 meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch create mode 100644 meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch create mode 100644 meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch create mode 100644 meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch create mode 100644 meta/recipes-bsp/grub/files/grub-no-unused-result.patch (limited to 'meta/recipes-bsp/grub/files') diff --git a/meta/recipes-bsp/grub/files/cfg b/meta/recipes-bsp/grub/files/cfg new file mode 100644 index 0000000000..ffffe47638 --- /dev/null +++ b/meta/recipes-bsp/grub/files/cfg @@ -0,0 +1,2 @@ +search.file /EFI/BOOT/grub.cfg root +set prefix=($root)/EFI/BOOT diff --git a/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch b/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch new file mode 100644 index 0000000000..0eece082f8 --- /dev/null +++ b/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch @@ -0,0 +1,33 @@ +Disable liblzma if --enable-liblzma=no + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Constantin Musca + +--- a/configure.ac ++++ b/configure.ac +@@ -1029,10 +1029,20 @@ fi + + AC_SUBST([LIBGEOM]) + +-AC_CHECK_LIB([lzma], [lzma_code], +- [LIBLZMA="-llzma" +- AC_DEFINE([HAVE_LIBLZMA], [1], +- [Define to 1 if you have the LZMA library.])],) ++AC_ARG_ENABLE([liblzma], ++ [AS_HELP_STRING([--enable-liblzma], ++ [enable liblzma integration (default=guessed)])]) ++if test x"$enable_liblzma" = xno ; then ++ liblzma_excuse="explicitly disabled" ++fi ++ ++if test x"$liblzma_excuse" = x ; then ++ AC_CHECK_LIB([lzma], [lzma_code], ++ [LIBLZMA="-llzma" ++ AC_DEFINE([HAVE_LIBLZMA], [1], ++ [Define to 1 if you have the LZMA library.])],) ++fi ++ + AC_SUBST([LIBLZMA]) + + AC_ARG_ENABLE([libzfs], diff --git a/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch b/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch new file mode 100644 index 0000000000..61ae2f5372 --- /dev/null +++ b/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch @@ -0,0 +1,21 @@ +Upstream-Status: Backport + +This fixes compilation issues when using flex-2.5.37. It was taken from upstream. + +Original author is: Vladimir Serbinenko + +Signed-off-by: Laurentiu Palcu + +Index: grub-2.00/grub-core/script/yylex.l +=================================================================== +--- grub-2.00.orig/grub-core/script/yylex.l 2012-06-08 23:24:15.000000000 +0300 ++++ grub-2.00/grub-core/script/yylex.l 2013-07-31 14:34:40.708100982 +0300 +@@ -29,6 +29,8 @@ + #pragma GCC diagnostic ignored "-Wmissing-prototypes" + #pragma GCC diagnostic ignored "-Wmissing-declarations" + #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" ++#pragma GCC diagnostic ignored "-Wunused-function" ++#pragma GCC diagnostic ignored "-Wsign-compare" + + #define yyfree grub_lexer_yyfree + #define yyalloc grub_lexer_yyalloc diff --git a/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch b/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch new file mode 100644 index 0000000000..eb8916cb72 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch @@ -0,0 +1,53 @@ +From 7ab576a7c61406b7e63739d1b11017ae336b9008 Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Mon, 3 Mar 2014 03:34:48 -0500 +Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name + +Our kernel's name is bzImage, we need add it to grub.d/10_linux.in so +that the grub-mkconfig and grub-install can work correctly. + +We only need add the bzImage to util/grub.d/10_linux.in, but also add it +to util/grub.d/20_linux_xen.in to keep compatibility. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Robert Yang +--- + util/grub.d/10_linux.in | 4 ++-- + util/grub.d/20_linux_xen.in | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 14402e8..c58f417 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -153,11 +153,11 @@ EOF + machine=`uname -m` + case "x$machine" in + xi?86 | xx86_64) +- list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do ++ list=`for i in /boot/bzImage-* /bzImage-* /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do + if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi + done` ;; + *) +- list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do ++ list=`for i in /boot/bzImage-* /boot/vmlinuz-* /boot/vmlinux-* /bzImage-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do + if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi + done` ;; + esac +diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in +index 1d94502..b2decf3 100644 +--- a/util/grub.d/20_linux_xen.in ++++ b/util/grub.d/20_linux_xen.in +@@ -138,7 +138,7 @@ EOF + EOF + } + +-linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do ++linux_list=`for i in /boot/bzImage[xz]-* /bzImage[xz]-* /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do + if grub_file_is_not_garbage "$i"; then + basename=$(basename $i) + version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") +-- +1.7.10.4 + diff --git a/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch b/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch new file mode 100644 index 0000000000..09ef4dbff9 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch @@ -0,0 +1,27 @@ +Upstream-Status: Pending + + +This patch avoids this configure failure + +configure:20306: checking whether `ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow' generates calls to `__enable_execute_stack()' +configure:20320: ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387 -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -Wno-trampolines -falign-loops=1 -S conftest.c +conftest.c:308:6: error: no previous prototype for 'g' [-Werror=missing-prototypes] +cc1: all warnings being treated as errors +configure:20323: $? = 1 +configure:20327: error: ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow failed to produce assembly code + +Signed-Off-By: Nitin A Kamble +2012/04/13 + +Index: grub-2.00/acinclude.m4 +=================================================================== +--- grub-2.00.orig/acinclude.m4 ++++ grub-2.00/acinclude.m4 +@@ -317,6 +317,7 @@ dnl Check if the C compiler generates ca + AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[ + AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()']) + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ ++void g (int); + void f (int (*p) (void)); + void g (int i) + { diff --git a/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch b/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch new file mode 100644 index 0000000000..c557f13e23 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch @@ -0,0 +1,24 @@ +Upstream-Status: pending + +This patch fixes this configure issue for grub when -mfpmath=sse is in the gcc parameters. + +configure:20574: i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/usr/local/dev/yocto/grubtest2/build/tmp/sysroots/emenlow -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -nostdlib -Wl,--defsym,___main=0x8100 -Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5 +conftest.c:1:0: error: SSE instruction set disabled, using 387 arithmetics [-Werror] +cc1: all warnings being treated as errors + +Signed-Off-By: Nitin A Kamble +2012/04/13 + +Index: grub-1.99/configure.ac +=================================================================== +--- grub-1.99.orig/configure.ac ++++ grub-1.99/configure.ac +@@ -378,7 +378,7 @@ if test "x$target_cpu" = xi386; then + + # Some toolchains enable these features by default, but they need + # registers that aren't set up properly in GRUB. +- TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow" ++ TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387" + fi + + # By default, GCC 4.4 generates .eh_frame sections containing unwind diff --git a/meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch b/meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch new file mode 100644 index 0000000000..70f60015c2 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch @@ -0,0 +1,28 @@ +From f66d54b934710f54999debb72e8b7c620edece1d Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 25 May 2012 15:28:19 -0400 +Subject: [PATCH] gnulib accused in build breaking shocker. + +Upstream-Status: pending [Fedora will push this] + +--- + grub-core/gnulib/stdio.in.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/grub-core/gnulib/stdio.in.h b/grub-core/gnulib/stdio.in.h +index 80b9dbf..69932d9 100644 +--- a/grub-core/gnulib/stdio.in.h ++++ b/grub-core/gnulib/stdio.in.h +@@ -141,7 +141,9 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - " + so any use of gets warrants an unconditional warning. Assume it is + always declared, since it is required by C89. */ + #undef gets ++#if 0 + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++#endif + + #if @GNULIB_FOPEN@ + # if @REPLACE_FOPEN@ +-- +1.7.10.1 + diff --git a/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch b/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch new file mode 100644 index 0000000000..4588fca4ba --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch @@ -0,0 +1,131 @@ +Allow a compilation without -mcmodel=large + +It's provided by Vladimir Serbinenko, and he will commit +it upstream so it should be backport patch. + +Upstream-Status: Backport + +Signed-off-by: Jackie Huang + +-- +diff --git a/configure.ac b/configure.ac +index 9f8fb8a..2c5e6ed 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -723,9 +723,7 @@ if test "$target_cpu" = x86_64; then + [grub_cv_cc_mcmodel=yes], + [grub_cv_cc_mcmodel=no]) + ]) +- if test "x$grub_cv_cc_mcmodel" = xno; then +- AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.]) +- else ++ if test "x$grub_cv_cc_mcmodel" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" + fi + fi +diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c +index 1409b5d..6e9dace 100644 +--- a/grub-core/kern/efi/mm.c ++++ b/grub-core/kern/efi/mm.c +@@ -32,6 +32,12 @@ + #define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> 12) + #define PAGES_TO_BYTES(pages) ((pages) << 12) + ++#if defined (__code_model_large__) || !defined (__x86_64__) ++#define MAX_USABLE_ADDRESS 0xffffffff ++#else ++#define MAX_USABLE_ADDRESS 0x7fffffff ++#endif ++ + /* The size of a memory map obtained from the firmware. This must be + a multiplier of 4KB. */ + #define MEMORY_MAP_SIZE 0x3000 +@@ -58,7 +64,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, + + #if 1 + /* Limit the memory access to less than 4GB for 32-bit platforms. */ +- if (address > 0xffffffff) ++ if (address > MAX_USABLE_ADDRESS) + return 0; + #endif + +@@ -66,7 +72,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, + if (address == 0) + { + type = GRUB_EFI_ALLOCATE_MAX_ADDRESS; +- address = 0xffffffff; ++ address = MAX_USABLE_ADDRESS; + } + else + type = GRUB_EFI_ALLOCATE_ADDRESS; +@@ -86,7 +92,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, + { + /* Uggh, the address 0 was allocated... This is too annoying, + so reallocate another one. */ +- address = 0xffffffff; ++ address = MAX_USABLE_ADDRESS; + status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address); + grub_efi_free_pages (0, pages); + if (status != GRUB_EFI_SUCCESS) +@@ -319,7 +325,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, + { + if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY + #if 1 +- && desc->physical_start <= 0xffffffff ++ && desc->physical_start <= MAX_USABLE_ADDRESS + #endif + && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000 + && desc->num_pages != 0) +@@ -337,9 +343,9 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, + #if 1 + if (BYTES_TO_PAGES (filtered_desc->physical_start) + + filtered_desc->num_pages +- > BYTES_TO_PAGES (0x100000000LL)) ++ > BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL)) + filtered_desc->num_pages +- = (BYTES_TO_PAGES (0x100000000LL) ++ = (BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL) + - BYTES_TO_PAGES (filtered_desc->physical_start)); + #endif + +diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c +index 65f09ef..17c1215 100644 +--- a/grub-core/kern/x86_64/dl.c ++++ b/grub-core/kern/x86_64/dl.c +@@ -100,14 +100,32 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) + break; + + case R_X86_64_PC32: +- *addr32 += rel->r_addend + sym->st_value - +- (Elf64_Xword) seg->addr - rel->r_offset; ++ { ++ grub_int64_t value; ++ value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - ++ (Elf64_Xword) seg->addr - rel->r_offset; ++ if (value != (grub_int32_t) value) ++ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); ++ *addr32 = value; ++ } + break; + + case R_X86_64_32: ++ { ++ grub_uint64_t value = *addr32 + rel->r_addend + sym->st_value; ++ if (value != (grub_uint32_t) value) ++ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); ++ *addr32 = value; ++ } ++ break; + case R_X86_64_32S: +- *addr32 += rel->r_addend + sym->st_value; +- break; ++ { ++ grub_int64_t value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value; ++ if (value != (grub_int32_t) value) ++ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range"); ++ *addr32 = value; ++ } ++ break; + + default: + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, diff --git a/meta/recipes-bsp/grub/files/grub-no-unused-result.patch b/meta/recipes-bsp/grub/files/grub-no-unused-result.patch new file mode 100644 index 0000000000..4cbd0838d1 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-no-unused-result.patch @@ -0,0 +1,19 @@ +Signed-off-by: Radu Moisan +Upstream-Status: Pending + +I had an error because of an unused return value for read(). +I added -Wno-unused-result. + +Index: grub-2.00/configure.ac +=================================================================== +--- grub-2.00.orig/configure.ac 2012-08-13 16:32:33.000000000 +0300 ++++ grub-2.00/configure.ac 2012-08-13 16:38:22.000000000 +0300 +@@ -394,7 +394,7 @@ + LIBS="" + + # debug flags. +-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign" ++WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wno-unused-result -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign" + HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS" + TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations" + TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g" -- cgit v1.2.3-54-g00ecf