git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Add option to disable NORETURN
@ 2011-06-19  1:07 Andi Kleen
  2011-06-19  1:07 ` [PATCH 2/3] Add a lot of dummy returns to avoid warnings with NO_NORETURN Andi Kleen
  2011-06-19  1:07 ` [PATCH 3/3] Add profile feedback build to git v2 Andi Kleen
  0 siblings, 2 replies; 20+ messages in thread
From: Andi Kleen @ 2011-06-19  1:07 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Andi Kleen

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-06-21  5:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-19  1:07 [PATCH 1/3] Add option to disable NORETURN Andi Kleen
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

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