diff mbox

[avr] : Part2: Fix various problems with specs and specs file generation.

Message ID 5523CEDE.1060204@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay April 7, 2015, 12:34 p.m. UTC
Am 04/06/2015 um 11:54 AM schrieb Sivanupandi, Pitchumani:
> Hi Johann,
>
> Did you try running g++ tests?
> It seems xgcc is invoked to get multilibs (from gcc/testsuite/lib/g++.exp) which failed to find specs file.


This is because libgloss.exp:get_multilibs (used from g++_init) runs xgcc 
($compiler) without -B, i.e. without any prefix.  Without prefix there is no 
way to determine where the specs files are located.

Patching driver_self_specs to read a specs file by means of -specs= is, well, 
not very common.  I don't know any other target which does that.

As a work-around you can run the tests against the installed compiler.

Denis, what do you think?  I could add yet another fixme to avr backend like 
the following; that way there's no need to change dejagnu:


Johann

g

Comments

Denis Chertykov April 8, 2015, 8:28 a.m. UTC | #1
2015-04-07 15:34 GMT+03:00 Georg-Johann Lay <avr@gjlay.de>:
> Am 04/06/2015 um 11:54 AM schrieb Sivanupandi, Pitchumani:
>>
>> Hi Johann,
>>
>> Did you try running g++ tests?
>> It seems xgcc is invoked to get multilibs (from gcc/testsuite/lib/g++.exp)
>> which failed to find specs file.
>
>
>
> This is because libgloss.exp:get_multilibs (used from g++_init) runs xgcc
> ($compiler) without -B, i.e. without any prefix.  Without prefix there is no
> way to determine where the specs files are located.
>
> Patching driver_self_specs to read a specs file by means of -specs= is,
> well, not very common.  I don't know any other target which does that.
>
> As a work-around you can run the tests against the installed compiler.
>
> Denis, what do you think?  I could add yet another fixme to avr backend like
> the following; that way there's no need to change dejagnu:
>
>
> Johann
>
> Index: config/avr/driver-avr.c
> ===================================================================
> --- config/avr/driver-avr.c     (revision 221602)
> +++ config/avr/driver-avr.c     (working copy)
> @@ -80,6 +80,20 @@ avr_devicespecs_file (int argc, const ch
>        return X_NODEVLIB;
>
>      case 1:
> +      if (0 == strcmp ("device-specs", argv[0]))
> +        {
> +          /* FIXME:  This means "device-specs%s" from
> avr.h:DRIVER_SELF_SPECS
> +             has not been resolved to a path.  That case can occur when the
> +             c++ testsuite is run from the build directory.  DejaGNU's
> +             libgloss.exp:get_multilibs runs $compiler without -B, i.e.runs
> +             xgcc without specifying a prefix.  Without any prefix, there
> is
> +             no means to find out where the specs files might be located.
> +             get_multilibs runs xgcc --print-multi-lib, hence we don't
> +             actually need information form a specs file and may skip it
> +             altogether.  */
> +          return X_NODEVLIB;
> +        }
> +
>        mmcu = AVR_MMCU_DEFAULT;
>        break;
>

I'm weak  in dejagnu internals and c++ testsuite.
It looks like an acceptable solution.

Denis.
Georg-Johann Lay April 8, 2015, 11:25 a.m. UTC | #2
Am 04/08/2015 um 10:28 AM schrieb Denis Chertykov:
> 2015-04-07 15:34 GMT+03:00 Georg-Johann Lay <avr@gjlay.de>:
>> Am 04/06/2015 um 11:54 AM schrieb Sivanupandi, Pitchumani:
>>>
>>> Hi Johann,
>>>
>>> Did you try running g++ tests?
>>> It seems xgcc is invoked to get multilibs (from gcc/testsuite/lib/g++.exp)
>>> which failed to find specs file.
>>
>>
>>
>> This is because libgloss.exp:get_multilibs (used from g++_init) runs xgcc
>> ($compiler) without -B, i.e. without any prefix.  Without prefix there is no
>> way to determine where the specs files are located.
>>
>> Patching driver_self_specs to read a specs file by means of -specs= is,
>> well, not very common.  I don't know any other target which does that.
>>
>> As a work-around you can run the tests against the installed compiler.
>>
>> Denis, what do you think?  I could add yet another fixme to avr backend like
>> the following; that way there's no need to change dejagnu:
>>
>>
>> Johann
>>
>> Index: config/avr/driver-avr.c
>> ===================================================================
>> --- config/avr/driver-avr.c     (revision 221602)
>> +++ config/avr/driver-avr.c     (working copy)
>> @@ -80,6 +80,20 @@ avr_devicespecs_file (int argc, const ch
>>         return X_NODEVLIB;
>>
>>       case 1:
>> +      if (0 == strcmp ("device-specs", argv[0]))
>> +        {
>> +          /* FIXME:  This means "device-specs%s" from
>> avr.h:DRIVER_SELF_SPECS
>> +             has not been resolved to a path.  That case can occur when the
>> +             c++ testsuite is run from the build directory.  DejaGNU's
>> +             libgloss.exp:get_multilibs runs $compiler without -B, i.e.runs
>> +             xgcc without specifying a prefix.  Without any prefix, there
>> is
>> +             no means to find out where the specs files might be located.
>> +             get_multilibs runs xgcc --print-multi-lib, hence we don't
>> +             actually need information form a specs file and may skip it
>> +             altogether.  */
>> +          return X_NODEVLIB;
>> +        }
>> +
>>         mmcu = AVR_MMCU_DEFAULT;
>>         break;
>>
>
> I'm weak  in dejagnu internals and c++ testsuite.
> It looks like an acceptable solution.
>
> Denis.

Pitchumani, does that patch work for you?  If so I'd go ahead and apply it.

And what about the spaces problem as mentioned in

http://savannah.nongnu.org/bugs/?44574
http://lists.gnu.org/archive/html/avr-libc-dev/2015-03/msg00010.html

Art there plans to fix that?

Johann
Sivanupandi, Pitchumani April 9, 2015, 10:59 a.m. UTC | #3
> -----Original Message-----

> From: Georg-Johann Lay [mailto:avr@gjlay.de]

> Sent: Wednesday, April 08, 2015 4:56 PM

> To: Denis Chertykov

> Cc: Sivanupandi, Pitchumani; GCC Patches; Joerg Wunsch; Selvaraj,

> Senthil_Kumar

> Subject: Re: [patch,avr]: Part2: Fix various problems with specs and specs

> file generation.

> 

> Am 04/08/2015 um 10:28 AM schrieb Denis Chertykov:

> > 2015-04-07 15:34 GMT+03:00 Georg-Johann Lay <avr@gjlay.de>:

> >> Am 04/06/2015 um 11:54 AM schrieb Sivanupandi, Pitchumani:

> >>>

> >>> Hi Johann,

> >>>

> >>> Did you try running g++ tests?

> >>> It seems xgcc is invoked to get multilibs (from

> >>> gcc/testsuite/lib/g++.exp) which failed to find specs file.

> >>

> >>

> >>

> >> This is because libgloss.exp:get_multilibs (used from g++_init) runs

> >> xgcc

> >> ($compiler) without -B, i.e. without any prefix.  Without prefix

> >> there is no way to determine where the specs files are located.

> >>

> >> Patching driver_self_specs to read a specs file by means of -specs=

> >> is, well, not very common.  I don't know any other target which does

> that.

> >>

> >> As a work-around you can run the tests against the installed compiler.

> >>

> >> Denis, what do you think?  I could add yet another fixme to avr

> >> backend like the following; that way there's no need to change

> dejagnu:

> >>

> >>

> >> Johann

> >>

> >> Index: config/avr/driver-avr.c

> >>

> ===========================================================

> ========

> >> --- config/avr/driver-avr.c     (revision 221602)

> >> +++ config/avr/driver-avr.c     (working copy)

> >> @@ -80,6 +80,20 @@ avr_devicespecs_file (int argc, const ch

> >>         return X_NODEVLIB;

> >>

> >>       case 1:

> >> +      if (0 == strcmp ("device-specs", argv[0]))

> >> +        {

> >> +          /* FIXME:  This means "device-specs%s" from

> >> avr.h:DRIVER_SELF_SPECS

> >> +             has not been resolved to a path.  That case can occur when

> the

> >> +             c++ testsuite is run from the build directory.  DejaGNU's

> >> +             libgloss.exp:get_multilibs runs $compiler without -B, i.e.runs

> >> +             xgcc without specifying a prefix.  Without any prefix,

> >> + there

> >> is

> >> +             no means to find out where the specs files might be located.

> >> +             get_multilibs runs xgcc --print-multi-lib, hence we don't

> >> +             actually need information form a specs file and may skip it

> >> +             altogether.  */

> >> +          return X_NODEVLIB;

> >> +        }

> >> +

> >>         mmcu = AVR_MMCU_DEFAULT;

> >>         break;

> >>

> >

> > I'm weak  in dejagnu internals and c++ testsuite.

> > It looks like an acceptable solution.

> >

> > Denis.

> 

> Pitchumani, does that patch work for you?  If so I'd go ahead and apply

> it.


Yes. It works for me.
Thanks.

> And what about the spaces problem as mentioned in

> 

> http://savannah.nongnu.org/bugs/?44574

> http://lists.gnu.org/archive/html/avr-libc-dev/2015-03/msg00010.html

> 

> Art there plans to fix that?


Yes. Will submit patch to avr-libc by next week.

Regards,
Pitchumani
Georg-Johann Lay April 9, 2015, 11:23 a.m. UTC | #4
Am 04/09/2015 um 12:59 PM schrieb Sivanupandi, Pitchumani:
>> And what about the spaces problem as mentioned in
>>
>> http://savannah.nongnu.org/bugs/?44574
>> http://lists.gnu.org/archive/html/avr-libc-dev/2015-03/msg00010.html
>>
>> Art there plans to fix that?
>
> Yes. Will submit patch to avr-libc by next week.

Thanks.

> Regards,
> Pitchumani

If the device libs are moved, all the ~200 .dev/<device> directories will 
contain just 1 file each: crt1.o.  Is it much work to tidy that up?  (For 
example by renaming to, say, crt<device>.o and moving them to a common place or 
to their natural multilib location.)


Johann
Sivanupandi, Pitchumani April 9, 2015, 12:55 p.m. UTC | #5
> -----Original Message-----

> From: Georg-Johann Lay [mailto:avr@gjlay.de]

> Sent: Thursday, April 09, 2015 4:54 PM

> To: Sivanupandi, Pitchumani; Denis Chertykov

> Cc: GCC Patches; Joerg Wunsch; Selvaraj, Senthil_Kumar

> Subject: Re: [patch,avr]: Part2: Fix various problems with specs and specs

> file generation.

> 

> Am 04/09/2015 um 12:59 PM schrieb Sivanupandi, Pitchumani:

> >> And what about the spaces problem as mentioned in

> >>

> >> http://savannah.nongnu.org/bugs/?44574

> >> http://lists.gnu.org/archive/html/avr-libc-dev/2015-03/msg00010.html

> >>

> >> Art there plans to fix that?

> >

> > Yes. Will submit patch to avr-libc by next week.

> 

> Thanks.

> 

> > Regards,

> > Pitchumani

> 

> If the device libs are moved, all the ~200 .dev/<device> directories will

> contain just 1 file each: crt1.o.  Is it much work to tidy that up?  (For

> example by renaming to, say, crt<device>.o and moving them to a

> common place or to their natural multilib location.)


No, It is possible to do with the same patch.
I'll rename crt1.o to crt<device>.o and move it to multilib location.

Regards,
Pitchumani
Sivanupandi, Pitchumani April 15, 2015, 10:17 a.m. UTC | #6
> -----Original Message-----

> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-

> owner@gcc.gnu.org] On Behalf Of Sivanupandi, Pitchumani

> Sent: Thursday, April 09, 2015 6:26 PM

> To: Georg-Johann Lay; Denis Chertykov

> Cc: GCC Patches; Joerg Wunsch; Selvaraj, Senthil_Kumar

> Subject: RE: [patch,avr]: Part2: Fix various problems with specs and specs

> file generation.

...
> >

> > If the device libs are moved, all the ~200 .dev/<device> directories

> > will contain just 1 file each: crt1.o.  Is it much work to tidy that

> > up?  (For example by renaming to, say, crt<device>.o and moving

> them

> > to a common place or to their natural multilib location.)

> 

> No, It is possible to do with the same patch.

> I'll rename crt1.o to crt<device>.o and move it to multilib location.


Hi Johann,

This is done.
https://savannah.nongnu.org/bugs/?44574

Attached a patch for corresponding changes in gcc.

gcc/ChangeLog
* config/avr/avr-mcus.def: Change startup and device lib name
to crt<device>.o and lib<device>.a respectively.
* config/avr/avr.opt: Update device lib name.
* config/avr/gen-avr-mmcu-specs.c (print_mcu): Update start file name
and device lib name.

Regards,
Pitchumani
diff mbox

Patch

Index: config/avr/driver-avr.c
===================================================================
--- config/avr/driver-avr.c     (revision 221602)
+++ config/avr/driver-avr.c     (working copy)
@@ -80,6 +80,20 @@  avr_devicespecs_file (int argc, const ch
        return X_NODEVLIB;

      case 1:
+      if (0 == strcmp ("device-specs", argv[0]))
+        {
+          /* FIXME:  This means "device-specs%s" from avr.h:DRIVER_SELF_SPECS
+             has not been resolved to a path.  That case can occur when the
+             c++ testsuite is run from the build directory.  DejaGNU's
+             libgloss.exp:get_multilibs runs $compiler without -B, i.e.runs
+             xgcc without specifying a prefix.  Without any prefix, there is
+             no means to find out where the specs files might be located.
+             get_multilibs runs xgcc --print-multi-lib, hence we don't
+             actually need information form a specs file and may skip it
+             altogether.  */
+          return X_NODEVLIB;
+        }
+
        mmcu = AVR_MMCU_DEFAULT;
        break;