Bug 864314

Summary: gcc-python-plugin is FTBFS on ARM
Product: [Fedora] Fedora Reporter: Peter Robinson <pbrobinson>
Component: gcc-python-pluginAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dmalcolm, jakub, law
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-06 20:50:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 245418    

Description Peter Robinson 2012-10-09 06:16:27 UTC
It fails to build on ARM, looks to be some definitions missing.

http://arm.koji.fedoraproject.org/koji/packageinfo?packageID=11939

Latest: http://arm.koji.fedoraproject.org/koji/buildinfo?buildID=96570

cc -I/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include -fPIC -fno-strict-aliasing -O2 -Wall -Werror -g -I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic -DPLUGIN_PYTHONPATH='"/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/python2"'   -c -o gcc-python.o gcc-python.c
In file included from gcc-python.c:21:0:
gcc-python.h:24:34: fatal error: autogenerated-config.h: No such file or directory
compilation terminated.
locating plugin directory for gcc... /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin
checking for gcc-plugin.h... found
checking whether plugin.def defines PLUGIN_FINISH_DECL... yes
writing autogenerated-config.h
cc -I/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include -fPIC -fno-strict-aliasing -O2 -Wall -Werror -g -I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic -DPLUGIN_PYTHONPATH='"/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/python2"'   -c -o gcc-python-attribute.o gcc-python-attribute.c
In file included from /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include/options.h:8:0,
                 from /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include/flags.h:27,
                 from /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include/tree.h:35,
                 from gcc-python.h:25,
                 from gcc-python-attribute.c:21:
/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include/config/arm/arm-opts.h:30:25: fatal error: arm-cores.def: No such file or directory
compilation terminated.
make: *** [gcc-python.o] Error 1

Comment 1 Dave Malcolm 2012-10-09 15:11:29 UTC
gcc-python-plugin's build is passing:
  -I/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include

This looks like a gcc packaging bug: if tree.h includes arm-opts.h and the latter includes arm-cores.def, then presumably that .def file should also be packaged?

Reassigning to "gcc" (though perhaps there's an extra path that the plugin should be adding to the include path with "-I" ?)

Comment 2 Dave Malcolm 2012-10-09 15:13:30 UTC
FWIW, the Makefile has:

   GCCPLUGINS_DIR:= $(shell $(CC) --print-file-name=plugin)

which is used to add this to the CPPFLAGS:

  -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family

Comment 3 Fedora End Of Life 2013-04-03 15:06:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 4 Peter Robinson 2013-04-29 13:45:00 UTC
> This looks like a gcc packaging bug: if tree.h includes arm-opts.h and the
> latter includes arm-cores.def, then presumably that .def file should also be
> packaged?

Looks like this issue is fixed now and the core build/install now completes but we're failing a bunch of tests:

276 successes; 14 failures; 0 skipped
Failed tests:
  tests/cpychecker/absinterp/array-range/fully-checked
  tests/cpychecker/absinterp/array-range/fully-checked-on-stack
  tests/cpychecker/absinterp/array-range/implicitly-correct
  tests/cpychecker/absinterp/array-range/off-by-one
  tests/cpychecker/absinterp/array-range/unchecked
  tests/cpychecker/absinterp/array-range/upper-checked
  tests/cpychecker/absinterp/bitfields/reading
  tests/cpychecker/absinterp/casts/int-to-char-with-extraction
  tests/cpychecker/absinterp/casts/int-to-char-with-implicit-truncation
  tests/cpychecker/absinterp/custom-strdup
  tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization
  tests/plugin/gc/_force_garbage_collection
  tests/plugin/gc/_gc_selftest
  tests/plugin/gc/segfault-on-instance-of-pass-subclass

Full output here: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=1756195

let me know if you need more information.

Comment 5 Dave Malcolm 2013-04-29 15:35:59 UTC
Thanks.  Looking through the logs:

  tests/cpychecker/absinterp/array-range/fully-checked
  tests/cpychecker/absinterp/array-range/fully-checked-on-stack
  tests/cpychecker/absinterp/array-range/implicitly-correct
  tests/cpychecker/absinterp/array-range/off-by-one
  tests/cpychecker/absinterp/array-range/unchecked
  tests/cpychecker/absinterp/array-range/upper-checked
  tests/cpychecker/absinterp/casts/int-to-char-with-implicit-truncation
  tests/cpychecker/absinterp/custom-strdup
    these all seem to be a signedness of char issue (the tests seem to be expecting signed char, the results seem to be using unsigned char)

  tests/cpychecker/absinterp/bitfields/reading
  tests/cpychecker/absinterp/casts/int-to-char-with-extraction
    not yet sure about these ones
    
  tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization
    small (benign) change in labelling temprorary value

  tests/plugin/gc/_force_garbage_collection
  tests/plugin/gc/_gc_selftest
  tests/plugin/gc/segfault-on-instance-of-pass-subclass
    all three of these segfault

I'm provisioning a machine to investigate further.

Comment 6 Jakub Jelinek 2013-04-29 15:39:03 UTC
If it is about test output, you might just compile with -fsigned-char.

Comment 7 Dave Malcolm 2013-04-29 17:10:13 UTC
FWIW comment #4 was built against 4.8.0-2.fc19

I'm still seeing:

/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/plugin/include/config/arm/arm-opts.h:30:25: fatal error: arm-cores.def: No such file or directory

with:
  gcc-4.7.2-8.fc18.armv7hl
  gcc-plugin-devel-4.7.2-8.fc18.armv7hl

[This was separately filed as bug 910926 and looking at git logs it looks like you fixed this in 

* Thu Mar  7 2013 Jakub Jelinek <jakub> 4.8.0-0.16
[..snip..]
  - include arm-cores.def in gcc-python-plugin on arm (#910926)
[..snip..]

but not in the F18 branch.

For reference, the upstream file is here:
http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/arm/arm-cores.def?view=markup

I manually copied it into place.

I also had to manually copy config/vxworks-dummy.h into place

With that, I'm seeing the same failures with gcc-4.7.2-8.fc18.armv7hl (although tests/cpychecker/absinterp/bitfields/reading is actually passing for me).

Comment 9 Dave Malcolm 2013-04-29 19:17:27 UTC
(In reply to comment #6)
> If it is about test output, you might just compile with -fsigned-char.

Good idea; thanks.

Implemented in:
https://git.fedorahosted.org/cgit/gcc-python-plugin.git/commit/?id=2f208bbd41d8ec6f1988f8b66fbdfc48175543b8

which together with the ggc root_tab fix brings the failures on this box down to just:

290 successes; 4 failures; 0 skipped
Failed tests:
  tests/cpychecker/absinterp/array-range/fully-checked-on-stack
  tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization
  tests/cpychecker/refcounts/cplusplus/destructor
  tests/cpychecker/refcounts/cplusplus/empty-function

Comment 10 Peter Robinson 2013-05-30 21:48:45 UTC
David what's the status of getting the 4 final failures closed out?