From patchwork Sun Jan 20 21:55:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Dawson X-Patchwork-Id: 213993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id A0EBD2C0040 for ; Mon, 21 Jan 2013 08:57:02 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7307C101B75; Sun, 20 Jan 2013 21:56:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3cgfZSqN8wrR; Sun, 20 Jan 2013 21:56:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 70433101B65; Sun, 20 Jan 2013 21:56:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F20068F74B for ; Sun, 20 Jan 2013 21:56:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 37F388BDEE for ; Sun, 20 Jan 2013 21:56:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LZaKgCAgM-cs for ; Sun, 20 Jan 2013 21:56:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by whitealder.osuosl.org (Postfix) with ESMTPS id 748368BC35 for ; Sun, 20 Jan 2013 21:56:49 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id dq11so351002wgb.26 for ; Sun, 20 Jan 2013 13:56:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer; bh=Vajl4sDQPF8zgOS0HAROKOTtMLfvyS87n4cvFMhiLGc=; b=g8Afxw/zBaCGPpmLak4satMjPALFcoi3JvLm/5ryICmcpHJiF/fy7pgQm7l0f6pUoE 4Xy3aLuutV0klpUPm0UGSyQtyFZDxyKl1XCC6UFuNsKDHbWvGZ5qRar25DSzPC1HsfY2 MPxSYgG5aQ3XDTs0m1jukloShiGETHCFaZqpILjZ33EqU6oQrq+rA3kSeGI7dvwel0Yx zdwxkKZIlVuk7T+onL+UIsbteN1YPqSe3iQ77NfzAZBhE3QJJFa11yWbVVeGJH9N9e30 lJQgpIOF8lrUe6D+JrYqwLJ6BCDGi34OB05bEvxYwyKM+90eOzS63zleI0OXx3NGd9V8 L4wA== X-Received: by 10.180.99.165 with SMTP id er5mr17304186wib.1.1358719007736; Sun, 20 Jan 2013 13:56:47 -0800 (PST) Received: from localhost.localdomain (host-2-100-181-2.as13285.net. [2.100.181.2]) by mx.google.com with ESMTPS id dm3sm14159069wib.9.2013.01.20.13.56.46 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Jan 2013 13:56:46 -0800 (PST) From: spdawson@gmail.com To: buildroot@busybox.net Date: Sun, 20 Jan 2013 21:55:41 +0000 Message-Id: <1358718941-25383-1-git-send-email-spdawson@gmail.com> X-Mailer: git-send-email 1.7.10.4 Subject: [Buildroot] [PATCH] avr32: support uClibc 0.9.33.2 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Simon Dawson Add a uClibc patch from OpenWRT, and tweak an existing patch to cope with the lack of a dup3 Linux syscall on avr32. This allow uClibc 0.9.33.2 to be built for avr32. Signed-off-by: Simon Dawson --- toolchain/toolchain-buildroot/Config.in.2 | 3 ++- toolchain/uClibc/Config.in | 3 +-- .../uClibc-0.9.33.2-OpenWRT-140-avr32_atomic_fix.patch | 14 ++++++++++++++ toolchain/uClibc/uClibc-0.9.33.2-dup3.patch | 4 +++- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 toolchain/uClibc/uClibc-0.9.33.2-OpenWRT-140-avr32_atomic_fix.patch diff --git a/toolchain/toolchain-buildroot/Config.in.2 b/toolchain/toolchain-buildroot/Config.in.2 index d27c9f3..a713727 100644 --- a/toolchain/toolchain-buildroot/Config.in.2 +++ b/toolchain/toolchain-buildroot/Config.in.2 @@ -68,7 +68,7 @@ config BR2_TOOLCHAIN_BUILDROOT_USE_SSP choice prompt "Thread library implementation" - default BR2_PTHREADS_NATIVE if (!BR2_UCLIBC_VERSION_0_9_31) && !BR2_ARM_OABI && !BR2_xtensa + default BR2_PTHREADS_NATIVE if (!BR2_UCLIBC_VERSION_0_9_31) && !BR2_ARM_OABI && !(BR2_avr32 || BR2_xtensa) default BR2_PTHREADS_OLD help Use this option to select the thread library implementation @@ -95,6 +95,7 @@ choice depends on !BR2_UCLIBC_VERSION_0_9_31 depends on !BR2_ARM_OABI depends on !BR2_x86_i386 + depends on !BR2_avr32 depends on !BR2_xtensa endchoice diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in index e47bc9b..a48b6a0 100644 --- a/toolchain/uClibc/Config.in +++ b/toolchain/uClibc/Config.in @@ -5,7 +5,6 @@ comment "uClibc Options" choice prompt "uClibc C library Version" - default BR2_UCLIBC_VERSION_0_9_31 if BR2_avr32 # 0.9.32 broken default BR2_UCLIBC_VERSION_0_9_33 help Select the version of uClibc you wish to use. @@ -20,7 +19,7 @@ choice config BR2_UCLIBC_VERSION_0_9_33 bool "uClibc 0.9.33.x" - depends on !(BR2_avr32 || BR2_xtensa) + depends on !BR2_xtensa config BR2_UCLIBC_VERSION_SNAPSHOT bool "daily snapshot" diff --git a/toolchain/uClibc/uClibc-0.9.33.2-OpenWRT-140-avr32_atomic_fix.patch b/toolchain/uClibc/uClibc-0.9.33.2-OpenWRT-140-avr32_atomic_fix.patch new file mode 100644 index 0000000..5edc31e --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.33.2-OpenWRT-140-avr32_atomic_fix.patch @@ -0,0 +1,14 @@ +Patch from OpenWRT for avr32. + +Signed-off-by: Simon Dawson + +--- a/libc/sysdeps/linux/avr32/bits/atomic.h ++++ b/libc/sysdeps/linux/avr32/bits/atomic.h +@@ -28,6 +28,7 @@ typedef uintmax_t uatomic_max_t; + + #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + ({ \ ++ __uint32_t __result; \ + __typeof__(*(mem)) __prev; \ + __asm__ __volatile__( \ + "/* __arch_compare_and_exchange_val_32_acq */\n" \ diff --git a/toolchain/uClibc/uClibc-0.9.33.2-dup3.patch b/toolchain/uClibc/uClibc-0.9.33.2-dup3.patch index 66b419e..87fe2a6 100644 --- a/toolchain/uClibc/uClibc-0.9.33.2-dup3.patch +++ b/toolchain/uClibc/uClibc-0.9.33.2-dup3.patch @@ -29,7 +29,7 @@ new file mode 100644 index 0000000..5fdab2e --- /dev/null +++ b/libc/sysdeps/linux/common/dup3.c -@@ -0,0 +1,15 @@ +@@ -0,0 +1,17 @@ +/* vi: set sw=4 ts=4: */ +/* + * dup3() for uClibc @@ -43,8 +43,10 @@ index 0000000..5fdab2e +#include + + ++#ifdef __NR_dup3 +_syscall3(int, dup3, int, oldfd, int, newfd, int, flags) +libc_hidden_def(dup3) ++#endif -- 1.7.5.4