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

Group
 
 

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

Submitter:  Chris Armstrong <carmstrong>
Submitted:  Sun 15 Apr 2012 06:41:54 AM UTC
   
 
Category:  Makefiles Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  qmathe
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group Member
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>

 

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

Attach Files:
   
   
Comment:
   

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

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-06-25 rmottola StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2012-07-05 qmathe StatusNone Ready For Test
        Assigned toNone qmathe
    2012-04-15 carmstrong Attached File- Added config.log, #25649

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code