Failed to build on Ubuntu 15.04
I'm running Ubuntu 15.04, using 33d88ce2549d4888cf617281d15777b94f5915af
When I try to compile, I get these errors:
$ make
Makefile:193: warning: overriding recipe for target 'autogenerated-casts.c'
Makefile:190: warning: ignoring old recipe for target 'autogenerated-casts.c'
python generate-config-h.py -o autogenerated-config.h --gcc="cc" --plugindir="/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin"
Checking whether cc was built with C or C++... C++
checking for gcc-plugin.h... found
checking whether plugin.def defines PLUGIN_FINISH_DECL... yes
checking whether passes are C++ classes... yes
writing autogenerated-config.h
writing autogenerated-EXTRA_CFLAGS.txt
python testcpybuilder.py -v
test_module_with_type (__main__.SimpleTest) ... ok
test_simple_compilation (__main__.SimpleTest) ... ok
test_version_parsing (__main__.SimpleTest) ... ok
----------------------------------------------------------------------
Ran 3 tests in 0.266s
OK
cd gcc-c-api && make libgcc-c-api.so CC=cc
make[1]: Entering directory '/home/jml/src/gcc-python-plugin/gcc-c-api'
python xml-to-h.py
cc -O2 -Werror -g -fPIC -fno-strict-aliasing -Wall -I/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include -I/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/c-family -I. -c -x c++ -fno-rtti -o gcc-callgraph.o gcc-callgraph.c
In file included from gcc-callgraph.c:29:0:
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:283:10: error: use of enum ‘internal_fn’ without previous declaration
enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
^
In file included from gcc-callgraph.c:29:0:
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:1170:41: error: use of enum ‘internal_fn’ without previous declaration
gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
^
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:1171:45: error: use of enum ‘internal_fn’ without previous declaration
gimple gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
^
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h: In function ‘bool gimple_store_p(gimple)’:
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:2346:36: error: ‘is_gimple_reg’ was not declared in this scope
return lhs && !is_gimple_reg (lhs);
^
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h: At global scope:
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:2444:20: error: use of enum ‘internal_fn’ without previous declaration
static inline enum internal_fn
^
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:2544:46: error: use of enum ‘internal_fn’ without previous declaration
gimple_call_set_internal_fn (gimple gs, enum internal_fn fn)
^
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h: In function ‘tree_node* gimple_call_fndecl(const_gimple)’:
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:2559:54: error: ‘gimple_call_addr_fndecl’ was not declared in this scope
return gimple_call_addr_fndecl (gimple_call_fn (gs));
^
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h: In function ‘tree_node* gimple_expr_type(const_gimple)’:
/usr/lib/gcc/x86_64-linux-gnu/4.9/plugin/include/gimple.h:5657:45: error: ‘IFN_MASK_STORE’ was not declared in this scope
&& gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
^
Makefile:92: recipe for target 'gcc-callgraph.o' failed
make[1]: *** [gcc-callgraph.o] Error 1
make[1]: Leaving directory '/home/jml/src/gcc-python-plugin/gcc-c-api'
Makefile:152: recipe for target 'gcc-c-api/libgcc-c-api.so' failed
make: *** [gcc-c-api/libgcc-c-api.so] Error 2
Am using gcc 4.9:
$ gcc --version
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
Possibly related to https://fedorahosted.org/gcc-python-plugin/ticket/63
same error +1
fwiw,
I fixed this issue by including #include "internal-fn.h" in 4.9.3/plugin/include/gimple.h.
however make still fails now: tests/cpychecker/refcounts/uninitialized_data/comparison: OK tests/cpychecker/refcounts/uninitialized_data/function_arg: OK tests/cpychecker/refcounts/unrecognized_function: OK tests/cpychecker/refcounts/unrecognized_function2: OK 310 successes; 2 failures; 0 skipped Failed tests: tests/cpychecker/absinterp/comparisons/conditionals tests/plugin/rtl Makefile:293: recipe for target 'test-suite' failed make: *** [test-suite] Error 1
same failed on ubuntu 16.04