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

 
 

You are not allowed to post comments on this tracker with your current authentification 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: MakefilesSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned 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

CFLAGS_nonfragile="$CFLAGS"

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

CFLAGS_no_nonfragile="$CFLAGS"

Cheers,
Quentin.

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):

CC=clang
./configure
==>
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_nonfragile="$CFLAGS"
CFLAGS="$CFLAGS -fobjc-nonfragile-abi"
AC_COMPILE_IFELSE([[
/* 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. */
int
main()
{
#ifndef __has_feature
#define __has_feature(x) 0
#endif
return __has_feature(objc_nonfragile_abi) ? 0 : 1;
}
]], USE_NONFRAGILE_ABI=yes, USE_NONFRAGILE_ABI=no)
AC_MSG_RESULT($USE_NONFRAGILE_ABI)
CFLAGS="$CFLAGS_no_nonfragile"

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])
fi
else
AC_MSG_RESULT(not requested by user)
fi

AC_SUBST(USE_NONFRAGILE_ABI)
======

Notice how we define CFLAGS_nonfragile, but we then set:
CFLAGS=$CFLAGS_no_nonfragile

I think this is causing the problem. I was able to fix it by changing that line to read:
CFLAGS="$CFLAGS_nonfragile"

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 (25kB - 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
  • -unavailable- added by rmottola (Updated the item)
  • -unavailable- added by qmathe (Posted a comment)
  • -unavailable- added by carmstrong (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 5 latest changes.

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

    Back to the top


    Powered by Savane 3.1-cleanup