From patchwork Sun Mar 31 14:07:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Guy X-Patchwork-Id: 232612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5E4F32C00D9 for ; Mon, 1 Apr 2013 01:08:09 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:date:message-id:subject:from:to :content-type; q=dns; s=default; b=FSAxLaF8Da0FDBXO4uyclomVuYNnI /QNyex+Xuc6EfQFG14qBUU9SibQPYm4kizBRaei2oekg78PBelm9fEOrp91hh3Yd 8b1qW9WwmAdoAWxCdcINeaQzUhMCPHHA2PVlwMVBmsHl9Z1e9ENcrNGJTyief7/o /wrsM9/4uB7qUs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:date:message-id:subject:from:to :content-type; s=default; bh=lhVRlfUCDipuXQO3sNwVyli/Grw=; b=alX +enfQij4EonpUjNM4Zhaz1a84JUMCsyc22WDdRuIlKUDmRwgoy58crAdzRxnyb0S w6sZ0dQaLXREwUP3Du60vHXEfThY9tPubPTwDwXq5DtxapjGIRua2mI/24Xdqwww h88SgeG61OushojcnnFbasl1UcQNNOLpL2Yppzgc= Received: (qmail 6765 invoked by alias); 31 Mar 2013 14:07:55 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org Received: (qmail 6726 invoked by uid 89); 31 Mar 2013 14:07:46 -0000 X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-bk0-f47.google.com (HELO mail-bk0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 31 Mar 2013 14:07:41 +0000 Received: by mail-bk0-f47.google.com with SMTP id ik5so643080bkc.34 for ; Sun, 31 Mar 2013 07:07:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.205.25.136 with SMTP id ri8mr3667996bkb.62.1364738858716; Sun, 31 Mar 2013 07:07:38 -0700 (PDT) Received: by 10.204.236.68 with HTTP; Sun, 31 Mar 2013 07:07:38 -0700 (PDT) Date: Sun, 31 Mar 2013 16:07:38 +0200 Message-ID: Subject: [PATCH] arch/avr32: Fix download of header files From: Martin Guy To: Crossgcc list X-Virus-Found: No Hi! This is a resend of my jan2012 patches to fix the broken avr32 build in crosstool-ng, adapted to the current mercurial trunk. Gmail normally line-wraps things, so it's both inline and attached. It doesn't conflict with the recent "linux xz" patch. ----8<----------- This patch fixes the download of the avr32 headers in crosstool-ng by fetching them directly from Atmel's web site instead of the now-broken URL given by the original author of the avr32-header-fetching modification, who fetched them from a copy on his own, now-defunct server. It also adds the necessary logic to extract from a zip file, as that is how the headers are packaged. To configure it for avr32 after launching ct-ng menuconfig in an empty directory: Paths and misc options -> Shell to use as CONFIG_SHELL = sh Target options -> Target Architecture = avr32 Toolchain options -> Tuple's alias = avr32 Binary utilities -> binutils version = 2.18a C compiler gcc version = 4.2.2 C-library newlib version = 1.17.0 Enable IOs on long long = yes Enable IOs on floats and doubles = yes Disable the syscalls supplied with newlib = yes CONFIG_SHELL is necessary to get round the "fragment: command not found" bug when binutils-2.18 is configured using bash. Prepared against crosstool-ng mercurial trunk on 31 March 2012. Signed-off-by: Martin Guy /.git) CT_ExtractGit "${basename}" "${@}";; *) CT_DoLog WARN "Don't know how to handle '${basename}${ext}': unknown extension" return 1 --- For unsubscribe information see http://sourceware.org/lists.html#faq diff -r 0fc56e62cecf scripts/build/libc/newlib.sh --- a/scripts/build/libc/newlib.sh Sat Mar 16 15:33:44 2013 +0100 +++ b/scripts/build/libc/newlib.sh Sun Mar 31 14:00:28 2013 +0200 @@ -6,11 +6,10 @@ # do_libc_get() { - local libc_src - local avr32headers_src - - libc_src="ftp://sourceware.org/pub/newlib" - avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources" + local libc_src="ftp://sourceware.org/pub/newlib" + local avr32headers_src="http://www.atmel.com/Images" + avr32headers_base="avr-headers-3.2.3.970" # used below + local avr32headers_ext=".zip" if [ "${CT_LIBC_NEWLIB_CUSTOM}" = "y" ]; then CT_GetCustom "newlib" "${CT_LIBC_VERSION}" \ @@ -20,7 +19,7 @@ fi # ! custom location if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then - CT_GetFile "avr32headers" ${avr32headers_src} + CT_GetFile ${avr32headers_base} ${avr32headers_ext} ${avr32headers_src} fi } @@ -35,7 +34,9 @@ CT_Patch "newlib" "${CT_LIBC_VERSION}" if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then - CT_Extract "avr32headers" + # The avr32header zip file extracts to avr32/*.h + # Put that in its directory, the same as normal tarballs + CT_Extract ${avr32headers_base} -d ${CT_SRC_DIR}/${avr32headers_base} fi } @@ -49,8 +50,8 @@ CT_DoLog EXTRA "Installing Atmel's AVR32 headers" CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/${CT_TARGET}/include" - CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/avr32headers" \ - "${CT_PREFIX_DIR}/${CT_TARGET}/include/avr32" + CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/${avr32headers_base}/avr32" \ + "${CT_PREFIX_DIR}/${CT_TARGET}/include/" CT_EndStep fi diff -r 0fc56e62cecf scripts/functions --- a/scripts/functions Sat Mar 16 15:33:44 2013 +0100 +++ b/scripts/functions Sun Mar 31 14:00:28 2013 +0200 @@ -523,6 +523,7 @@ printf ".tar.bz2\n" printf ".tar.gz\n.tgz\n" printf ".tar\n" + printf ".zip\n" } # Get the file name extension of a component @@ -861,7 +862,7 @@ # by the caller, that did a 'cd' into the correct path before calling us # and sets nochdir to 'nochdir'. # Note also that this function handles the git trees! -# Usage: CT_Extract [nochdir] [options] +# Usage: CT_Extract [nochdir] [options] # where 'options' are dependent on the source (eg. git branch/tag...) CT_Extract() { local nochdir="$1" @@ -926,6 +927,7 @@ .tar.bz2) bzip2 -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;; .tar.gz|.tgz) gzip -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;; .tar) CT_DoExecLog FILE tar "${tar_opts[@]}" -f "${full_file}";; + .zip) CT_DoExecLog FILE unzip "${@}" "${full_file}";;