diff mbox

[avr] Simplify genmultilib.awk

Message ID 5be5a85c-f0aa-1780-2ebb-57b88f9e1715@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay May 23, 2017, 7:55 a.m. UTC
On 22.05.2017 13:47, Denis Chertykov wrote:
> 2017-05-22 15:37 GMT+04:00 Georg-Johann Lay <avr@gjlay.de>:
>> This patch simplifies genmultilib.awk so that it generates
>> MULTILIB_REQUIRED instead of the complement, MULTILIB_EXCEPTIONS.
>>
>> The current awk script dates back to the days when we mapped
>> all the > 200 devices to the mmcu core and also parts of
>> --help=target to list all devices were generated from avr-mmcus.
>> That code rot is also cleaned up.  Moreover, the structure now allows
>> for simpler addition of new multilib options which are likely to come
>> in the near future.
>>
>> The result of -print-multi-lib is:
>>
>> .;
>> avr25;@mmcu=avr25
>> avr3;@mmcu=avr3
>> avr31;@mmcu=avr31
>> avr35;@mmcu=avr35
>> avr4;@mmcu=avr4
>> avr5;@mmcu=avr5
>> avr51;@mmcu=avr51
>> avr6;@mmcu=avr6
>> avrxmega2;@mmcu=avrxmega2
>> avrxmega4;@mmcu=avrxmega4
>> avrxmega5;@mmcu=avrxmega5
>> avrxmega6;@mmcu=avrxmega6
>> avrxmega7;@mmcu=avrxmega7
>> avrtiny;@mmcu=avrtiny
>> tiny-stack;@msp8
>> avr25/tiny-stack;@mmcu=avr25@msp8
>>
>> hence unchanged.
>>
>> Ok for trunk?
>>
>> Johann
>>
>>
>>         * config/avr/t-avr (AWK) [t-multilib]: Remove "-v FORMAT=Makefile"
>>         command option from $(AWK) call.
>>         * config/avr/genmultilib.awk: Simplify and rewrite so that it
>>         generates MULTILIB_REQUIRED instead of MULTILIB_EXCEPTIONS.
>>         [FORMAT]: Remove handling of variable.
>>         * config/avr/t-multilib: Regenerate.
>
> Approved.
> Please commit.

Also committed the following change to make it work with less common
awk implementations:

https://gcc.gnu.org/r248357

Johann
diff mbox

Patch

Index: config/avr/genmultilib.awk
===================================================================
--- config/avr/genmultilib.awk  (revision 248332)
+++ config/avr/genmultilib.awk  (working copy)
@@ -123,7 +123,7 @@  BEGIN {
         have[opts] = 1
         # Some special handling for the default mmcu: Remove a
         # leading "mmcu=avr2/" in order not to confuse genmultilib.
-       opts = gensub (/mmcu=avr2\//, "", 1, opts)
+       gsub (/^mmcu=avr2\//, "", opts)
         if (opts != "mmcu=avr2")
             m_required = m_required " \\\n\t" opts
      }