From patchwork Mon Jan 7 12:34:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 209907 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F1B6A2C0097 for ; Mon, 7 Jan 2013 23:34:32 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1358166873; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=lJREX7g BypKLtptswHpDbiM71kU=; b=ooQSx6zvK530fScoEKtxQgNI9VJWMsWrOsgyDHv F514txfqmOjn4/FYAZuzpLq9wjbvk4WNUJs/c7OXjZRssHl7+qIACArw8c4hZ9Gm JLy7FwHA/1+TxDLuDDDKoBph6t0RElSimg4sL7EUm0143rz0+BtOjuei7i+SL+8K OskQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:X-RZG-AUTH:X-RZG-CLASS-ID:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=lZMQARGNPWeDb9gZ2OAY7/EJriJuuphNVwplwH5Dhc4mw5OB1HSYSAcMkSp0zv 8oPpkGWabdD9mFhtr4GzmYvdwSqSPrXYhJqwlBbD/5xyQc8L3LQ7QxPsoQ1JcO2s KTnpqhY2w5Bm098YCBRxyy8DUBOHVfp0haLfu571brir4=; Received: (qmail 22917 invoked by alias); 7 Jan 2013 12:34:25 -0000 Received: (qmail 22769 invoked by uid 22791); 7 Jan 2013 12:34:23 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Jan 2013 12:34:15 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (jorabe mo7) (RZmta 31.11 AUTH) with ESMTPA id 60597ep07CQKJD ; Mon, 7 Jan 2013 13:34:10 +0100 (CET) Message-ID: <50EAC0BB.3030101@gjlay.de> Date: Mon, 07 Jan 2013 13:34:03 +0100 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Denis Chertykov , Eric Weddington Subject: [Patch,avr] PR55243: Mistimed use of STAMP in Ada build X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch is a rewrite of t-avr so that STAMP is not needed. Ada triggers a mistimed re-build of targets using STAMP which causes PR55243 because the respective places in gnattools ada/gcc-interface don't set STAMP. With this patch, files that were formerly auto-generated must be generated by hand after avr-mcus.def is changed. Ok to apply? Johann PR55243 * config/avr/t-avr: Don't automatically rebuild $(srcdir)/config/avr/t-multilib $(srcdir)/config/avr/avr-tables.opt $(srcdir)/doc/avr-mmcu.texi (avr-mcus): New phony target to build them on request. (s-avr-mlib, s-avr-mmcu-texi): Remove. * avr/avr-mcus.def: Adjust comments. Index: config/avr/t-avr =================================================================== --- config/avr/t-avr (revision 194964) +++ config/avr/t-avr (working copy) @@ -40,48 +40,36 @@ avr.o avr-c.o: $(srcdir)/config/avr/buil AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def +# Run `avr-mcus' after you changed or added devices in avr-mcus.def + +.PHONY: avr-mcus + +avr-mcus: $(srcdir)/config/avr/t-multilib \ + $(srcdir)/config/avr/avr-tables.opt \ + $(srcdir)/doc/avr-mmcu.texi ; @true + +# Make sure that -mmcu= is supported for devices from avr-mcus.def and +# is displaed all -mmcu= values are displayed on the help screen $(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh $(AVR_MCUS) $(SHELL) $< $(AVR_MCUS) > $@ +# Make sure that -mmcu= support is in sync with -mmcu= documentation. gen-avr-mmcu-texi$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-texi.c \ $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.c \ $(srcdir)/config/avr/avr-arch.h $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@ -# Make sure that the -mmcu= documentation is in sync with the compiler. -$(srcdir)/doc/avr-mmcu.texi: s-avr-mmcu-texi; @true - -# invoke.texi @includes avr-mmcu.texi. Put this dependency here instead -# of in the global Makefile so that developers of other backends are not -# bothered with AVR stuff. -$(srcdir)/doc/invoke.texi: $(srcdir)/doc/avr-mmcu.texi - -# Ensure that device support is in sync with -mmcu= documentation. -s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) - $(RUN_GEN) ./$< > tmp-avr-mmcu.texi - $(SHELL) $(srcdir)/../move-if-change tmp-avr-mmcu.texi avr-mmcu.texi - @if cmp -s $(srcdir)/doc/avr-mmcu.texi avr-mmcu.texi; then \ - $(STAMP) $@; \ - else \ - echo >&2 ; \ - echo "***" >&2 ; \ - echo "*** Verify that you have permission to grant a" >&2 ; \ - echo "*** GFDL license for all new text in" >&2 ; \ - echo "*** avr-mmcu.texi, then copy it to $(srcdir)/doc/avr-mmcu.texi" >&2 ; \ - echo "***" >&2 ; \ - false; \ - fi +$(srcdir)/doc/avr-mmcu.texi: gen-avr-mmcu-texi$(build_exeext) + $(RUN_GEN) ./$< > $@ +# Map -mmcu= to the right multilib variant # MULTILIB_OPTIONS # MULTILIB_DIRNAMES # MULTILIB_EXCEPTIONS # MULTILIB_MATCHES -$(srcdir)/config/avr/t-multilib: s-avr-mlib; @true s-mlib: $(srcdir)/config/avr/t-multilib -s-avr-mlib: $(srcdir)/config/avr/genmultilib.awk $(AVR_MCUS) - $(AWK) -f $< -v FORMAT=Makefile $< $(AVR_MCUS) > tmp-avr-mlib - $(SHELL) $(srcdir)/../move-if-change \ - tmp-avr-mlib $(srcdir)/config/avr/t-multilib - $(STAMP) $@ +$(srcdir)/config/avr/t-multilib: $(srcdir)/config/avr/genmultilib.awk \ + $(AVR_MCUS) + $(AWK) -f $< -v FORMAT=Makefile $< $(AVR_MCUS) > $@ Index: config/avr/avr-mcus.def =================================================================== --- config/avr/avr-mcus.def (revision 194964) +++ config/avr/avr-mcus.def (working copy) @@ -18,19 +18,50 @@ along with GCC; see the file COPYING3. If not see . */ -/* List of all known AVR MCU types - if updated, it has to be kept - in sync in several places (FIXME: is there a better way?): - - here; - - gas/config/tc-avr.c; - - avr-libc. +/* List of all known AVR MCU types. If updated, cd to $(builddir)/gcc and run + + $ make avr-mcus + + This will regenerate / update the following source files: + + - $(srcdir)/config/avr/t-multilib + - $(srcdir)/config/avr/avr-tables.opt + - $(srcdir)/doc/avr-mmcu.texi + + After that, rebuild everything and check-in the new sources to the repo. + The device list below has to be kept in sync with the following places: + + - here + - gas/config/tc-avr.c + - avr-libc Before including this file, define a macro: - AVR_MCU (NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH, LIBRARY_NAME) + AVR_MCU (NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH, + LIBRARY_NAME) + + where the arguments are the fields of struct mcu_type_s: + + NAME Accept -mmcu= + + ARCH Specifies the multilib variant together with SHORT_SP + + MACRO If NULL, this is a core and not a device. If non-NULL, + supply respective built-in macro. + + SHORT_SP The device / multilib has an 8-bit stack pointer (no SPH). + + ERRATA_SKIP Apply work-around for the "skip 32-bit instruction" + silicon bug: Don't skip 32-bit instrctions. + + DATA_SEC First address of SRAM, used in -Tdata= by the driver. + + N_FLASH Number of 64 KiB flash segments, rounded up. - where the arguments are the fields of struct mcu_type_s. */ + LIBRARY_NAME Used by the driver to linke startup code from avr-libc + as of crt.o -/* "avr2" must be first for the "0" default to work as intended. */ + "avr2" must be first for the "0" default to work as intended. */ /* Classic, <= 8K. */ AVR_MCU ("avr2", ARCH_AVR2, NULL, 0, 1, 0x0060, 6, "s8515")