[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #36186] gnustep-make fails to detect that clang supports native obj
From: |
Chris Armstrong |
Subject: |
[bug #36186] gnustep-make fails to detect that clang supports native objective-c exceptions with --enable-objc-nonfragile-abi |
Date: |
Sun, 15 Apr 2012 06:41:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0 |
URL:
<http://savannah.gnu.org/bugs/?36186>
Summary: gnustep-make fails to detect that clang supports
native objective-c exceptions with --enable-objc-nonfragile-abi
Project: GNUstep
Submitted by: carmstrong
Submitted on: Sun 15 Apr 2012 06:41:54 AM GMT
Category: Makefiles
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
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?
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sun 15 Apr 2012 06:41:54 AM GMT Name: config.log Size: 25kB By:
carmstrong
config.log generated from "export CC=clang; ./configure
--enable-objc-nonfragile-abi"
<http://savannah.gnu.org/bugs/download.php?file_id=25649>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36186>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #36186] gnustep-make fails to detect that clang supports native objective-c exceptions with --enable-objc-nonfragile-abi,
Chris Armstrong <=