From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: avr-gcc Date: Tue, 17 Nov 2015 22:53:31 -0500 Message-ID: References: <87wptgmyv1.fsf@elephly.net> <87twoks459.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZytoL-00014a-El for guix-devel@gnu.org; Tue, 17 Nov 2015 22:53:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZytoK-0007SK-EA for guix-devel@gnu.org; Tue, 17 Nov 2015 22:53:33 -0500 Received: from mail-yk0-x22d.google.com ([2607:f8b0:4002:c07::22d]:33911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZytoK-0007Ru-91 for guix-devel@gnu.org; Tue, 17 Nov 2015 22:53:32 -0500 Received: by ykfs79 with SMTP id s79so44110768ykf.1 for ; Tue, 17 Nov 2015 19:53:31 -0800 (PST) In-Reply-To: <87twoks459.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: "guix-devel@gnu.org" On Tue, Nov 17, 2015 at 4:32 PM, Ludovic Court=C3=A8s wrote: > Ricardo Wurmus skribis: > >> Microscheme 0.9.2, (C) Ryan Suchocki >>>> Treeshaker: After 4 rounds: 87 globals purged! 22 bytes will be reserv= ed. >>>> 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 compil= er, so it > doesn=E2=80=99t get the -L flag in question since there=E2=80=99s no libc= to link to. > > To get a full-blow compiler that uses avr-libc, you could start from > this: > > > > =E2=80=A6 and then address any glibc assumptions you encounter. I tried to do this, but I don't really know what I'm doing. The first problem I encountered was that I needed to add a case to the 'glibc-dynamic-linker' procedure in (gnu packages bootstrap). I didn't know what ld was needed, if any, so I added this case: ((string=3D? system "avr-avrlibc") "no-ld.so") Then, the issue was that avr-libc doesn't have a propagated input with the label "linux-headers", as required by 'cross-gcc' in (gnu packages cross-base). So, as a hack I tried something like this: (if (string=3D? "avr-libc" (package-name libc)) `() `(("xlinux-headers" ;the target headers ,@(assoc-ref (package-propagated-inputs libc) "linux-headers")))) Now I was able to get the build process to start, but it failed when trying to compile binutils: checking target system type... Invalid configuration `avr-linux-avrlibc': system `avrlibc' not recognized I'm totally lost. Any thoughts on where to go next? BTW, I believe this native search path is needed in order for the AVR header files to be found: (search-path-specification (variable "C_INCLUDE_PATH") (files '("avr/include"))) Hopefully I'll be able to play with my Atmel microcontrollers again real soon. :) - Dave