From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67101 invoked by alias); 9 Mar 2015 20:00:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 67092 invoked by uid 89); 9 Mar 2015 20:00:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.0 required=5.0 tests=AWL,BAYES_99,BAYES_999,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-yk0-f174.google.com Received: from mail-yk0-f174.google.com (HELO mail-yk0-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 09 Mar 2015 20:00:20 +0000 Received: by ykr79 with SMTP id 79so6843523ykr.13 for ; Mon, 09 Mar 2015 13:00:18 -0700 (PDT) X-Received: by 10.170.90.70 with SMTP id h67mr32166829yka.46.1425931218753; Mon, 09 Mar 2015 13:00:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.170.86.132 with HTTP; Mon, 9 Mar 2015 12:59:58 -0700 (PDT) In-Reply-To: <54FDC417.1000008@gjlay.de> References: <54F4BCA1.7080707@gjlay.de> <20150303132144.GC24277@atmel.com> <54FDC417.1000008@gjlay.de> From: Denis Chertykov Date: Mon, 09 Mar 2015 20:00:00 -0000 Message-ID: Subject: Re: [patch,avr]: Part2: Fix various problems with specs and specs file generation. To: Georg-Johann Lay Cc: Senthil Kumar Selvaraj , GCC Patches , Joerg Wunsch , Joern Rennecke Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-03/txt/msg00498.txt.bz2 2015-03-09 19:02 GMT+03:00 Georg-Johann Lay : > 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= to >> -mmcu= 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.