From patchwork Mon Aug 29 15:24:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexandre Lissy X-Patchwork-Id: 112090 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 12D7BB6F8E for ; Tue, 30 Aug 2011 01:24:35 +1000 (EST) Received: (qmail 5802 invoked by alias); 29 Aug 2011 15:24:30 -0000 Received: (qmail 5778 invoked by uid 22791); 29 Aug 2011 15:24:27 -0000 X-SWARE-Spam-Status: No, hits=1.0 required=5.0 tests=AWL, BAYES_50, KHOP_DYNAMIC, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC, TVD_RCVD_IP X-Spam-Check-By: sourceware.org Received: from 185.244.100.84.rev.sfr.net (HELO lissyx.dyndns.org) (84.100.244.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Aug 2011 15:24:10 +0000 Received: from [10.108.5.35] (unknown [193.52.208.233]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lissyx.dyndns.org (Postfix) with ESMTPSA id 6989559EA53; Mon, 29 Aug 2011 17:24:08 +0200 (CEST) Message-ID: <4E5BAF18.4070907@mandriva.com> Date: Mon, 29 Aug 2011 17:24:08 +0200 From: Alexandre Lissy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0a1) Gecko/20110828 Thunderbird/9.0a1 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: gcc-melt@googlegroups.com, Basile Starynkevitch Subject: Re: [PATCH] [MELT] Fix loading of .c files References: <1314613272-5900-1-git-send-email-alissy@mandriva.com> <20110829131506.GA22604@ours.starynkevitch.net> <4E5BA5C6.60300@mandriva.com> <4E5BA8C5.8000000@mandriva.com> <4E5BAB73.6040405@mandriva.com> <4E5BAEBD.8050005@mandriva.com> In-Reply-To: <4E5BAEBD.8050005@mandriva.com> OpenPGP: id=3D462771 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 Le 29/08/2011 17:22, Alexandre Lissy a écrit : > Le 29/08/2011 17:08, Alexandre Lissy a écrit : >> Le 29/08/2011 16:57, Alexandre Lissy a écrit : >>> Le 29/08/2011 16:44, Alexandre Lissy a écrit : >>>> Le 29/08/2011 15:15, Basile Starynkevitch a écrit : >>>>> On Mon, Aug 29, 2011 at 12:21:12PM +0200, Alexandre Lissy wrote: >>>>>> Files containing the MELT translated to C code were not loaded correctly >>>>>> due to bad search path when working with an installed plugin. Present >>>>>> commit fixes this by: >>>>>> - using a melt find to search in current dir >>>>>> - ensuring the melt_modulename in melt descriptor only contains the >>>>>> module name, and no path component >>>>> >>>>> Are you sure of that patch? It seems that it loops on the hello world tiny test I added in the MELT branch rev 178154 >>>>> >>>>> Does it work for you when merging with latest MELT updates (ie when applying that patch to rev 178154 of the MELT branch? >>>>> >>>>> (I am investigating) >>>>> >>>>> Cheers. >>>>> >>>> >>>> Okay, once fixing your Makefile it's okay: >>>> >>>> $ LC_ALL=C time -p gcc -c @melt-sayhello.args >>>> cc1: note: MELT is bootstrapping so ignore builtin source directory >>>> /usr/lib64/gcc/x86_64-mandriva-linux-gnu/4.6.1/plugin/melt-sources >>>> cc1: note: MELT is bootstrapping so ignore builtin module directory >>>> /usr/lib64/gcc/x86_64-mandriva-linux-gnu/4.6.1/plugin/melt-modules >>>> cc1: note: MELT generating C code of module melt-sayhello >>>> cc1: note: MELT generated same file melt-sayhello.c in >>>> /home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.8.99-plugin-for-gcc-4.6 >>>> cc1: note: MELT generated descriptor file melt-sayhello+meltdesc.c >>>> cc1: note: MELT generated C code of module melt-sayhello with 0 >>>> secondary files in 10 CPU millisec. >>>> real 0.06 >>>> user 0.02 >>>> sys 0.02 >>>> >>>> The bug was: -fplugin-arg-melt-arg=melt-modules. I suspect it's this >>>> line in melt-build.tpl: >>>> $(meltarg_arg)=$< -frandom-seed=$(shell md5sum melt-sayhello.melt | cut >>>> -b-24) \ >>>> >>>> The '$<' part ... But I have no idea of your intentions. >>>> >>> >>> I suspect '$<' should be replaced by 'melt-sayhello.melt' to get >>> -fplugin-arg-melt-arg=melt-sayhello.melt >>> >>> At least, it goes well doing this ... >>> >> >> I am currently trying the attached patch. > > A small change for dependencies. Better without the suffix ... diff --git a/gcc/melt-build.tpl b/gcc/melt-build.tpl index 10462a4..7525b9e 100644 --- a/gcc/melt-build.tpl +++ b/gcc/melt-build.tpl @@ -562,18 +562,22 @@ melt-modules/[+base+].quicklybuilt.so: melt-sources/[+base+].c \ ################ #@ [+ (. (tpl-file-line))+] -melt-tiny-tests: melt-modules melt-sources melt-all-modules melt-all-sources +melt-sayhello.melt: $(melt_default_modules_list).modlis + @date +'(code_chunk say%YM%mhello #{printf("hello_from_MELT on %c pid %%d\n", (int) getpid());}#)' > $@ +#@ [+ (. (tpl-file-line))+] + +#@ [+ (. (tpl-file-line))+] +melt-tiny-tests: melt-sayhello.melt melt-modules melt-sources melt-all-modules melt-all-sources # test that a helloworld can be translated - @date +'(code_chunk say%YM%mhello #{printf("hello_from_MELT on %c pid %%d\n", (int) getpid());}#)' > melt-sayhello.melt @echo $(MELTCCAPPLICATION1ARGS) \ - $(meltarg_arg)=$< -frandom-seed=$(shell md5sum melt-sayhello.melt | cut -b-24) \ + $(meltarg_arg)=$< -frandom-seed=$(shell md5sum $< | cut -b-24) \ $(meltarg_module_path)=$(realpath melt-modules) \ $(meltarg_source_path)=$(realpath melt-sources) \ - $(meltarg_workdir)=melt-workdir $(meltarg_inhibitautobuild) \ - $(meltarg_output)=melt-sayhello.c empty-file-for-melt.c > melt-sayhello.args-tmp - @mv melt-sayhello.args-tmp melt-sayhello.args - @echo -n melt-sayhello.args: ; cat melt-sayhello.args ; echo "***** doing " melt-sayhello - $(melt_make_cc1) @melt-sayhello.args + $(meltarg_workdir)=melt-workdir $(meltarg_inhibitautobuild) $(meltarg_bootstrapping) \ + $(meltarg_output)=$(basename $<) empty-file-for-melt.c > $(basename $<).args-tmp + @mv $(basename $<).args-tmp $(basename $<).args + @echo -n $(basename $<).args: ; cat $(basename $<).args ; echo "***** doing " $(basename $<) + $(melt_make_cc1) @$(basename $<).args #@ [+ (. (tpl-file-line))+]