public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fixes for avr32 target
@ 2011-12-28 22:50 Martin Guy
  2011-12-29  0:16 ` Martin Guy
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Guy @ 2011-12-28 22:50 UTC (permalink / raw)
  To: crossgcc

Hi again
   This patch fixes the broken avr32 target in crosstool-ng. Mostly
that had to do with replacing the dead custom tarball at
dev.doredevelopments.dk (which entire site has dissapeared!) and
downloading the avr32-headers from Atmel directly, and adding .zip
extractor logic to handle it.

I'm a bit confused by the sample configs, which seem to have some
pattern to them but don't reflect the default ct-ng menuconfig values,
so here's the procedure I used 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
        Binary utilities ->
                binutils version = 2.18a
        C compiler
                gcc version = 4.2.2
        C-library
                newlib version = 1.17.0

CONFIG_SHELL is necessary to get round the "fragment: command not
found" bug when binutils-2.18 is configured using bash.

Apart from that, no other configs seem necessary. Yann, maybe you can
apply the above to whatever the template config is, in which case
martinwguy@gmail.com and martinwguy.co.uk are OK as reported-by
fields.

Cheers

    M

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fixes for avr32 target
  2011-12-28 22:50 [PATCH] Fixes for avr32 target Martin Guy
@ 2011-12-29  0:16 ` Martin Guy
  2011-12-31 18:17   ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Guy @ 2011-12-29  0:16 UTC (permalink / raw)
  To: crossgcc

[-- Attachment #1: Type: text/plain, Size: 55 bytes --]

I guess it would help if I attached the patch...

   M

[-- Attachment #2: crosstool-ng-fix-avr32.patch --]
[-- Type: text/x-patch, Size: 2951 bytes --]

diff -r 43a3cb39a786 scripts/build/libc/newlib.sh
--- a/scripts/build/libc/newlib.sh	Wed Dec 14 19:57:47 2011 +0100
+++ b/scripts/build/libc/newlib.sh	Wed Dec 28 23:37:38 2011 +0100
@@ -15,10 +15,11 @@
 
 do_libc_get() {
     local libc_src
-    local avr32headers_src
+    local avr32headers_src="http://www.atmel.com/dyn/resources/prod_documents"
+          avr32headers_base="avr32-headers-3.2.3.258"    # used below
+    local avr32headers_ext=".zip"
 
     libc_src="ftp://sources.redhat.com/pub/newlib"
-    avr32headers_src="http://dev.doredevelopment.dk/avr32-toolchain/sources"
 
     if [ -z "${CT_LIBC_NEWLIB_CVS}" ]; then
         CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src}
@@ -31,7 +32,7 @@
     fi
 
     if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
-        CT_GetFile "avr32headers" ${avr32headers_src}
+        CT_GetFile ${avr32headers_base} ${avr32_headers_ext} ${avr32headers_src}
     fi
 }
 
@@ -40,7 +41,9 @@
     CT_Patch "newlib" "$(libc_newlib_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
 }
 
@@ -137,7 +140,7 @@
     
     if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
         CT_DoLog EXTRA "Installing Atmel's AVR32 headers"
-        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/"
     fi
 
     CT_EndStep
diff -r 43a3cb39a786 scripts/functions
--- a/scripts/functions	Wed Dec 14 19:57:47 2011 +0100
+++ b/scripts/functions	Wed Dec 28 23:37:38 2011 +0100
@@ -410,6 +410,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
@@ -705,7 +706,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 <basename> [nochdir] [options]
+# Usage: CT_Extract [nochdir] <basename> [options]
 # where 'options' are dependent on the source (eg. git branch/tag...)
 CT_Extract() {
     local nochdir="$1"
@@ -770,6 +771,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}";;
         /.git)        CT_ExtractGit "${basename}" "${@}";;
         *)            CT_DoLog WARN "Don't know how to handle '${basename}${ext}': unknown extension"
                       return 1

[-- Attachment #3: Type: text/plain, Size: 71 bytes --]

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fixes for avr32 target
  2011-12-29  0:16 ` Martin Guy
@ 2011-12-31 18:17   ` Yann E. MORIN
  0 siblings, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2011-12-31 18:17 UTC (permalink / raw)
  To: crossgcc; +Cc: Martin Guy

Martin, All,

On Thursday 29 December 2011 01:15:48 Martin Guy wrote:
> I guess it would help if I attached the patch...

Also, could you add your SoB line, please?

Time permitting, I'll look at this tomorrow. Now is time for New Year's Eve!

Happy New Year to All!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-31 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-28 22:50 [PATCH] Fixes for avr32 target Martin Guy
2011-12-29  0:16 ` Martin Guy
2011-12-31 18:17   ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).