Re: [OpenWrt-Devel] [PATCH] package/kexec-tools: fix build with gcc 4.6.x

2012-01-06 Thread Arnaud Lacombe
Hi,

On Mon, Dec 12, 2011 at 11:25 AM, Arnaud Lacombe lacom...@gmail.com wrote:
 This fixes the following build error:

 make[4]: Entering directory 
 `target-i386_gcc-4.6.1_binutils_2.21.1_uClibc-0.9.32/kexec-tools-2.0.2'
 mkdir -p purgatory
 i486-openwrt-linux-uclibc-gcc  --no-undefined -nostartfiles -nostdlib
    -nodefaultlibs -e purgatory_start -r -o purgatory/purgatory.ro \
    purgatory/purgatory.o purgatory/printf.o purgatory/string.o \
    purgatory/arch/i386/entry32-16.o purgatory/arch/i386/entry32-16-debug.o \
    purgatory/arch/i386/entry32.o purgatory/arch/i386/setup-x86.o \
    purgatory/arch/i386/stack.o purgatory/arch/i386/compat_x86_64.o \
    purgatory/arch/i386/purgatory-x86.o purgatory/arch/i386/console-x86.o \
    purgatory/arch/i386/vga.o purgatory/arch/i386/pic.o \
    purgatory/arch/i386/crashdump_backup.o purgatory/sha256.o \
 i486-openwrt-linux-uclibc-gcc: error: unrecognized option '--no-undefined'

 Original oatch from `kexec-tools' repository:

    commit 8880e5b8a295788dcae8f5cc038de92cd97b6807
    Author: Simon Horman ho...@verge.net.au
    Date:   Wed Mar 30 08:34:39 2011 +0900

        build: Pass --no-undefined as a linker option

        gcc-4.6 does not accept --no-undefined as a compiler option

        Reported-by: Civil civil.o...@gmail.com
        Acked-by: Eric W. Biederman ebied...@xmission.com
        Signed-off-by: Simon Horman ho...@verge.net.au

 Signed-off-by: Arnaud Lacombe lacom...@gmail.com
ping ?

Thanks,
 - Arnaud

 ---
  ...uild-Pass-no-undefined-as-a-linker-option.patch |   32 
 
  1 files changed, 32 insertions(+), 0 deletions(-)
  create mode 100644 
 package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch

 diff --git 
 a/package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch
  
 b/package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch
 new file mode 100644
 index 000..0384a03
 --- /dev/null
 +++ 
 b/package/kexec-tools/patches/0010-build-Pass-no-undefined-as-a-linker-option.patch
 @@ -0,0 +1,32 @@
 +From 8880e5b8a295788dcae8f5cc038de92cd97b6807 Mon Sep 17 00:00:00 2001
 +From: Simon Horman ho...@verge.net.au
 +Date: Wed, 30 Mar 2011 08:34:39 +0900
 +Subject: [PATCH] build: Pass --no-undefined as a linker option
 +
 +gcc-4.6 does not accept --no-undefined as a compiler option
 +
 +Reported-by: Civil civil.o...@gmail.com
 +Acked-by: Eric W. Biederman ebied...@xmission.com
 +Signed-off-by: Simon Horman ho...@verge.net.au
 +---
 + purgatory/Makefile |    4 ++--
 + 1 files changed, 2 insertions(+), 2 deletions(-)
 +
 +diff --git a/purgatory/Makefile b/purgatory/Makefile
 +index ea0c19a..ee1679c 100644
 +--- a/purgatory/Makefile
  b/purgatory/Makefile
 +@@ -56,8 +56,8 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
 +                       -I$(srcdir)/include \
 +                       -I$(shell $(CC) -print-file-name=include)
 + $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
 +-                      --no-undefined -nostartfiles -nostdlib -nodefaultlibs 
 \
 +-                      -e purgatory_start -r
 ++                      -Wl,--no-undefined -nostartfiles -nostdlib \
 ++                      -nodefaultlibs -e purgatory_start -r
 +
 + $(PURGATORY): $(PURGATORY_OBJS)
 +       $(MKDIR) -p $(@D)
 +--
 +1.7.8.rc3.51.g86536f
 +
 --
 1.7.6.153.g78432

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] package/grub: fix stage2 link with recent binutils

2012-01-06 Thread Arnaud Lacombe
Hi,

