I was able to fix most of the errors. Unfortunately, show-ssa still gives a seg fault
(this is on test.c):
"
*** WARNING *** there are active plugins, do not report this as a bug unless you can
reproduce it without enabling any plugins.
Event | Plugins
PLUGIN_FINISH | python
test.c: In function 'helper_function':
test.c:28:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <
http://gcc.gnu.org/bugs.html> for instructions.
"
So does show-gimple (also on test.c):
"
*** WARNING *** there are active plugins, do not report this as a bug unless you can
reproduce it without enabling any plugins.
Event | Plugins
PLUGIN_FINISH | python
test.c: In function 'main':
test.c:35:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <
http://gcc.gnu.org/bugs.html> for instructions.
"
Do you have any idea why the seg fauts are occurring? What's interesting is the seg
fault occurs in different functions (see above errors).
Here is the new command I used to build the plugin:
"
/opt/local/bin/gcc-mp
-I/opt/local/lib/gcc46/gcc/x86_64-apple-darwin10/4.6.3/plugin/include
-I/opt/local/lib/gcc46/gcc/x86_64-apple-darwin10/4.6.3/plugin/include/c-family -fPIC
-fno-strict-aliasing -O2 -Wall -g
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing
-fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -ldl
-framework CoreFoundation -lSystemStubs -lpython2.6 -u _PyMac_Error
/Library/Frameworks/Python.framework/Versions/2.6/Python -undefined dynamic_lookup -shared
gcc-python.o gcc-python-attribute.o gcc-python-callbacks.o gcc-python-callgraph.o
gcc-python-cfg.o gcc-python-closure.o gcc-python-diagnostics.o gcc-python-function.o
gcc-python-gimple.o gcc-python-location.o gcc-python-option.o gcc-python-parameter.o
gcc-python-pass.o gcc-python-pretty-printer.o gcc-python-rtl.o gcc-python-tree.o
gcc-python-variable.o gcc-python-version.o gcc-python-wrapper.o autogenerated-callgraph.o
autogenerated-cfg.o autogenerated-option.o autogenerated-function.o autogenerated-gimple.o
autogenerated-location.o autogenerated-parameter.o autogenerated-pass.o
autogenerated-pretty-printer.o autogenerated-rtl.o autogenerated-tree.o
autogenerated-variable.o fmemopen.o -o python.so
"
Do you notice the "-lpython2.6" part in the gcc command? In the previous post
to the mailing list, I said that "-lpython2.7" gives me an error. Since then, I
have discovered that the macports version of gcc calls python2.6 (the default python for
mac) when it runs the plugin and does not seem to be aware that I have python2.7 installed
(I have both the
Python.org and macports version of python2.7). Do you think this could
be causing the problem, and do you know of a solution?
To the best of my knowledge, the other parts of the plugin work. I also thought you might
want to know that I needed fmemopen.o to build the plugin.
Nick
On May 2, 2012, at 4:38 PM, David Malcolm wrote:
On Wed, 2012-05-02 at 08:47 -0400, Nicholas Pasternack wrote:
> Okay, that fixed the config error, but now we have those linker errors again:
Thanks; good to see that the first part is working.
> “
> ERROR: test_simple_compilation (__main__.SimpleTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "testcpybuilder.py", line 149, in test_simple_compilation
> bm.build(MODNAME)
> File "testcpybuilder.py", line 105, in build
> self.compile_src(extra_cflags)
> File "testcpybuilder.py", line 98, in compile_src
> raise CompilationError(self)
> CompilationError:
> returncode: 1
> compiling: /opt/local/bin/gcc-mp -o
/var/folders/3r/3rkFWJnFFkiA4+SfbiFLqU+++TI/-Tmp-/tmprbKHyU/simple_compilation.so
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing
-fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g
-O2 -DNDEBUG -g -O3 -Wall -Werror -fPIC -shared
/var/folders/3r/3rkFWJnFFkiA4+SfbiFLqU+++TI/-Tmp-/tmprbKHyU/simple_compilation.c
> Stdout:
>
> Stderr:
> Undefined symbols for architecture i386:
> "_Py_InitModule4", referenced from:
> _initsimple_compilation in ccsjE9ha.o
> "_Py_BuildValue", referenced from:
> _example_hello in ccsjE9ha.o
> ld: symbol(s) not found for architecture i386
> collect2: ld returned 1 exit status
> Undefined symbols for architecture x86_64:
> "_Py_InitModule4_64", referenced from:
> _initsimple_compilation in cc3pwddo.o
> "_Py_BuildValue", referenced from:
> _example_hello in cc3pwddo.o
> ld: symbol(s) not found for architecture x86_64
> collect2: ld returned 1 exit status
> lipo: can't open input file:
/var/folders/3r/3rkFWJnFFkiA4+SfbiFLqU+++TI/-Tmp-//cc4eLZMY.out (No such file or
directory)
> I tried putting in the linker flags as you suggested in the last email (I put them in
the LDFLAGS section of the Makefile). I also tried to enter the flags by hand into the
gcc command. The linker error is exactly the same in all cases.
What's the output of running:
python -c"from distutils import sysconfig as sc;
print(repr(sc.get_config_var('LDFLAGS')))"
If it's non-empty, we may need a patch like the one I'm attaching.
<add-LDFLAGS-to-testcpybuilder.patch>_______________________________________________
gcc-python-plugin mailing list
gcc-python-plugin(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/gcc-python-plugin