Patchwork RFA: AVR: Support building AVR Linux targets

login
register
mail settings
Submitter Nick Clifton
Date Aug. 12, 2013, 12:07 p.m.
Message ID <871u5zqfi9.fsf@Cadeux.fritz.box>
Download mbox | patch
Permalink /patch/266511/
State New
Headers show

Comments

Nick Clifton - Aug. 12, 2013, 12:07 p.m.
Hi Dennis, Hi Anatoly, Hi Eric,

  I have run into a small problem building GCC for an AVR Linux target -
  glibc-c.o is not being built.  It turns out that the section handling
  "avr-*-*" in the config.gcc file is redefining tmake_file without
  allowing for the fact that t-glibc has already been added to it.

  The patch below is the obvious fix for this problem, but I have not
  committed it because it occurred to me that there might be some AVR
  specific reason for not including t-glibc.  So - is the patch OK, or
  is there some other way of fixing the problem ?

Cheers
  Nick

gcc/ChangeLog
2013-08-12  Nick Clifton  <nickc@redhat.com>

	* config.gcc (avr-*-*): Allow for tmake_file not being empty.
Denis Chertykov - Aug. 12, 2013, 12:28 p.m.
2013/8/12 Nick Clifton <nickc@redhat.com>:
> Hi Dennis, Hi Anatoly, Hi Eric,
>
>   I have run into a small problem building GCC for an AVR Linux target -
>   glibc-c.o is not being built.  It turns out that the section handling
>   "avr-*-*" in the config.gcc file is redefining tmake_file without
>   allowing for the fact that t-glibc has already been added to it.
>
>   The patch below is the obvious fix for this problem, but I have not
>   committed it because it occurred to me that there might be some AVR
>   specific reason for not including t-glibc.

I can't remember such reasons.

>  So - is the patch OK, or
>   is there some other way of fixing the problem ?
>
> Cheers
>   Nick
>
> gcc/ChangeLog
> 2013-08-12  Nick Clifton  <nickc@redhat.com>
>
>         * config.gcc (avr-*-*): Allow for tmake_file not being empty.
>
> Index: gcc/config.gcc

Please Apply.

Denis.
Joseph S. Myers - Aug. 22, 2013, 4:37 p.m.
On Mon, 12 Aug 2013, Nick Clifton wrote:

> Hi Dennis, Hi Anatoly, Hi Eric,
> 
>   I have run into a small problem building GCC for an AVR Linux target -
>   glibc-c.o is not being built.  It turns out that the section handling
>   "avr-*-*" in the config.gcc file is redefining tmake_file without
>   allowing for the fact that t-glibc has already been added to it.

Your patch itself makes sense on general principles, but the concept of an 
AVR Linux target doesn't - this is an 8-bit processor....  Really, the bug 
you've found is that there's an avr-*-* case that is too general, matching 
nonsensical targets such as AVR Linux rather than just avr-*-none / 
avr-*-elf.
Weddington, Eric - Aug. 22, 2013, 4:53 p.m.
> -----Original Message-----
> From: Joseph Myers [mailto:joseph@codesourcery.com]
> Sent: Thursday, August 22, 2013 10:37 AM
> To: Nick Clifton
> Cc: chertykov@gmail.com; aesok@post.ru; Weddington, Eric; gcc-
> patches@gcc.gnu.org
> Subject: Re: RFA: AVR: Support building AVR Linux targets
> 
> On Mon, 12 Aug 2013, Nick Clifton wrote:
> 
> > Hi Dennis, Hi Anatoly, Hi Eric,
> >
> >   I have run into a small problem building GCC for an AVR Linux
> target -
> >   glibc-c.o is not being built.  It turns out that the section
> handling
> >   "avr-*-*" in the config.gcc file is redefining tmake_file without
> >   allowing for the fact that t-glibc has already been added to it.
> 
> Your patch itself makes sense on general principles, but the concept of
> an
> AVR Linux target doesn't - this is an 8-bit processor....  Really, the
> bug
> you've found is that there's an avr-*-* case that is too general,
> matching
> nonsensical targets such as AVR Linux rather than just avr-*-none /
> avr-*-elf.

Thanks for pointing that out Joseph.

Strangely, someone actually has run Linux on an AVR:
http://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20on%208bit

But only by running it on an ARM emulator running on the AVR. 

Eric
Nick Clifton - Aug. 23, 2013, 7:30 a.m.
Hi Joseph,
> Your patch itself makes sense on general principles, but the concept of an
> AVR Linux target doesn't - this is an 8-bit processor....  Really, the bug
> you've found is that there's an avr-*-* case that is too general, matching
> nonsensical targets such as AVR Linux rather than just avr-*-none /
> avr-*-elf.

Fair enough.  Would you like me to

   A. Apply the patch anyway.  On the general principle that target 
specific sections in config.gcc add to tmake_file rather than override it.

   B. Do nothing.  On the general principle that if it ain't broke don't 
fix it.

   C. Draw up another patch that restricts the AVR patterns in 
config.gcc to -none and -elf.


Cheers
   Nick
Joseph S. Myers - Aug. 23, 2013, 10:09 p.m.
On Fri, 23 Aug 2013, nick clifton wrote:

> Hi Joseph,
> > Your patch itself makes sense on general principles, but the concept of an
> > AVR Linux target doesn't - this is an 8-bit processor....  Really, the bug
> > you've found is that there's an avr-*-* case that is too general, matching
> > nonsensical targets such as AVR Linux rather than just avr-*-none /
> > avr-*-elf.
> 
> Fair enough.  Would you like me to
> 
>   A. Apply the patch anyway.  On the general principle that target specific
> sections in config.gcc add to tmake_file rather than override it.
> 
>   B. Do nothing.  On the general principle that if it ain't broke don't fix
> it.
> 
>   C. Draw up another patch that restricts the AVR patterns in config.gcc to
> -none and -elf.

A and C - I think both changes should be applied.

Patch

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 201658)
+++ gcc/config.gcc	(working copy)
@@ -1001,7 +1001,7 @@ 
 	    tm_file="${tm_file} ${cpu_type}/avrlibc.h"
 	    tm_defines="${tm_defines} WITH_AVRLIBC"
 	fi
-	tmake_file="avr/t-avr avr/t-multilib"
+	tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
 	use_gcc_stdint=wrap
 	extra_gcc_objs="driver-avr.o avr-devices.o"
 	extra_objs="avr-devices.o avr-log.o"