Pull request 20130407
v2 cover Pull request 20130407
Hello,
Quoted 12 lines · Apelete Seketeli
Following the patches I sent to the meta-handheld layer a few days ago to add machine support for the Ben Nanonote, I found out that the corresponding kernel recipe fails to build on oe-core (builds fine on oe-classic).
A few settings were missing and, more importantly, the version of gcc in oe-core seems to enable the -Wunused-but-set-variable switch, which makes it error on many variables that were indeed 'unused but set'. After trying to solve this issue the easy way, by setting 'CFLAGS=-Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter' to no avail, I chose to annotate the aforementioned variables in the kernel code with __attribute__((__unused__)).
Quoted 2 lines
The patches that come as a follow-up of this message are what it's all about; sorry for the inconvenience in the first place.
I took the time to fix the patch for the GCC 4.6 build issue. Instead of just fixing the issue on my own, I looked at how it was done in the mainline kernel and backported the fixes through a new patch named fix-gcc-4.6.0-build-errors.patch; this approach seems more logical to me.
While I was at it, also removed "[PATCH 2/2] ben-nanonote: add DEFAULTTUNE to machine configuration" from the patchset, following Paul's advice.
Tested by building linux-jlime-ben-nanonote from scratch on top of master branch.
Please pull into meta-handheld.
The following changes since commit 913735dce388f660dfbbe288ed736e12ed48c8d8:
linux-yocto-tiny-kexecboot_3.2: removed unused, non-working MTD-RW patch (2013-04-06 00:25:08 +0100)
are available in the git repository at:
git://seketeli.fr/~apelete/meta-handheld.git fix-nn-kernel-build
Apelete Seketeli (1):
linux-jlime-ben-nanonote: fix GCC-4.6 build errors
.../fix-gcc-4.6.0-build-errors.patch | 114 ++++++++++++++++++++ .../linux/linux-jlime-ben-nanonote_2.6.36.bb | 5 +- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/linux-jlime-ben-nanonote-2.6.36/fix-gcc-4.6.0-build-errors.patch
Signature · 1 line
1.7.10.4
PATCH v2 1/1 linux-jlime-ben-nanonote: fix GCC-4.6 build errors
The following changes fix build errors occuring on linux kernel 2.6.36 for the ben-nanonote machine:
- add LIC_FILES_CHKSUM,
- add "fix-gcc-4.6.0-build-errors.patch" patch file to fix an issue where gcc errors on 'unused but set variables' in kernel code. Issue fixed as in upstream mainline kernel in changesets #f1b6a505, #c726b822, #7a6e4ca1, #91b51f30, #71271aab and #d3ce0e98.
--- .../fix-gcc-4.6.0-build-errors.patch | 114 ++++++++++++++++++++ .../linux/linux-jlime-ben-nanonote_2.6.36.bb | 5 +- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/linux-jlime-ben-nanonote-2.6.36/fix-gcc-4.6.0-build-errors.patch
recipes-kernel/linux/linux-jlime-ben-nanonote-2.6.36/fix-gcc-4.6.0-build-errors.patch new file +114 -0
@@ -0,0 +1,114 @@ +diff --git a/arch/mips/jz4740/dma.c b/arch/mips/jz4740/dma.c +index 5ebe75a..d7feb89 100644 +--- a/arch/mips/jz4740/dma.c ++++ b/arch/mips/jz4740/dma.c +@@ -242,9 +242,7 @@ EXPORT_SYMBOL_GPL(jz4740_dma_get_residue); + + static void jz4740_dma_chan_irq(struct jz4740_dma_chan *dma) + { +- uint32_t status; +- +- status = jz4740_dma_read(JZ_REG_DMA_STATUS_CTRL(dma->id)); ++ (void) jz4740_dma_read(JZ_REG_DMA_STATUS_CTRL(dma->id)); + + jz4740_dma_write_mask(JZ_REG_DMA_STATUS_CTRL(dma->id), 0, + JZ_DMA_STATUS_CTRL_ENABLE | JZ_DMA_STATUS_CTRL_TRANSFER_DONE); +diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c +index 5922342..dbbe0ce 100644 +--- a/arch/mips/kernel/signal.c ++++ b/arch/mips/kernel/signal.c +@@ -84,7 +84,7 @@ static int protected_save_fp_context(struct sigcontext __user *sc) + + static int protected_restore_fp_context(struct sigcontext __user *sc) + { +- int err, tmp; ++ int err, tmp __maybe_unused; + while (1) { + lock_fpu_owner(); + own_fpu_inatomic(0); +diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c +index a0ed0e0..aae9866 100644 +--- a/arch/mips/kernel/signal32.c ++++ b/arch/mips/kernel/signal32.c +@@ -115,7 +115,7 @@ static int protected_save_fp_context32(struct sigcontext32 __user *sc) + + static int protected_restore_fp_context32(struct sigcontext32 __user *sc) + { +- int err, tmp; ++ int err, tmp __maybe_unused; + while (1) { + lock_fpu_owner(); + own_fpu_inatomic(0); +diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c +index 1dc6edf..18cd6f9 100644 +--- a/arch/mips/kernel/syscall.c ++++ b/arch/mips/kernel/syscall.c +@@ -383,12 +383,11 @@ save_static_function(sys_sysmips); + static int __used noinline + _sys_sysmips(nabi_no_regargs struct pt_regs regs) + { +- long cmd, arg1, arg2, arg3; ++ long cmd, arg1, arg2; + + cmd = regs.regs[4]; + arg1 = regs.regs[5]; + arg2 = regs.regs[6]; +- arg3 = regs.regs[7]; + + switch (cmd) { + case MIPS_ATOMIC_SET: +diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h +index 1a846c5..9f867cd 100644 +--- a/arch/mips/math-emu/ieee754int.h ++++ b/arch/mips/math-emu/ieee754int.h +@@ -71,7 +71,7 @@ + + + #define COMPXSP \ +- unsigned xm; int xe; int xs; int xc ++ unsigned xm; int xe; int xs __maybe_unused; int xc + + #define COMPYSP \ + unsigned ym; int ye; int ys; int yc +@@ -105,7 +105,7 @@ + + + #define COMPXDP \ +-u64 xm; int xe; int xs; int xc ++u64 xm; int xe; int xs __maybe_unused; int xc + + #define COMPYDP \ + u64 ym; int ye; int ys; int yc +diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c +index 6721ee2..8b24bcd 100644 +--- a/arch/mips/mm/c-r4k.c ++++ b/arch/mips/mm/c-r4k.c +@@ -1076,7 +1076,6 @@ static int __cpuinit probe_scache(void) + unsigned long flags, addr, begin, end, pow2; + unsigned int config = read_c0_config(); + struct cpuinfo_mips *c = ¤t_cpu_data; +- int tmp; + + if (config & CONF_SC) + return 0; +@@ -1109,7 +1108,6 @@ static int __cpuinit probe_scache(void) + + /* Now search for the wrap around point. */ + pow2 = (128 * 1024); +- tmp = 0; + for (addr = begin + (128 * 1024); addr < end; addr = begin + pow2) { + cache_op(Index_Load_Tag_SD, addr); + __asm__ __volatile__("nop; nop; nop; nop;"); /* hazard... */ +diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c +index 2efcbd2..279599e 100644 +--- a/arch/mips/mm/init.c ++++ b/arch/mips/mm/init.c +@@ -324,7 +324,7 @@ int page_is_ram(unsigned long pagenr) + void __init paging_init(void) + { + unsigned long max_zone_pfns[MAX_NR_ZONES]; +- unsigned long lastpfn; ++ unsigned long lastpfn __maybe_unused; + + pagetable_init(); +
recipes-kernel/linux/linux-jlime-ben-nanonote_2.6.36.bb +4 -1
@@ -1,6 +1,7 @@ DESCRIPTION = "Linux 2.6.36 kernel for the Ben Nanonote" SECTION = "kernel" LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" DEPENDS += "u-boot-mkimage-native"
@@ -15,7 +16,9 @@ SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.gi file://logo_linux_clut224.tar.gz \ file://modifier-keys.patch \ file://config-ben-nanonote \ - file://jz4740-udc.patch" + file://jz4740-udc.patch \ + file://fix-gcc-4.6.0-build-errors.patch \ + " S = "${WORKDIR}/git"
Signature · 1 line
1.7.10.4