On Mon, Dec 12, 2011 at 11:26 AM, Arnaud Lacombe lacom...@gmail.com wrote:
 We want the `_start's symbols to be at the very beginning of the `stage2'
 binary's `.text' section. However, nothing enforces this requirement. With
 recent binutils (ie. post 2.19.1), this results in a corrupt binary, as ld(1)
 puts another symbol (eg. `journal_init') at the beginning of the section.

 Fix this by providing a stripped down version of the default linker script
 where we enforces the position of `_start' in the `.text' section.

 Signed-off-by: Arnaud Lacombe lacom...@gmail.com

ping ?

Thanks,
 - Arnaud

 ---
  .../grub/patches/030-add-stage2-ldscripts.patch    |   77 
 
  1 files changed, 77 insertions(+), 0 deletions(-)
  create mode 100644 package/grub/patches/030-add-stage2-ldscripts.patch

 diff --git a/package/grub/patches/030-add-stage2-ldscripts.patch 
 b/package/grub/patches/030-add-stage2-ldscripts.patch
 new file mode 100644
 index 000..aff7ed4
 --- /dev/null
 +++ b/package/grub/patches/030-add-stage2-ldscripts.patch
 @@ -0,0 +1,77 @@
 +From 8858927ddc6797489cad322fc2d2134aeae543cd Mon Sep 17 00:00:00 2001
 +From: Arnaud Lacombe lacom...@gmail.com
 +Date: Sun, 11 Dec 2011 16:44:02 -0500
 +Subject: [PATCH] add-stage2-ldscripts
 +
 +---
 + stage2/Makefile.am      |    2 +-
 + stage2/Makefile.in      |    2 +-
 + stage2/stage2.ldscripts |   30 ++
 + 3 files changed, 32 insertions(+), 2 deletions(-)
 + create mode 100644 stage2/stage2.ldscripts
 +
 +diff --git a/stage2/Makefile.am b/stage2/Makefile.am
 +index f8e6d42..ea28a4d 100644
 +--- a/stage2/Makefile.am
  b/stage2/Makefile.am
 +@@ -55,7 +55,7 @@ noinst_PROGRAMS = pre_stage2.exec start.exec 
 start_eltorito.exec \
 + endif
 + MOSTLYCLEANFILES = $(noinst_PROGRAMS)
 +
 +-PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8200
 ++PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Tstage2.ldscripts
 + START_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000
 + NBLOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,0
 + PXELOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
 +diff --git a/stage2/Makefile.in b/stage2/Makefile.in
 +index d0062bd..7bee2d5 100644
 +--- a/stage2/Makefile.in
  b/stage2/Makefile.in
 +@@ -468,7 +468,7 @@ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
 + @DISKLESS_SUPPORT_FALSE@noinst_DATA = pre_stage2 start start_eltorito
 + @DISKLESS_SUPPORT_TRUE@noinst_DATA = pre_stage2 start start_eltorito 
 nbloader pxeloader diskless
 + MOSTLYCLEANFILES = $(noinst_PROGRAMS)
 +-PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8200
 ++PRE_STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Tstage2.ldscripts
 + START_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000
 + NBLOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,0
 + PXELOADER_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
 +diff --git a/stage2/stage2.ldscripts b/stage2/stage2.ldscripts
 +new file mode 100644
 +index 000..2c8b8e1
 +--- /dev/null
  b/stage2/stage2.ldscripts
 +@@ -0,0 +1,30 @@
 ++/* Script for -N: mix text and data on same page; don't align data */
 ++OUTPUT_FORMAT(elf32-i386, elf32-i386,
 ++            elf32-i386)
 ++OUTPUT_ARCH(i386)
 ++ENTRY(_start)
 ++SECTIONS
 ++{
 ++  . = 0x8200;
 ++  .text           :
 ++  {
 ++    _start = .;
 ++    *(.text .text.* )
 ++  }
 ++  .rodata         : { *(.rodata .rodata.* ) }
 ++  /* Adjust the address for the data segment.  We want to adjust up to
 ++     the same address within the page on the next page up.  */
 ++  . = .;
 ++  .data           : { *(.data .data.* ) }
 ++  __bss_start = .;
 ++  .bss            :
 ++  {
 ++   *(.bss .bss.* )
 ++   *(COMMON)
 ++   . = ALIGN(. != 0 ? 32 / 8 : 1);
 ++  }
 ++  . = ALIGN(32 / 8);
 ++  . = ALIGN(32 / 8);
 ++  _end = .; PROVIDE (end = .);
 ++  .comment       0 : { *(.comment) }
 ++}
 +--
 +1.7.6.153.g78432
 +
 --
 1.7.6.153.g78432

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel