From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13112 invoked by alias); 26 Mar 2008 14:04:20 -0000 Received: (qmail 13102 invoked by uid 22791); 26 Mar 2008 14:04:19 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-103-wednesday.nerim.net (HELO kraid.nerim.net) (62.4.16.103) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Mar 2008 14:03:30 +0000 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by kraid.nerim.net (Postfix) with ESMTP id 3DD95CF19F; Wed, 26 Mar 2008 15:03:27 +0100 (CET) Received: from [192.168.0.1] (glinka.lesours [192.168.0.1]) by hector.lesours (Postfix) with ESMTP id 9A86A20F15E; Wed, 26 Mar 2008 15:01:12 +0100 (CET) Message-ID: <47EA57BB.7000509@starynkevitch.net> Date: Wed, 26 Mar 2008 15:05:00 -0000 From: Basile STARYNKEVITCH User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080109) MIME-Version: 1.0 To: Tom Tromey , 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> 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/msg01592.txt.bz2 Tom Tromey wrote: >>>>>> "Richard" == Richard Guenther writes: > > Richard> It seems that changes in builtins.def or builtin-types.def do > Richard> not cause re-builds of their dependencies. > > A while back I was thinking, "I wish I got more response to my patches". > I'm kind of regretting that now. Back to the subject of automatic dependencies for GCC my MELT branch http://gcc.gnu.org/wiki/MiddleEndLispTranslator has similar needs. See http://gcc.gnu.org/ml/gcc/2008-03/msg00839.html http://gcc.gnu.org/ml/gcc/2008-03/msg00810.html http://gcc.gnu.org/ml/gcc/2008-03/msg00668.html http://gcc.gnu.org/ml/gcc/2008-03/msg00549.html http://gcc.gnu.org/ml/gcc/2008-03/msg00524.html http://gcc.gnu.org/ml/gcc/2008-03/msg00152.html http://gcc.gnu.org/ml/gcc/2008-02/msg00682.html http://gcc.gnu.org/ml/gcc/2008-02/msg00632.html http://gcc.gnu.org/ml/gcc/2008-02/msg00419.html and other messages in the referenced threads MELT is able to generate C code and to tldl_dlopenext (almost like dlopen-ing a dynamic library) the binary dynamically loadable stuff (a *.so ELF shared object on Linux & Solaris...) obtained from the generated code. Notice that this code generation and dynamic loading may happen within cc1 (for some peculiar long-lasting passes and compile flags). Each such generated C code needs include files internal to GCC. They are all wrapped in one particular include gcc/run-basilys.h which is the only #include in such generated C code. So I need to copy all the files needed by this gcc/run-basilys.h in a suitable place. At the moment I have the following (near the end of) my gcc/Makefile.in (in MELT branch): ######################### # we want to generate all the direct (non system) dependencies of #run-basilys.h # the following should work if $(CC) is some recent version of GCC #(probably >= 4.x) # we first generate the make-dependencies using -MMD # this should write into run-basilys.d some stuff like ## run-basilys-deps: srcdir.../gcc/run-basilys.h config.h auto-host.h .... # with the srcdir... replaced by the source directory # however, there are also config/ files in the dependency list # config/ files should be handled specially since they are the only #include-d files # which are not flat, ie in a subdirectory, like srcdir.../gcc/config/i386/x86-64.h # there is also a dependency on tm.h (in objdir) which contains stuff like #include "config/i386/x86-64.h" run-basilys.d: run-basilys.h \ $(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) $(TM_H) $(TREE_H) $(GGC_H) \ tree-pass.h basilys.h gt-basilys.h ## perhaps this should really use depcomp, because this works only if ## CC is some gcc 4.x since it use the precompiled headers feature $(CC) -MT run-basilys-deps -MMD -MF $@ $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< -o run-basilys.h.gch .PHONY: run-basilys-deps ## the include below defines the dependencies of run-basilys-deps ## included file run-basilys.d is generated above -include run-basilys.d ## copy all the file in the dependency of run-basilys-deps into #$(melt_build_include_dir) ## but handle the $(srcdir)/config/ files specially by copying them #within a config/ directory run-basilys-deps: # echo '***' IN run-basilys-deps TARGET '***' $(mkinstalldirs) $(melt_build_include_dir); \ for f in $^ ; do \ cf=`echo $$f | sed "s:$(srcdir)/config/:$(melt_build_include_dir)/config/:"`; \ if [ "x$$f" != "x$$cf" ] ; then \ $(mkinstalldirs) `dirname $$cf` ; \ cp -p $$f $$cf ; \ else \ cp -p $$f $(melt_build_include_dir)/ ; \ fi; \ done ######################## it sort of works on my Debian system, but it is definitely not satisfactory (it probably should break on any non Linux/Gcc system). Maybe using depcomp could help, but I don't know how. Comments and suggestions (or even patches in to the latest of MELT branch) are appreciated. Regards -- 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} ***