public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Denis Chertykov <chertykov@gmail.com>
To: Georg-Johann Lay <avr@gjlay.de>
Cc: Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
		Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>,
		Joern Rennecke <joern.rennecke@embecosm.com>
Subject: Re: [patch,avr]: Part2: Fix various problems with specs and specs file generation.
Date: Mon, 09 Mar 2015 20:00:00 -0000	[thread overview]
Message-ID: <CADOs=zZE2xQ9Vbw5JafW+6Ro69AZ3vv5v3sOFRt5ePFOcSvCcQ@mail.gmail.com> (raw)
In-Reply-To: <54FDC417.1000008@gjlay.de>

2015-03-09 19:02 GMT+03:00 Georg-Johann Lay <avr@gjlay.de>:
> Am 03/03/2015 um 02:21 PM schrieb Senthil Kumar Selvaraj:
>>
>> On Mon, Mar 02, 2015 at 08:40:17PM +0100, Georg-Johann Lay wrote:
>>>
>>> The new specs file generation introduces several problems.  This patch
>>>
>>> - Fix build warnings
>>>
>>> - Clean up unused code and the old, now dead specs definitions.
>>>
>>> - Removes unused files and adjust build scripts / rules.
>>>
>>> - Issues with avr-libc awareness:
>>>
>>> -- Makes specs-generation aware of avr-libc (include tm.h in build script
>>> and depend on WITH_AVRLIBC).
>>>
>>> -- avr-libc implements functions in libm.a which usually live in libgcc,
>>> hence add -lm to libgcc_spec, cf. PR54461.
>>>
>>> -- The new libdev.a is a feature of avr-libc and not available with,
>>> e.g.,
>>> newlib.  Hence remove it from lib_spec if the compiler is not configured
>>> for
>>> avr-libc (--with-avrlibc=no).
>>>
>>> - Many minor issues with option propagation.
>>>
>>> - -march had been added to multilib generation some time ago, but
>>> driver_self_spec was not aware of that option.
>>>
>>>
>>> Ok for trunk?
>>>
>>>
>>> BTW, anyone knows what -march= is good for?  It allows all kinds of silly
>>> option combinations like "-march=avrtiny -mmcu=atmega8" without any
>>> complaints.
>>
>>
>> IIRC, -march was added because replacing -mmcu=<device> to
>> -mmcu=<arch> in the driver's self specs broke multilib selection - the
>> driver always acted as if no -mmcu was specified. Adding
>
>
> For me both multilib selection and multilib generation are working as
> expected with -mmcu= and without that -march=.
>
> Attached is a 2nd part of improvements for the specs file generation:
>
> - Remove -arch= and use -mmcu= again.
>
> - Wrap specs file selection into a new specs function so that a
> comprehensible error message can be issued if no specs file is found.  It
> also informs about a link to spec file documentation of gcc inline docs.
>
> - Remove genopt.sh and avr-tables.opt.  These files are no more used because
> -mmcu= is a vanilla string option now.  Using Enum option for -mmcu= does
> not allow to specify unknown devices, and target_handle_option cannot
> letgigimize unknown strings of Enum options.
>
> - Resurrect driver-avr.c but with new content: The new specs function.
>
> - New file specs.h with specs known to gcc and which can be overridden by
> avrlibc.h, rtems.h, etc.
>
> - New device-specs files mostly repeat spec definitions, e.g.
>
>     fprintf (f, "*startfile:\n\t%s\n\n", STARTFILE_SPEC);
>     fprintf (f, "*endfile:\n\t%s\n\n", ENDFILE_SPEC);
>
> - Device feature are expressed as subspecs now, e.g. avrlibc_startfile spec.
>
> - Clean up code from "current device" stuff, adjust diagnostics, avr-arch.h,
> etc.
>
> - Use INSTALL_DATA to install spec files, not INSTALL_PROGRAM.
>
>
>
> Ok to install this, too?
>
>
> Johann
>
>         PR target/65296
>         * config.gcc (extra_options) [avr]: Remove.
>         (extra_gcc_objs) [avr]: Use driver-avr.o, avr-devices.o.
>         (tm_file) [avr]: Add avr/specs.h after avr/avr.h.
>         (tm_defines) [avr, rtems]: Add WITH_RTEMS.
>
>         * config/avr/genmultilib.awk: Use -mmcu= instead of -march=.
>         * config/avr/t-multilib: Regenerate.
>         * config/avr/specs.h: New file.
>         * config/avr/driver-avr.c: New file.
>         * config/avr/genopt.sh: Remove file.
>         * config/avr/avr-tables.opt: Remove file.
>         * config/avr/predicates.md (avr_current_arch): Rename to avr_arch.
>         * config/avr/avr-c.c: Same.
>         * avr-arch.h: Same.
>         (avr_current_device): Remove proto.
>         * config/avr/avr.c (avr_current_arch): Rename to avr_arch.
>         (avr_current_device): Remove definition and usage.
>         (avr_set_core_architecture): New static function.
>         (avr_option_override): Use it.
>         * config/avr/avr.h (avr_current_arch): Rename to avr_arch.
>         (AVR_HAVE_8BIT_SP): Don't depend on avr_current_device.
>         (EXTRA_SPEC_FUNCTIONS): Define.
>         (avr_devicespecs_file): New specs function proto.
>         (DRIVER_SELF_SPECS): Use device-specs-file spec function.
>         * config/avr/avr-devices.c (diagnostic.h, avr-arch.h): Include them.
>         (mcu_name): New static array.
>         (comparator, avr_archs_str, avr_mcus_str): New static functions.
>         (avr_inform_devices, avr_inform_core_architectures): New functions.
>         * config/avr/gen-avr-mmcu-specs.c (avr-arch.h, specs.h): Include.
>         (avrlibc.h) [WITH_AVRLIBC]: Include.
>         (../rtems.h, rtems.h) [WITH_RTEMS]: Include.
>         (print_mcu): Rewrite from scratch.
>         * config/avr/avrlibc.h (LIB_SPEC, LIBGCC_SPEC, STARTFILE_SPEC):
>         Forward to avr-specific specs defined in device-specs file.
>         * config/avr/avr.opt (config/avr/avr-arch.h): Remove include.
>         (-mmcu=): Add Var and MissingArgError properties.
>         (-march=): Remove.
>         * config/avr/t-avr (driver-avr.o): New rule.
>         (avr-devices.o): Depend on avr-arch.h.
>         (avr-mcus): No more depend on avr-tables.opt.
>         (avr-tables.opt): Remove rule.
>         (install-device-specs): Use INSTALL_DATA, not INSTALL_PROGRAM.
>

