bugGNUstep - Bugs: bug #38190, base fails to detect whether objc...

Group
 
 

bug #38190: base fails to detect whether objc really works with clang/libobjc2

Submitter:  Sebastian Reitenbach <buzzdee>
Submitted:  Tue 29 Jan 2013 10:19:12 AM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 17 Feb 2013 04:36:43 PM UTC, comment #6: 

thanks for testing

Richard Frith-Macdonald <CaS>
Group Member
Sun 17 Feb 2013 04:28:29 PM UTC, comment #5: 

I can confirm, works for me too!

thanks!

Sebastian Reitenbach <buzzdee>
Group Member
Sun 17 Feb 2013 04:00:32 PM UTC, comment #4: 

Looking at the error logs from the compiler and the code david added, I think the problem is simply that the attribute to keep clang happy was applied in the wrong place (to the implementation rather than the interface), so I changed the config scripts to add the root class attribute to interfaces and not to the implementation.
Please let me know if that works (it doesn't seem to break anything on my machines at least).

Richard Frith-Macdonald <CaS>
Group Member
Sun 17 Feb 2013 03:44:47 PM UTC, comment #3: 

forgot to mention, I don't really care if this gets ignored, since for the ports tree, I have the patch to revert that change to config/objc-common.g.


Sebastian Reitenbach <buzzdee>
Group Member
Sun 17 Feb 2013 03:41:59 PM UTC, comment #2: 

The problem happens for me with clang 3.2 (latest release) and libobjc2 and base both from SVN.

here is the part from config.log where it fails:

configure:13162: checking whether objc really works
configure:13192: clang -o conftest -O2 -pipe -g -O0  -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include  -fg
nu-runtime -x objective-c  -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib conftest.c  -pthread -Wl,-E -L/usr/local/lib -
pthread -shared-libgcc -fexceptions -fobjc-nonfragile-abi -fgnu-runtime -L/GNUstep/Library/Libraries -L/usr/local/lib -L/usr/local/lib -pthre
ad -lobjc2 -lm   -pthread  >&5
clang-3: warning: argument unused during compilation: '-shared-libgcc'
In file included from conftest.c:98:
In file included from ././config/config.objc.m:2:
././config/objc-common.g:29:21: error: prefix attribute must be followed by an interface or protocol
GS_OBJC_ROOT_CLASS @implementation NXConstantString
                    ^
In file included from conftest.c:98:
././config/config.objc.m:6:1: error: '@end' must appear in an Objective-C context
@end
^
././config/config.objc.m:8:17: warning: cannot find interface declaration for 'Test'
@implementation Test
                ^
././config/config.objc.m:8:17: warning: class 'Test' defined without specifying a base class [-Wobjc-root-class]
././config/config.objc.m:8:21: note: add a super class to fix this problem
@implementation Test
                    ^
2 warnings and 2 errors generated.
configure:13196: $? = 1
configure: program exited with status 1
configure: failed program was:
...



Sebastian Reitenbach <buzzdee>
Group Member
Sun 17 Feb 2013 07:52:49 AM UTC, comment #1: 

The change to objc-common.g is an update made by David to support libobjc2, so it seems odd that it should prevent libobjc2 working on your system.

I don't have an openbsd system to try on, but I've tried building on a clean installl of debian stable with llvm/clang abd libobobjc2 built from svn trunk, and that had no trouble.

I guess there is a general problem in that llvm/clang/libobjc2 are basically unstable, changing too much for us to support all possible versions:  so realistically, if this issue doesn't occur with the latest clang and libobjc2 from subversion, perhaps we should just ignore it?

Richard Frith-Macdonald <CaS>
Group Member
Tue 29 Jan 2013 10:19:12 AM UTC, original submission:  

I'm on OpenBSD 5.2 -current, using libobjc2 from svn, and clang 3.2

When the configure script comes to the stage that it is testing whether objc really works, it miserably fails.
I found it working with the last release.

Copying the config/objc-common.g file from the release to the SVN, makes the gnustep-base SVN configure pass that test successfully.

$ diff -u gnustep-base-1.24.0/gnustep-base-1.24.0/config/objc-common.g gnustep-base-1.25.0/gnustep-base-1.25.0/config/objc-common.g
--- gnustep-base-1.24.0/gnustep-base-1.24.0/config/objc-common.g        Wed Aug 17 13:46:06 2011
+++ gnustep-base-1.25.0/gnustep-base-1.25.0/config/objc-common.g        Mon Jan 28 18:51:42 2013
@@ -16,10 +16,17 @@
 #include <objc/hooks.h>
 #endif
 
+
+#if HAVE_OBJC_ROOT_CLASS_ATTRIBUTE
+#define GS_OBJC_ROOT_CLASS _attribute_((objc_root_class))
+#else
+#define GS_OBJC_ROOT_CLASS
+#endif
+
 /* Provide an implementation of NXConstantString for an old libobjc when
    built stand-alone without an NXConstantString implementation.  */
 #if !defined(NeXT_RUNTIME) && !defined(_GNUSTEP_RUNTIME_)
-@implementation NXConstantString
+GS_OBJC_ROOT_CLASS @implementation NXConstantString
 - (const char*) cString
 {
   return 0;
@@ -34,7 +41,7 @@
 /* Provide dummy implementations for NSObject and NSConstantString
  * for libobjc2 which needs them.
  */
-@interface NSObject
+GS_OBJC_ROOT_CLASS @interface NSObject
 {
  id isa;
 }

Sebastian Reitenbach <buzzdee>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by buzzdee (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-02-17 CaS Open/ClosedIn Test Closed
    2013-02-17 CaS StatusNone Fixed
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code