View Issue Details

IDProjectCategoryView StatusLast Update
0001278SOGoSOPEpublic2011-07-27 16:54
Reporterbero Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Versionnightly v2 
Summary0001278: SOPE 1.3.7 doesn't compile with gcc 4.6.x
Description

Attempting to build SOPE 1.3.7 with gcc 4.6.x results in this error:

In file included from EOKeyValueCoding.m:27:0:
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/objc-api.h:46:3: error: #error You can not include both objc/objc-api.h and objc/runtime.h. Include objc/objc-api.h for the traditional GNU Objective-C Runtime API and objc/runtime.h for the modern one.
In file included from EOKeyValueCoding.m:27:0:
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/objc-api.h:69:8: error: redefinition of 'struct objc_method_description'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:87:8: note: originally defined here
In file included from EOKeyValueCoding.m:27:0:
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/objc-api.h:120:28: error: conflicting types for 'Method'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:70:29: note: previous declaration of 'Method' was here
In file included from EOKeyValueCoding.m:27:0:
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/objc-api.h:174:30: error: conflicting types for 'Category'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:75:31: note: previous declaration of 'Category' was here
In file included from EOKeyValueCoding.m:28:0:
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/encoding.h:93:8: error: redefinition of 'struct objc_struct_layout'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:1129:8: note: originally defined here
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/encoding.h:102:6: error: conflicting types for 'objc_layout_structure'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:1138:18: note: previous declaration of 'objc_layout_structure' was here
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/encoding.h:104:7: error: conflicting types for 'objc_layout_structure_next_member'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:1140:19: note: previous declaration of 'objc_layout_structure_next_member' was here
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/encoding.h:105:6: error: conflicting types for 'objc_layout_finish_structure'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:1141:18: note: previous declaration of 'objc_layout_finish_structure' was here
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/encoding.h:108:6: error: conflicting types for 'objc_layout_structure_get_info'
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/runtime.h:1144:18: note: previous declaration of 'objc_layout_structure_get_info' was here
make[5]: *** [obj/libEOControl.obj/EOKeyValueCoding.m.o] Error 1

Additional Information

Looks like SOPE is requesting the traditional API, but #include/#imports headers from external libraries (gnustep?) that #include/#import the modern API headers.

TagsNo tags attached.

Activities

bero

bero

2011-06-09 13:46

reporter   ~0002553

Problem still present in 1.3.7a

wsourdeau

wsourdeau

2011-06-09 13:54

viewer   ~0002554

That is a bug with GNUstep 1.22 and below that occurs with gcc 4.6, so you must use another version of either packages.
There is nothing we can do on our side to prevent it.

bero

bero

2011-06-09 14:59

reporter   ~0002557

I've taked to the GNUstep guys - they say this is not their bug and must be fixed in SOPE:

The problem is that SOPE has no been updated to use the Modern
Objective-C runtime API when using the GNU runtime.
The file that doesn't compiles starts with
#if GNU_RUNTIME

include <objc/objc-api.h>

include <objc/encoding.h>

#endif
... but objc/objc-api.h and objc/encoding.h are deprecated in
GCC 4.6.0 and no longer even exist in GCC 4.7.0!
So, of course the code doesn't compile. Nothing to do with
GNUstep.
See
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/GNU-Objective_002dC-runtime-API.html#GNU-Objective_002dC-runtime-API
for more information.

Doing what they suggest and getting rid of the obsolete headers, replacing them with <objc/runtime.h> does help the initial problem, but in the end

NGObjCRuntime.m

still barfs because it accesses structures directly that are hidden these days (MethodList_t and friends).

ludovic

ludovic

2011-07-20 19:09

administrator   ~0002728

I'm making progress on this but it is a complex process.

We must support the objc runtime included in old versions of gcc and newer versions (not API compatible).

We must also support libobjc2 (the GNUstep runtime), which is API compatible with the Apple runtime.

So far, SOPE and SOGo compile with libobjc2. I'll keep you posted in this ticket.

ludovic

ludovic

2011-07-27 14:54

administrator   ~0002746

Please try the patch I've just attached.

awayand

awayand

2011-07-27 15:20

reporter   ~0002747

just tested it. works like a charm.

2011-07-27 16:21

 

ludovic

ludovic

2011-07-27 16:21

administrator   ~0002748

I've just made an other patch. Could you please try it?

ludovic

ludovic

2011-07-27 16:54

administrator   ~0002749

Fix pushed in trunk: http://mtn.inverse.ca/revision/diff/b55c3d5a2d3c3107e576e9f623b23f17454a9a63/with/70119bf7d87b438040fe83185770175d612d4aec

Issue History

Date Modified Username Field Change
2011-05-03 22:47 bero New Issue
2011-06-09 13:46 bero Note Added: 0002553
2011-06-09 13:54 wsourdeau Note Added: 0002554
2011-06-09 13:54 wsourdeau Status new => closed
2011-06-09 13:54 wsourdeau Resolution open => not fixable
2011-06-09 14:59 bero Note Added: 0002557
2011-06-09 14:59 bero Status closed => feedback
2011-06-09 14:59 bero Resolution not fixable => reopened
2011-07-20 19:09 ludovic Note Added: 0002728
2011-07-27 14:53 ludovic File Added: gcc46-or-libobjc2-runtime.diff
2011-07-27 14:54 ludovic Note Added: 0002746
2011-07-27 15:20 awayand Note Added: 0002747
2011-07-27 16:21 ludovic File Deleted: gcc46-or-libobjc2-runtime.diff
2011-07-27 16:21 ludovic File Added: gcc46-or-libobjc2-runtime.diff
2011-07-27 16:21 ludovic Note Added: 0002748
2011-07-27 16:54 ludovic Note Added: 0002749
2011-07-27 16:54 ludovic Status feedback => closed
2011-07-27 16:54 ludovic Resolution reopened => fixed