Please, apply.

Denis.

  reply	other threads:[~2015-03-09 20:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 19:40 [patch,avr]: " Georg-Johann Lay
2015-03-03  7:46 ` Denis Chertykov
2015-03-03 13:20 ` Senthil Kumar Selvaraj
2015-03-09 16:03   ` [patch,avr]: Part2: " Georg-Johann Lay
2015-03-09 20:00     ` Denis Chertykov [this message]
2015-03-10 15:02       ` [patch,avr]: Part3 and 4: " Georg-Johann Lay
2015-03-11 18:18         ` Denis Chertykov
2015-03-16 18:18           ` [patch,avr]: Part5: " Georg-Johann Lay
2015-03-17  6:37             ` Denis Chertykov
2015-04-06  9:54     ` [patch,avr]: Part2: " Sivanupandi, Pitchumani
2015-04-07 12:34       ` Georg-Johann Lay
2015-04-08  8:28         ` Denis Chertykov
2015-04-08 11:25           ` Georg-Johann Lay
2015-04-09 10:59             ` Sivanupandi, Pitchumani
2015-04-09 11:23               ` Georg-Johann Lay
2015-04-09 12:55                 ` Sivanupandi, Pitchumani
2015-04-15 10:17                   ` Sivanupandi, Pitchumani
2015-04-17 14:03                     ` [patch,avr,installed] ad PR65296: Adjust specs to new avr-libc layout as of #44574 Georg-Johann Lay
2015-04-17 14:43                       ` Denis Chertykov
2015-04-17 15:32                         ` Georg-Johann Lay
2015-04-17 16:46                           ` Denis Chertykov
2015-04-09 11:44               ` [patch,avr,committed]: ad PR65296: work around device-specs file + dejagnu for c++ Georg-Johann Lay
2015-03-09 16:21   ` [patch,avr]: Fix various problems with specs and specs file generation Georg-Johann Lay

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

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

  git send-email \
    --in-reply-to='CADOs=zZE2xQ9Vbw5JafW+6Ro69AZ3vv5v3sOFRt5ePFOcSvCcQ@mail.gmail.com' \
    --to=chertykov@gmail.com \
    --cc=avr@gjlay.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joerg_wunsch@uriah.heep.sax.de \
    --cc=joern.rennecke@embecosm.com \
    --cc=senthil_kumar.selvaraj@atmel.com \
    /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.
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).