GNU bug report logs - #15807
guile-2.0.9 doesn't handle Apple clang < 5 or llvm.org clang < 3.3 properly

Previous Next

Package: guile;

Reported by: Jack Howarth <howarth <at> bromo.med.uc.edu>

Date: Tue, 5 Nov 2013 00:53:02 UTC

Severity: normal

Tags: moreinfo

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15807 in the body.
You can then email your comments to 15807 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#15807; Package guile. (Tue, 05 Nov 2013 00:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jack Howarth <howarth <at> bromo.med.uc.edu>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 05 Nov 2013 00:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jack Howarth <howarth <at> bromo.med.uc.edu>
To: bug-guile <at> gnu.org
Subject: guile-2.0.9 doesn't handle Apple clang < 5 or llvm.org clang < 3.3
 properly
Date: Mon, 4 Nov 2013 19:51:36 -0500
    The guile 2.0.9 sources incorrectly assumes that sll clang compilers support
the noreturn attribute which was only added in llvm.org clang 3.3 and Apple clang 5.0.
In fink, we have fixed this with the following patch...

--- guile-2.0.9/libguile/__scm.h.orig   2013-11-01 22:57:06.000000000 -0400
+++ guile-2.0.9/libguile/__scm.h        2013-11-01 23:07:03.000000000 -0400
@@ -76,7 +76,10 @@
  * Examples:
  *   1) int foo (char arg) SCM_NORETURN;
  */
-#ifdef __GNUC__
+
+#if (defined(__apple_build_version__) && (__clang_major__ < 5)) || ((__clang_major__ < 3) && (__clang_minor__ < 3))
+#define SCM_NORETURN
+#elif defined(__GNUC__) 
 #define SCM_NORETURN __attribute__ ((noreturn))
 #else
 #define SCM_NORETURN

Since the environmentals for __clang__, __clang_major__ and __clang_minor are common to both Apple and llvm.org
clang, the (defined(__apple_build_version__) is used to limit the first test on (__clang_major__ < 5) to Apple
clang. the second test for ((__clang_major__ < 3) && (__clang_minor__ < 3)) requires no additional restriction
since it is valid for both Apple and llvm clang in that version range. Without this patch, builds on Xcode 4.6.3,
which uses Apple clang 4.2 that lacks noreturn attribute support will fail.
          Jack




Information forwarded to bug-guile <at> gnu.org:
bug#15807; Package guile. (Tue, 05 Nov 2013 03:03:02 GMT) Full text and rfc822 format available.

Message #8 received at 15807 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Jack Howarth <howarth <at> bromo.med.uc.edu>
Cc: 15807 <at> debbugs.gnu.org
Subject: Re: bug#15807: guile-2.0.9 doesn't handle Apple clang < 5 or llvm.org
 clang < 3.3 properly
Date: Mon, 04 Nov 2013 22:00:36 -0500
Jack Howarth <howarth <at> bromo.med.uc.edu> writes:

>     The guile 2.0.9 sources incorrectly assumes that sll clang compilers support
> the noreturn attribute which was only added in llvm.org clang 3.3 and Apple clang 5.0.
> In fink, we have fixed this with the following patch...
>
> --- guile-2.0.9/libguile/__scm.h.orig   2013-11-01 22:57:06.000000000 -0400
> +++ guile-2.0.9/libguile/__scm.h        2013-11-01 23:07:03.000000000 -0400
> @@ -76,7 +76,10 @@
>   * Examples:
>   *   1) int foo (char arg) SCM_NORETURN;
>   */
> -#ifdef __GNUC__
> +
> +#if (defined(__apple_build_version__) && (__clang_major__ < 5)) || ((__clang_major__ < 3) && (__clang_minor__ < 3))

The logic of these comparisons is incorrect.  Presumably you wanted the
test to be true for clang < 3.3.  However, it will be false for clang
versions 3.2 and 2.3.

Anyway, I don't want to include this complex version comparison logic
into __scm.h.  If we need to add something, it should be via an autoconf
test.

> +#define SCM_NORETURN
> +#elif defined(__GNUC__) 
>  #define SCM_NORETURN __attribute__ ((noreturn))
>  #else
>  #define SCM_NORETURN

So clang is pretending to be GCC (by defining __GNUC__), and then breaks
if we use the noreturn attribute which has been supported in GCC since
version 2.5 (released in 1993) ?  If so, I consider that a bug in clang.

For now, I've changed "__attribute__ ((noreturn))" to "__attribute__
((__noreturn__))", on the theory that the actual problem here is that
'noreturn' is being defined to _Noreturn by stdnoreturn.h.

Can you please try it and see if it fixes the problem?  Just because
clang doesn't support the ((noreturn)) attribute doesn't mean that it
necessarily aborts compilation if it sees it.

Please let us know how it goes.

    Thanks,
      Mark




Information forwarded to bug-guile <at> gnu.org:
bug#15807; Package guile. (Thu, 28 Nov 2013 19:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 15807 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw <at> netris.org>
Cc: 15807 <at> debbugs.gnu.org
Subject: Re: bug#15807: guile-2.0.9 doesn't handle Apple clang < 5 or llvm.org
 clang < 3.3 properly
Date: Thu, 28 Nov 2013 20:38:39 +0100
Mark H Weaver <mhw <at> netris.org> skribis:

> So clang is pretending to be GCC (by defining __GNUC__), and then breaks
> if we use the noreturn attribute which has been supported in GCC since
> version 2.5 (released in 1993) ?  If so, I consider that a bug in clang.

Agreed.  As long as Clang defines __GNUC__, we should ignore any such problem.

Ludo’.




Added tag(s) moreinfo. Request was from Mark H Weaver <mhw <at> netris.org> to control <at> debbugs.gnu.org. (Thu, 05 Dec 2013 04:07:02 GMT) Full text and rfc822 format available.

Reply sent to Mark H Weaver <mhw <at> netris.org>:
You have taken responsibility. (Wed, 15 Jan 2014 20:15:02 GMT) Full text and rfc822 format available.

Notification sent to Jack Howarth <howarth <at> bromo.med.uc.edu>:
bug acknowledged by developer. (Wed, 15 Jan 2014 20:15:03 GMT) Full text and rfc822 format available.

Message #18 received at 15807-close <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 15807-close <at> debbugs.gnu.org
Subject: Re: bug#15807: guile-2.0.9 doesn't handle Apple clang < 5 or llvm.org
 clang < 3.3 properly
Date: Wed, 15 Jan 2014 15:12:09 -0500
ludo <at> gnu.org (Ludovic Courtès) writes:

> Mark H Weaver <mhw <at> netris.org> skribis:
>
>> So clang is pretending to be GCC (by defining __GNUC__), and then breaks
>> if we use the noreturn attribute which has been supported in GCC since
>> version 2.5 (released in 1993) ?  If so, I consider that a bug in clang.
>
> Agreed.  As long as Clang defines __GNUC__, we should ignore any such problem.

I'm closing this bug now, since we've not heard from the original
reporter since he filed the bug, and I believe the problem is already
now fixed (by changing "noreturn" to "__noreturn__" in Guile).

     Mark




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Feb 2014 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.