On Tue, 2011-09-06 at 23:19 +0100, Vinay Sajip wrote:
I've just checked out the project from source and tried building
on
Ubuntu (using gcc 4.6.1-9ubuntu2). Everything compiles and links OK,
but when I try to load python.so, it fails because a symbol is
undefined: "cfun". I see that cfun is declared in
plugin/include/function.h:
extern GTY(()) struct function * cfun;
but I don't know where it's meant to be defined. I presume it's meant
to be part of gcc, and from the docs, any gcc 4.6 should work; can any
one shed any light on this?
On my machine (Fedora 15), within
gcc-4.6.0-20110603/gcc/function.c
I see:
/* The currently compiled function. */
struct function *cfun = 0;
as lines 123-124.
Looking within:
$ eu-readelf -s /usr/bin/gcc | grep cfun
on this box I don't see "cfun", but it _is_ present within
/usr/libexec/gcc/x86_64-redhat-linux/4.6.0/cc1
/usr/libexec/gcc/x86_64-redhat-linux/4.6.0/cc1plus
/usr/libexec/gcc/x86_64-redhat-linux/4.6.0/f951
so it seems like it's only present in the actual compiler parts of the
toolchain (language frontend+optimizer+write-out-assembler-backend), not
in the "gcc" harness.
How are you invoking the plugin?
Hope this is helpful
Dave