bugGNUstep - Bugs: bug #36186, gnustep-make fails to detect that...


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

bug #36186: gnustep-make fails to detect that clang supports native objective-c exceptions with --enable-objc-nonfragile-abi

Submitted by:  Chris Armstrong <carmstrong>
Submitted on:  Sun 15 Apr 2012 06:41:54 AM UTC  
Category:  Makefiles Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  Quentin Mathé <qmathe>
Open/Closed:  Closed

Thu 05 Jul 2012 10:18:20 PM UTC, comment #2:

Thanks Quentin - I won't have any time to test the fix again anytime soon, so its probably safe to assume it works given we both have tested it in the past.

Chris Armstrong <carmstrong>
Thu 05 Jul 2012 02:46:00 PM UTC, comment #1:

Hi Christopher,

I have observed the same problem here. Your fix seems correct to me, I tested it and just committed it with a little change.

I think there is a typo when the temporary CFLAGS variable is declared. We have


but we later want to restore the CFLAGS to their previous state, when -fobjc-nonfragile-abi was not in use. So I would expect



Quentin Mathé <qmathe>
Project MemberIn charge of this item.
Sun 15 Apr 2012 06:41:54 AM UTC, original submission:

I'm using clang to compile gnustep. However, gnustep-make is failing to detect that clang supports native objective-c exceptions (this is causing me a world of pain in other libraries) when the non-fragile abi flag is enabled. It works correctly when the non-fragile abi flag is not specified.

I've discovered this is because of a failure in the conftest used to detect native objective-c exceptions. When it attempts to compile it, it fails with the following error (config.log attached for reference):

configure:5752: checking whether the compiler supports native ObjC exceptions
configure:5780: clang -c -fexceptions -fobjc-exceptions conftest.c >&5
clang: warning: argument unused during compilation: '-fobjc-exceptions'
conftest.c:11:1: error: expected identifier or '('
@interface Test { id isa; } @end
1 error generated.
configure:5780: $? = 1

It must have something to do with the redefinition of CFLAGS in the non-fragile if/fi block, as the "-x objective-c" flag is not getting to the compiler for this conftest.

I suspect its related to the following code in configure.ac:
AC_MSG_CHECKING(whether we should use the nonfragile ABI)
if test x"$USE_NONFRAGILE_ABI" = x"yes"; then
# What we want to do: set USE_NONFRAGILE_ABI to yes if we can compile
# something with -fobjc-nonfragile-abi.
CFLAGS="$CFLAGS -fobjc-nonfragile-abi"
/* Note that we never execute this code so it does not really matter
what it is. We are testing that the compiler accepts the
'-fobjc-nonfragile-abi' flag. */
#ifndef __has_feature
#define __has_feature(x) 0
return __has_feature(objc_nonfragile_abi) ? 0 : 1;

if test x$USE_NONFRAGILE_ABI = xno; then
AC_MSG_NOTICE([The nonfragile ABI was requested, but the compiler])
AC_MSG_NOTICE([doesn't support it.])
AC_MSG_ERROR([compiler doesn't support nonfragile ABI])
AC_MSG_RESULT(not requested by user)


Notice how we define CFLAGS_nonfragile, but we then set:

I think this is causing the problem. I was able to fix it by changing that line to read:

I don't know why there is a reference to a CFLAGS_no_nonfragile; the configure script aborts if the non-fragile ABI is requested but not supported.

Can anyone else shed light on this?

Chris Armstrong <carmstrong>


Attached Files
file #25649:  config.log added by carmstrong (25KiB - text/x-log - config.log generated from "export CC=clang; ./configure --enable-objc-nonfragile-abi")


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rmottola (Updated the item)
  • -email is unavailable- added by qmathe (Posted a comment)
  • -email is unavailable- added by carmstrong (Submitted the item)

    Do you think this task is very important?
    If so, you can 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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Wed 25 Jun 2014 10:05:32 PM UTC rmottola StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    Thu 05 Jul 2012 02:46:00 PM UTC qmathe StatusNone => Ready For Test
        Assigned toNone => qmathe
    Sun 15 Apr 2012 06:41:54 AM UTC carmstrong Attached File- => Added config.log, #25649

    Back to the top

    Powered by Savane 3.3