GNU bug report logs -
#24416
avr-gcc@5 is broken
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24416 in the body.
You can then email your comments to 24416 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#24416
; Package
guix
.
(Sun, 11 Sep 2016 23:25:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Thompson, David" <dthompson2 <at> worcester.edu>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Sun, 11 Sep 2016 23:25:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
avr-gcc cannot find device-specific libraries when compiling, which
from my reading is due to a problem with multilib. However, avr-gcc <at> 4
works fine!
avr-gcc -O2 -DF_CPU=16000000UL -mmcu=atmega32u4 test.c -o test
avr-ld: cannot find -lm
avr-ld: cannot find -lc
avr-ld: cannot find -latmega32u4
collect2: error: ld returned 1 exit status
The libraries in question here are located within
/gnu/store/...-avr-libc-2.0.0/avr/lib/avr5 but avr-gcc is only
searching within /avr/lib.
For now, I'm just using avr-gcc <at> 4 and moving on with life.
- Dave
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24416
; Package
guix
.
(Mon, 12 Sep 2016 06:50:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 24416 <at> debbugs.gnu.org (full text, mbox):
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")
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24416
; Package
guix
.
(Mon, 12 Sep 2016 15:30:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 24416 <at> debbugs.gnu.org (full text, mbox):
On Mon, Sep 12, 2016 at 2:49 AM, Danny Milosavljevic
<dannym <at> 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 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.
Thanks,
- Dave
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24416
; Package
guix
.
(Tue, 13 Sep 2016 09:19:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 24416 <at> debbugs.gnu.org (full text, mbox):
On Mon, 12 Sep 2016 11:29:11 -0400
"Thompson, David" <dthompson2 <at> worcester.edu> wrote:
> On Mon, Sep 12, 2016 at 2:49 AM, Danny Milosavljevic
> <dannym <at> 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.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24416
; Package
guix
.
(Fri, 22 Dec 2017 14:46:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 24416 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/avr.scm (avr-gcc-4.9): Use CROSS_C*_INCLUDE_PATH (like
cross-base does).
(avr-gcc-5)[source]: Apply patch "gcc-cross-environment-variables.patch".
---
gnu/packages/avr.scm | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index ecb7cd19a..60bcbe754 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -61,7 +61,16 @@
`(delete "--disable-multilib" ,flags))))
(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")
@@ -71,7 +80,10 @@
(package
(inherit avr-gcc-4.9)
(version (package-version gcc-5))
- (source (package-source gcc-5))))
+ (source (origin
+ (inherit (package-source gcc-5))
+ (patches (append (origin-patches (package-source gcc-5))
+ (search-patches "gcc-cross-environment-variables.patch")))))))
(define (avr-libc avr-gcc)
(package
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24416
; Package
guix
.
(Sun, 01 Mar 2020 06:43:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 24416 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> * gnu/packages/avr.scm (avr-gcc-4.9): Use CROSS_C*_INCLUDE_PATH (like
> cross-base does).
> (avr-gcc-5)[source]: Apply patch "gcc-cross-environment-variables.patch".
Hi,
I verified that this patch works[1]. Could you please push to master?
Thanks! :-)
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24416
; Package
guix
.
(Sun, 01 Mar 2020 12:26:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 24416 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Arun,
pushed to guix master as commit 2f3515f7369d91d8922620044f9348cc727b6c10.
[Message part 2 (application/pgp-signature, inline)]
Reply sent
to
Efraim Flashner <efraim <at> flashner.co.il>
:
You have taken responsibility.
(Wed, 13 May 2020 19:29:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
"Thompson, David" <dthompson2 <at> worcester.edu>
:
bug acknowledged by developer.
(Wed, 13 May 2020 19:29:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 24416-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Closing this bug as fixed.
--
Efraim Flashner <efraim <at> flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 11 Jun 2020 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 10 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.