From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: avr-gcc Date: Tue, 17 Nov 2015 22:32:50 +0100 Message-ID: <87twoks459.fsf@gnu.org> References: <87wptgmyv1.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyns2-00055s-7z for guix-devel@gnu.org; Tue, 17 Nov 2015 16:32:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zynrx-0003Pz-Ep for guix-devel@gnu.org; Tue, 17 Nov 2015 16:32:58 -0500 In-Reply-To: <87wptgmyv1.fsf@elephly.net> (Ricardo Wurmus's message of "Tue, 17 Nov 2015 16:25:54 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ricardo Wurmus Cc: "guix-devel@gnu.org" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ricardo Wurmus skribis: > So, a problem with a linker script that cannot be found and a missing > avr-objcopy. I found them in the binutils-cross-avr output in the > store, but since there=E2=80=99s no separate package for this I installed= it > like this: > > guix package -i /gnu/store/5f7pp8r9wpwzsf61cf406xb1hkad2cdi-binutils-= cross-avr-2.25.1 If needed, you could add one such package to =E2=80=98cross-base.scm=E2=80= =99. Currently there are only full-blown cross-GCCs there, but if adding a cross-binutils is useful, go for it. > Microscheme 0.9.2, (C) Ryan Suchocki >>> Treeshaker: After 4 rounds: 87 globals purged! 22 bytes will be reserve= d. >>> 18 lines compiled OK >>> Assembling... > avr-ld: cannot find crtm328p.o: No such file or directory > avr-ld: cannot find -lm > avr-ld: cannot find -lc In GCC we modify the spec file so that the right -L/libc/dir/name is passed to ld; see (gnu packages gcc), =E2=80=98GNU_USER_TARGET_LIB_SPEC=E2= =80=99. However, =E2=80=98gcc-cross-sans-libc-avr=E2=80=99 is a bare-bones compiler= , so it doesn=E2=80=99t get the -L flag in question since there=E2=80=99s no libc t= o link to. To get a full-blow compiler that uses avr-libc, you could start from this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm index d59816b..8e9f172 100644 --- a/gnu/packages/avr.scm +++ b/gnu/packages/avr.scm @@ -53,6 +53,13 @@ for use with GCC on Atmel AVR microcontrollers.") (license (license:non-copyleft "http://www.nongnu.org/avr-libc/LICENSE.txt")))) +(define-public xgcc-avr-avrlibc + ;; AVR cross-compiler, used to build AVR-Libc. + (let ((triplet "avr-linux-avrlibc")) + (cross-gcc triplet + (cross-binutils triplet) + avr-libc))) + (define-public microscheme (package (name "microscheme") --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E2=80=A6 and then address any glibc assumptions you encounter. > There are multiple copies of =E2=80=9Clibm.a=E2=80=9D and =E2=80=9Clibc.a= =E2=80=9D and there=E2=80=99s a > =E2=80=9Ccrtm328p.o=E2=80=9D as well somewhere below the =E2=80=9Cavr/lib= /=E2=80=9D directory in the > output of the avr-libc package. Even after adding these paths to > LIBRARY_PATH, however, I cannot seem to fix the linker errors above. > Then I realised that LIBRARY_PATH only works for native compilers, and > that I would need to pass flags to the compiler (=E2=80=9C-L=E2=80=9D, ma= ybe?). Maybe microsheme should have avr-gcc and avr-libc as propagated inputs or something like that? HTH, Ludo=E2=80=99. --=-=-=--