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


You are not allowed to post comments on this tracker with your current authentification level.

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

Submitted by:  Sebastian Reitenbach <buzzdee>
Submitted on:  Tue Jan 29 10:19:12 2013  
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Sun Feb 17 16:36:43 2013, comment #6:

thanks for testing

Richard Frith-Macdonald <CaS>
Project Member
Sun Feb 17 16:28:29 2013, comment #5:

I can confirm, works for me too!


Sebastian Reitenbach <buzzdee>
Project Member
Sun Feb 17 16:00:32 2013, 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>
Project Member
Sun Feb 17 15:44:47 2013, 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>
Project Member
Sun Feb 17 15:41:59 2013, 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
././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>
Project Member
Sun Feb 17 07:52:49 2013, 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>
Project Member
Tue Jan 29 10:19:12 2013, 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>

+#define GS_OBJC_ROOT_CLASS _attribute_((objc_root_class))
/* 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>
Project Member


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Feb 17 16:36:43 2013CaSOpen/ClosedIn Test=>Closed
    Sun Feb 17 16:00:32 2013CaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test

    Back to the top

    Powered by Savane 3.1-cleanup