all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: guix-devel@gnu.org
Subject: [PATCH] gnu: avr: Use the correct gcc version as native-input. This makes crtatmega32u4.o etc appear in the output.
Date: Mon, 15 Aug 2016 12:45:28 +0200	[thread overview]
Message-ID: <20160815104528.31090-1-dannym@scratchpost.org> (raw)
In-Reply-To: <CAJ=RwfaYxu07=GW7hB3Yis-OtjzObfJsF3nCib4jpHTy5-KH2w@mail.gmail.com>

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


See also <http://svn.savannah.nongnu.org/viewvc?view=rev&root=avr-libc&revision=2475>, <http://svn.savannah.nongnu.org/viewvc/trunk/avr-libc/libc/misc/Rules.am?root=avr-libc&r1=2475&r2=2474&pathrev=2475>.

The easy fix would have been to pass "--enable-device-lib" to libc's configure.
The right fix: use the right gcc as native input.

* gnu/packages/avr.scm (avr-libc): Replace package by function.
* gnu/packages/avr.scm (avr-toolchain): Use new avr-libc function.
---
 gnu/packages/avr.scm | 37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-avr-Use-the-correct-gcc-version-as-native-input..patch --]
[-- Type: text/x-patch; name="0001-gnu-avr-Use-the-correct-gcc-version-as-native-input..patch", Size: 2620 bytes --]

diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index 9873477..fd18ff6 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -73,7 +73,7 @@
     (version (package-version gcc-5))
     (source (package-source gcc-5))))
 
-(define-public avr-libc
+(define (avr-libc avr-gcc)
   (package
     (name "avr-libc")
     (version "2.0.0")
@@ -99,7 +99,7 @@
              (unsetenv "C_INCLUDE_PATH")
              #t)))))
     (native-inputs `(("avr-binutils" ,avr-binutils)
-                     ("avr-gcc" ,avr-gcc-4.9)))
+                     ("avr-gcc" ,avr-gcc)))
     (home-page "http://www.nongnu.org/avr-libc/")
     (synopsis "The AVR C Library")
     (description
@@ -109,24 +109,27 @@ for use with GCC on Atmel AVR microcontrollers.")
      (license:non-copyleft "http://www.nongnu.org/avr-libc/LICENSE.txt"))))
 
 (define (avr-toolchain avr-gcc)
-  (package
-    (name "avr-toolchain")
-    (version (package-version avr-gcc))
-    (source #f)
-    (build-system trivial-build-system)
-    (arguments '(#:builder (mkdir %output)))
-    (propagated-inputs
-     `(("avrdude" ,avrdude)
-       ("binutils" ,avr-binutils)
-       ("gcc" ,avr-gcc)
-       ("libc" ,avr-libc)))
-    (synopsis "Complete GCC tool chain for AVR microcontroller development")
-    (description "This package provides a complete GCC tool chain for AVR
+  ;; avr-libc checks the compiler version and passes "--enable-device-lib" for avr-gcc > 5.1.0.
+  ;; It wouldn't install the library for atmega32u4 etc if we didn't use the corret avr-gcc.
+  (let ((avr-libc (avr-libc avr-gcc)))
+    (package
+      (name "avr-toolchain")
+      (version (package-version avr-gcc))
+      (source #f)
+      (build-system trivial-build-system)
+      (arguments '(#:builder (mkdir %output)))
+      (propagated-inputs
+       `(("avrdude" ,avrdude)
+         ("binutils" ,avr-binutils)
+         ("gcc" ,avr-gcc)
+         ("libc" ,avr-libc)))
+      (synopsis "Complete GCC tool chain for AVR microcontroller development")
+      (description "This package provides a complete GCC tool chain for AVR
 microcontroller development.  This includes the GCC AVR cross compiler and
 avrdude for firmware flashing.  The supported programming languages are C and
 C++.")
-    (home-page (package-home-page avr-libc))
-    (license (package-license avr-gcc))))
+      (home-page (package-home-page avr-libc))
+      (license (package-license avr-gcc)))))
 
 (define-public avr-toolchain-4.9 (avr-toolchain avr-gcc-4.9))
 (define-public avr-toolchain-5 (avr-toolchain avr-gcc-5))

  reply	other threads:[~2016-08-15 10:45 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 13:16 [PATCH 0/6] Fix AVR toolchain David Thompson
2016-04-14 13:17 ` [PATCH 1/5] gnu: Add avr-binutils David Thompson
2016-04-14 17:04   ` Ludovic Courtès
2016-04-14 18:32     ` Manolis Ragkousis
2016-04-19 14:55       ` Ludovic Courtès
2016-05-30 17:38         ` Thompson, David
2016-04-14 13:17 ` [PATCH 2/5] gnu: Add avr-gcc David Thompson
2016-04-14 13:53   ` Manolis Ragkousis
2016-04-14 13:55     ` Thompson, David
2016-04-14 17:06     ` Ludovic Courtès
2016-04-14 17:25   ` Ludovic Courtès
2016-05-30 17:44     ` Thompson, David
2016-06-01 21:21       ` Ludovic Courtès
2016-08-09 19:22         ` Danny Milosavljevic
2016-08-09 19:55           ` Ricardo Wurmus
2016-08-10  7:15             ` Danny Milosavljevic
2016-08-10  7:21               ` Danny Milosavljevic
2016-08-10  7:52               ` Ricardo Wurmus
2016-08-10 13:14                 ` Thompson, David
2016-08-15 10:45                   ` Danny Milosavljevic [this message]
2016-08-15 11:34                     ` [PATCH] gnu: avr: Use the correct gcc version as native-input. This makes crtatmega32u4.o etc appear in the output Thompson, David
2016-08-15 18:48                       ` Leo Famulari
2016-08-15 11:59                   ` [PATCH 2/5] gnu: Add avr-gcc Danny Milosavljevic
2016-08-15 13:07                     ` Thompson, David
2016-08-15 13:24                       ` Danny Milosavljevic
2016-08-10 11:57             ` Vincent Legoll
2016-08-10 12:56               ` Ricardo Wurmus
2016-04-14 13:17 ` [PATCH 3/5] gnu: avr-libc: Fix build David Thompson
2016-04-14 14:02   ` Manolis Ragkousis
2016-04-14 17:26   ` Ludovic Courtès
2016-04-14 17:57     ` Thompson, David
2016-04-15 21:12       ` Ludovic Courtès
2016-05-30 17:40         ` Thompson, David
2016-04-14 13:17 ` [PATCH 4/5] gnu: Add avr-toolchain David Thompson
2016-04-14 17:33   ` Ludovic Courtès
2016-05-30 17:36     ` Thompson, David
2016-04-14 13:17 ` [PATCH 5/5] gnu: Remove xgcc-avr David Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160815104528.31090-1-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.