git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] Don't define away __attribute__ on gcc

From
AKAndi Kleen <andi@firstfloor.org>
Date
Jul 8, 2014, 06:35 UTC
Message-ID
<1404801311-15365-3-git-send-email-andi@firstfloor.org>
In-Reply-To
<1404801311-15365-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>

Profile feedback sets -DNO_NORETURN, which causes the compat header file to go into a default #else block. That #else block defines away __attribute__(). Doing so causes all kinds of problems with the Linux and gcc system headers: in particular it makes the xmmintrin.h headers error out, breaking the build.

Don't define away __attribute__ when __GNUC__ is set.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 git-compat-util.h | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/git-compat-util.h b/git-compat-util.h
index 96f5554..01e8695 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -291,10 +291,12 @@ extern char *gitbasename(char *);
 #else
 #define NORETURN
 #define NORETURN_PTR
+#ifndef __GNUC__
 #ifndef __attribute__
 #define __attribute__(x)
 #endif
 #endif
+#endif
 
 /* The sentinel attribute is valid from gcc version 4.0 */
 #if defined(__GNUC__) && (__GNUC__ >= 4)
-- 
2.0.1
Previous: Andi KleenNext: Andi Kleen
Message 3 of 5 in “Profile feedback patchkit v2”
  1. Andi KleenJul 8, 2014
  2. 1/4 Use BASIC_FLAGS for profile feedbackAndi Kleen, Jul 8, 2014
  3. 2/4 Don't define away __attribute__ on gccAndi Kleen, Jul 8, 2014
  4. 3/4 Run the perf test suite for profile feedback tooAndi Kleen, Jul 8, 2014
  5. 4/4 Fix profile feedback with -jN and add profile-fastAndi Kleen, Jul 8, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.