From: Andi Kleen <andi@firstfloor.org>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 1/3] Add option to disable NORETURN
Date: Sat, 18 Jun 2011 18:07:03 -0700 [thread overview]
Message-ID: <1308445625-30667-1-git-send-email-andi@firstfloor.org> (raw)
From: Junio C Hamano <gitster@pobox.com>
Due to a bug in gcc 4.6+ it can crash when doing profile feedback
with a noreturn function pointer
(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
This adds a Makefile variable to disable noreturns.
[Patch by Junio, description by Andi Kleen]
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
Makefile | 6 ++++++
git-compat-util.h | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index e40ac0c..03b4499 100644
--- a/Makefile
+++ b/Makefile
@@ -153,6 +153,9 @@ all::
# that tells runtime paths to dynamic libraries;
# "-Wl,-rpath=/path/lib" is used instead.
#
+# Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,
+# as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
+#
# Define USE_NSEC below if you want git to care about sub-second file mtimes
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
@@ -1374,6 +1377,9 @@ endif
ifdef USE_ST_TIMESPEC
BASIC_CFLAGS += -DUSE_ST_TIMESPEC
endif
+ifdef NO_NORETURN
+ BASIC_CFLAGS += -DNO_NORETURN
+endif
ifdef NO_NSEC
BASIC_CFLAGS += -DNO_NSEC
endif
diff --git a/git-compat-util.h b/git-compat-util.h
index e0bb81e..9925cf0 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -218,7 +218,7 @@ extern char *gitbasename(char *);
#if __HP_cc >= 61000
#define NORETURN __attribute__((noreturn))
#define NORETURN_PTR
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && !defined(NO_NORETURN)
#define NORETURN __attribute__((__noreturn__))
#define NORETURN_PTR __attribute__((__noreturn__))
#elif defined(_MSC_VER)
--
1.7.4.4
next reply other threads:[~2011-06-19 1:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-19 1:07 Andi Kleen [this message]
2011-06-19 1:07 ` [PATCH 2/3] Add a lot of dummy returns to avoid warnings with NO_NORETURN Andi Kleen
2011-06-20 21:17 ` Junio C Hamano
2011-06-20 21:30 ` Andi Kleen
2011-06-20 21:59 ` Junio C Hamano
2011-06-20 22:03 ` Andi Kleen
2011-06-20 22:31 ` Jonathan Nieder
2011-06-20 22:37 ` Andi Kleen
2011-06-20 22:46 ` Jonathan Nieder
2011-06-20 22:48 ` Jonathan Nieder
2011-06-21 0:24 ` Andi Kleen
2011-06-21 5:00 ` Jonathan Nieder
2011-06-20 23:26 ` Junio C Hamano
2011-06-21 0:17 ` Andi Kleen
2011-06-20 21:53 ` Junio C Hamano
2011-06-20 22:00 ` Andi Kleen
2011-06-20 22:30 ` Junio C Hamano
2011-06-20 22:33 ` Andi Kleen
2011-06-21 4:11 ` Junio C Hamano
2011-06-19 1:07 ` [PATCH 3/3] Add profile feedback build to git v2 Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308445625-30667-1-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).