Building the plugin on OS X (was Re: The Include Macro)

David Malcolm dmalcolm at redhat.com
Tue Apr 17 21:27:06 UTC 2012


On Mon, 2012-04-16 at 19:48 -0400, Nicholas Pasternack wrote:
> Hello Dave,

> The new makefile does not work; I tried it on the current release of
> the plugin and the version of the plugin I made last time.  I figured
> out how to fix the arch command on the macports version of gcc.  

> The new makefile gives the following errors during the
> test_module_with_type and test_simple_compilation phase: 
These tests are within testcpybuilder.py, which is run very early during
the build.  This is a selftest that verifies that the cpybuilder Python
code generates sane C code.  It looks like the code that compiles the C
code isn't working.  This uses its own code to compile C; see the
compile_src method within testcpybuilder.py fwiw.

Given that this selftest isn't relevant unless you're hacking on
cpybuilder.py you could hack around this by removing the
"testcpybuilder" target from the "all" target within the Makefile and
see how much further you get.

>> Stderr:
>     Undefined symbols for architecture i386:
>       "_PyType_Ready", referenced from:
>           _initmodule_with_type in ccGOhJyC.o

My notes from PyCon suggest that adding
   -undefined dynamic_lookup
to the linker flags may help fix linker errors like this.  You may need
to do this by passing this:
  -Wl,-undefined,dynamic_lookup
to gcc (not sure).

[...snip similar linker errors...]

Hope this is helpful
Dave



More information about the gcc-python-plugin mailing list