guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: avr-gcc


From: Thompson, David
Subject: Re: avr-gcc
Date: Tue, 17 Nov 2015 22:53:31 -0500

On Tue, Nov 17, 2015 at 4:32 PM, Ludovic Courtès <address@hidden> wrote:
> Ricardo Wurmus <address@hidden> skribis:
>
>> Microscheme 0.9.2, (C) Ryan Suchocki
>>>> Treeshaker: After 4 rounds: 87 globals purged! 22 bytes will be reserved.
>>>> 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), ‘GNU_USER_TARGET_LIB_SPEC’.
>
> However, ‘gcc-cross-sans-libc-avr’ is a bare-bones compiler, so it
> doesn’t get the -L flag in question since there’s no libc to link to.
>
> To get a full-blow compiler that uses avr-libc, you could start from
> this:
>
>
>
> … 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=? 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=? "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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]