unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: "Thompson, David" <dthompson2@worcester.edu>
Cc: 24416@debbugs.gnu.org
Subject: bug#24416: avr-gcc@5 is broken
Date: Tue, 13 Sep 2016 11:18:22 +0200	[thread overview]
Message-ID: <20160913111822.3da1c609@scratchpost.org> (raw)
In-Reply-To: <CAJ=RwfbNiMfy7CCFT_qJDrT-Reci7DSXmBSODaT96ofGtwrMTg@mail.gmail.com>

On Mon, 12 Sep 2016 11:29:11 -0400
"Thompson, David" <dthompson2@worcester.edu> wrote:

> On Mon, Sep 12, 2016 at 2:49 AM, Danny Milosavljevic
> <dannym@scratchpost.org> wrote:
> > As a workaround,
> >
> > CPPFLAGS += -I${HOME}/.guix-profile/avr/include
> > LDFLAGS += -L${HOME}/.guix-profile/avr/lib/avr5 -L${HOME}/.guix-profile/avr/lib -B${HOME}/.guix-profile/avr/lib
> >
> > works with avr-gcc 5.3.0. Unfortunately I don't know enough about avr-gcc to be able to permanently fix it.
> >
> > I fixed part of it (I made it so that atmega32u4 exists in the first place) in master - but no idea what to do with the search path.
> >
> > I'm pretty sure that if it uses CROSS_CPATH it's incorrect because cross-base has been changed from CROSS_CPATH to CROSS_C_INCLUDE_PATH, CROSS_CPLUS_INCLUDE_PATH etc in order to suppress warnings. If CROSS_C_INCLUDE_PATH overrides CROSS_CPATH (does it?) then setting CROSS_CPATH like avr.scm does does no good.
> >
> > I propose to change it to the following:
> >
> > diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
> > index 9873477..1e5fd73 100644
> > --- a/gnu/packages/avr.scm
> > +++ b/gnu/packages/avr.scm
> > @@ -59,9 +59,18 @@
> >                   #t))))
> >           ((#:configure-flags flags)
> >            `(delete "--disable-multilib" ,flags))))
> > -      (native-search-paths
> > +      (native-search-paths
> >         (list (search-path-specification
> > -              (variable "CROSS_CPATH")
> > +              (variable "CROSS_C_INCLUDE_PATH")
> > +              (files '("avr/include")))
> > +             (search-path-specification
> > +              (variable "CROSS_CPLUS_INCLUDE_PATH")
> > +              (files '("avr/include")))
> > +             (search-path-specification
> > +              (variable "CROSS_OBJC_INCLUDE_PATH")
> > +              (files '("avr/include")))
> > +             (search-path-specification
> > +              (variable "CROSS_OBJCPLUS_INCLUDE_PATH")
> >                (files '("avr/include")))
> >               (search-path-specification
> >                (variable "CROSS_LIBRARY_PATH")  
> 
> I don't know if this will have the intended effect and I cannot
> experiment with it right now.  Could you test?  

(The patch: ) Can't test it right now (out of disk space; updating 2 GB texmf is really annoying) - but I tested it in the past and it wasn't sufficient. On the other hand, before the patch is applied, cross-gcc and avr.scm set *different* variables and that's probably incorrect.

> The LDFLAGS above
> include the path to the device-specific object files (/avr5), but
> avr-gcc is supposed to be able to figure that out on its own using a
> "normal" library path, so I'm skeptical that simply changing the
> search paths for the package is enough.

I've used these LDFLAGS (actually used them as global flags for all gcc invocations) for some weeks with daily success. Also, the "-B" is necessary.

I think that the "native-search-paths" only affect the build system.

As far as I understand, avr-gcc is a "native" compiler in the sense of it-shouldn't-try-to-build-all-Guix-packages-for-it. And it's certainly set up as a "native" compiler. But that means that the avr-gcc port has to hack the search path that gcc usually uses for native compilers to make it search something else - not sure where they do and why it doesn't work for us. It would be good to locate this part.

The atmega32u4 comes from avr-libc (!) - that's why I changed avr-libc to use the same compiler (already in master for some months). That made it work much better.

I hope someone can shed a light on this.

  reply	other threads:[~2016-09-13  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11 23:23 bug#24416: avr-gcc@5 is broken Thompson, David
2016-09-12  6:49 ` Danny Milosavljevic
2016-09-12 15:29   ` Thompson, David
2016-09-13  9:18     ` Danny Milosavljevic [this message]
2017-12-22 14:45 ` bug#24416: [PATCH] gnu: avr-gcc: Fix compiler lookup paths Danny Milosavljevic
2020-03-01  6:42   ` Arun Isaac
2020-03-01 12:25     ` Danny Milosavljevic
2020-05-13 19:28       ` Efraim Flashner

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20160913111822.3da1c609@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=24416@debbugs.gnu.org \
    --cc=dthompson2@worcester.edu \
    /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 public inbox

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

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).