summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 28eb1af)
raw | patch | inline | side by side (parent: 28eb1af)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 19 Jun 2011 01:07:03 +0000 (18:07 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 20 Jun 2011 19:32:39 +0000 (12:32 -0700) |
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | patch | blob | history | |
git-compat-util.h | patch | blob | history |
diff --git a/Makefile b/Makefile
index e40ac0c7f5ec2f304b88d92f47ff94272f5ce2a4..03b4499d52c8f0870479ec265fb23dce111f853d 100644 (file)
--- a/Makefile
+++ b/Makefile
# 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
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 e0bb81ed8d0bd89f18b31b1c03d3e23744aea5a1..9925cf0edfa50da6e038b90a140cfab49c92de10 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
#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)