From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: Tom Tromey <tromey@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Patch: automatic dependencies for gcc
Date: Wed, 26 Mar 2008 16:47:00 -0000 [thread overview]
Message-ID: <47EA668A.4060905@starynkevitch.net> (raw)
In-Reply-To: <m37ifplh7g.fsf@fleche.redhat.com>
Hello All,
Tom Tromey wrote:
>>>>>> "Basile" == Basile STARYNKEVITCH <basile@starynkevitch.net> 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: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***
next prev parent reply other threads:[~2008-03-26 15:07 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-07 21:15 Tom Tromey
2008-03-07 23:20 ` Joseph S. Myers
2008-03-07 23:28 ` Tom Tromey
2008-03-08 0:37 ` Ralf Wildenhues
2008-03-08 0:42 ` Tom Tromey
2008-03-08 14:33 ` Ralf Wildenhues
2008-03-08 16:20 ` Tom Tromey
2008-03-08 16:36 ` Ralf Wildenhues
2008-03-08 18:41 ` Ralf Wildenhues
2008-03-08 19:42 ` Tom Tromey
2008-03-09 14:40 ` Ralf Wildenhues
2008-03-09 15:07 ` Ralf Wildenhues
2008-03-09 16:02 ` Tom Tromey
2008-03-09 16:36 ` Ralf Wildenhues
2008-03-09 16:55 ` Tom Tromey
2008-03-11 0:01 ` Ben Elliston
2008-03-11 0:11 ` Tom Tromey
2008-03-18 14:35 ` Paolo Bonzini
2008-03-21 13:43 ` Tom Tromey
2008-03-21 17:43 ` Paolo Bonzini
2008-03-24 20:34 ` Tom Tromey
2008-03-25 8:33 ` Tom Tromey
2008-03-25 8:42 ` Paolo Bonzini
2008-03-25 15:43 ` Tom Tromey
2008-03-25 16:32 ` Paolo Bonzini
2008-03-25 17:27 ` Tom Tromey
2008-03-25 17:28 ` Tom Tromey
2008-03-25 17:29 ` Paolo Bonzini
2008-03-25 17:39 ` Tom Tromey
2008-03-25 18:00 ` Tom Tromey
2008-03-25 20:41 ` Ralf Wildenhues
2008-03-25 20:51 ` Tom Tromey
2008-03-25 21:03 ` Ralf Wildenhues
2008-03-26 2:08 ` Tom Tromey
2008-03-25 22:26 ` Andreas Tobler
2008-03-26 3:26 ` Tom Tromey
2008-03-26 13:16 ` Richard Guenther
2008-03-26 13:17 ` Tom Tromey
2008-03-26 13:21 ` Richard Guenther
2008-03-26 13:53 ` Tom Tromey
2008-03-26 15:05 ` Basile STARYNKEVITCH
2008-03-26 15:27 ` Tom Tromey
2008-03-26 16:47 ` Basile STARYNKEVITCH [this message]
2008-03-27 12:02 ` Richard Guenther
2008-03-27 15:45 ` Tom Tromey
2008-03-27 16:40 ` Tom Tromey
2008-03-27 17:14 ` Richard Guenther
2008-03-27 17:41 ` Tom Tromey
2008-03-27 18:34 ` Mark Mitchell
2008-03-27 19:39 ` Tom Tromey
2008-03-27 19:45 ` Diego Novillo
2008-03-27 20:07 ` Tom Tromey
2008-03-27 20:16 ` Diego Novillo
2008-03-27 20:31 ` Paolo Bonzini
2008-03-27 20:20 ` David Daney
2008-03-27 21:42 ` Tom Tromey
2008-03-27 22:43 ` Ralf Wildenhues
2008-03-27 22:47 ` Tom Tromey
2008-03-27 19:21 ` Paolo Bonzini
2008-03-25 21:00 ` Tom Tromey
2008-03-25 21:07 ` Ralf Wildenhues
2008-03-25 21:44 ` Tom Tromey
2008-03-20 16:54 ` Tom Tromey
2008-03-27 16:41 Dominique Dhumieres
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47EA668A.4060905@starynkevitch.net \
--to=basile@starynkevitch.net \
--cc=gcc-patches@gcc.gnu.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).