From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27124 invoked by alias); 26 Mar 2008 15:07:22 -0000 Received: (qmail 26993 invoked by uid 22791); 26 Mar 2008 15:07:21 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-103-wednesday.noc.nerim.net (HELO mallaury.nerim.net) (62.4.17.103) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Mar 2008 15:06:41 +0000 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by mallaury.nerim.net (Postfix) with ESMTP id 1AE074FD76; Wed, 26 Mar 2008 16:06:29 +0100 (CET) Received: from [192.168.0.1] (glinka.lesours [192.168.0.1]) by hector.lesours (Postfix) with ESMTP id 1908D20F0D1; Wed, 26 Mar 2008 16:04:23 +0100 (CET) Message-ID: <47EA668A.4060905@starynkevitch.net> Date: Wed, 26 Mar 2008 16:47:00 -0000 From: Basile STARYNKEVITCH User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080109) MIME-Version: 1.0 To: Tom Tromey CC: gcc-patches Subject: Re: Patch: automatic dependencies for gcc References: <47E89A0C.50607@gnu.org> <47E91C7E.8060506@gnu.org> <20080325202425.GD18200@ins.uni-bonn.de> <47E9687C.8000001@fgznet.ch> <84fc9c000803260601r44ed69ecn3eb0b690ad358ae@mail.gmail.com> <47EA57BB.7000509@starynkevitch.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2008-03/txt/msg01598.txt.bz2 Hello All, Tom Tromey wrote: >>>>>> "Basile" == Basile STARYNKEVITCH writes: > > Basile> MELT is able to generate C code and to tldl_dlopenext (almost like > Basile> dlopen-ing a dynamic library) the binary dynamically loadable stuff (a > Basile> *.so ELF shared object on Linux & Solaris...) obtained from the > Basile> generated code. Notice that this code generation and dynamic loading > Basile> may happen within cc1 (for some peculiar long-lasting passes and > Basile> compile flags). > > Ok. > > Are you plugging passes into a cross compiler? Yes, MELT is basically a [possibly generated] plugin stuff. The passes are at the GIMPLE level, so it could be a cross compiler. > > It seems to me that if you are only working with native compilers, > then it would be easy to just build these objects with the installed > gcc, and that would let you simplify the build stuff a bit. > > Basile> run-basilys.d: run-basilys.h \ > [...] > > Cute trick :-) > > Basile> Maybe using depcomp could help, but I don't know how. > > For depcomp, you must first discover "dependency mode" of the compiler > you plan to use. There's some configure code to do this. Then you > run it as a wrapper around the compiler, with some variable settings > to tell it what to do. > > If you're doing this stuff in the context of gcc/Makefile, you can > just use the infrastructure there. It will already know properties of > the compiler. > > If you're doing this at gcc-runtime, well... simplest would be to make > the user pick a compiler, preferably gcc; then just always use that > one and code its properties into whatever Makefile you use at runtime. The gcc/Makefile.in of the MELT branch generates a script melt_compile_script=$(libexecsubdir)/melt-cc-script (the $(libexecsubdir)/melt-cc-script path is its installed place) and this script compiles the generated code with the appropriate flags (mostly -fPIC -shared and -I....meltincludedir.... This script may be invoked by cc1 when a C file has been generated. This script is supposed to produce a dynamically loadable stuff (e.g. *.so shared object on ELF/Linux) which is then loaded by ltld_dlopenext. All this (the *.c generation, the script invocation to compile it into a *.so, the dlopen-ing of this *.so) happens in the same cc1 process. > > But, I'm not sure I fully understand what you're trying to do. I tried to explain it here, and with a little bit more details on the Wiki. Please tell me what is not clear enough. A big thanks for your comments. PS: I don't know if this discussion belongs better to the gcc@ list or to the gcc-patches@ list! -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***