Patch: automatic dependencies for gcc
Tom Tromey
tromey@redhat.com
Wed Mar 26 15:27:00 GMT 2008
>>>>> "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?
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.
But, I'm not sure I fully understand what you're trying to do.
Tom
More information about the Gcc-patches
mailing list