build: prepare for new toolchain based on gcc 7.3 (just for testing)
parent
82b73cb9e9
commit
8927bb0927
@ -0,0 +1,30 @@
|
|||||||
|
#ifndef __LINUX_COMPILER_H
|
||||||
|
#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __used __attribute__((__used__))
|
||||||
|
#define __must_check __attribute__((warn_unused_result))
|
||||||
|
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
|
||||||
|
#define __always_inline inline __attribute__((always_inline))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A trick to suppress uninitialized variable warning without generating any
|
||||||
|
* code
|
||||||
|
*/
|
||||||
|
#define uninitialized_var(x) x = x
|
||||||
|
|
||||||
|
/* Mark functions as cold. gcc will assume any path leading to a call
|
||||||
|
to them will be unlikely. This means a lot of manual unlikely()s
|
||||||
|
are unnecessary now for any paths leading to the usual suspects
|
||||||
|
like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||||
|
older compilers]
|
||||||
|
|
||||||
|
Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||||
|
in the preprocessor, but we can live with this because they're unreleased.
|
||||||
|
Maketime probing would be overkill here.
|
||||||
|
|
||||||
|
gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||||
|
a special section, but I don't see any sense in this right now in
|
||||||
|
the kernel context */
|
||||||
|
#define __cold __attribute__((__cold__))
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
--- glib2/gio/gunixconnection.c
|
||||||
|
+++ glib2/gio/gunixconnection.c
|
||||||
|
@@ -147,6 +147,10 @@
|
||||||
|
*
|
||||||
|
* Since: 2.22
|
||||||
|
**/
|
||||||
|
+#if defined(__GNUC__) && __GNUC__ >= 5
|
||||||
|
+#pragma GCC diagnostic push
|
||||||
|
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||||
|
+#endif
|
||||||
|
gint
|
||||||
|
g_unix_connection_receive_fd (GUnixConnection *connection,
|
||||||
|
GCancellable *cancellable,
|
||||||
|
@@ -241,6 +245,9 @@
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
+#if defined(__GNUC__) && __GNUC__ >= 5
|
||||||
|
+#pragma GCC diagnostic pop
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
g_unix_connection_init (GUnixConnection *connection)
|
||||||
|
@@ -493,6 +500,10 @@
|
||||||
|
*
|
||||||
|
* Since: 2.26
|
||||||
|
*/
|
||||||
|
+#if defined(__GNUC__) && __GNUC__ >= 5
|
||||||
|
+#pragma GCC diagnostic push
|
||||||
|
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||||
|
+#endif
|
||||||
|
GCredentials *
|
||||||
|
g_unix_connection_receive_credentials (GUnixConnection *connection,
|
||||||
|
GCancellable *cancellable,
|
||||||
|
@@ -662,6 +673,9 @@
|
||||||
|
g_object_unref (socket);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
+#if defined(__GNUC__) && __GNUC__ >= 5
|
||||||
|
+#pragma GCC diagnostic pop
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
receive_credentials_async_thread (GTask *task,
|
@ -0,0 +1,30 @@
|
|||||||
|
#ifndef __LINUX_COMPILER_H
|
||||||
|
#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __used __attribute__((__used__))
|
||||||
|
#define __must_check __attribute__((warn_unused_result))
|
||||||
|
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
|
||||||
|
#define __always_inline inline __attribute__((always_inline))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A trick to suppress uninitialized variable warning without generating any
|
||||||
|
* code
|
||||||
|
*/
|
||||||
|
#define uninitialized_var(x) x = x
|
||||||
|
|
||||||
|
/* Mark functions as cold. gcc will assume any path leading to a call
|
||||||
|
to them will be unlikely. This means a lot of manual unlikely()s
|
||||||
|
are unnecessary now for any paths leading to the usual suspects
|
||||||
|
like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||||
|
older compilers]
|
||||||
|
|
||||||
|
Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||||
|
in the preprocessor, but we can live with this because they're unreleased.
|
||||||
|
Maketime probing would be overkill here.
|
||||||
|
|
||||||
|
gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||||
|
a special section, but I don't see any sense in this right now in
|
||||||
|
the kernel context */
|
||||||
|
#define __cold __attribute__((__cold__))
|
||||||
|
|
@ -0,0 +1,30 @@
|
|||||||
|
#ifndef __LINUX_COMPILER_H
|
||||||
|
#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __used __attribute__((__used__))
|
||||||
|
#define __must_check __attribute__((warn_unused_result))
|
||||||
|
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
|
||||||
|
#define __always_inline inline __attribute__((always_inline))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A trick to suppress uninitialized variable warning without generating any
|
||||||
|
* code
|
||||||
|
*/
|
||||||
|
#define uninitialized_var(x) x = x
|
||||||
|
|
||||||
|
/* Mark functions as cold. gcc will assume any path leading to a call
|
||||||
|
to them will be unlikely. This means a lot of manual unlikely()s
|
||||||
|
are unnecessary now for any paths leading to the usual suspects
|
||||||
|
like BUG(), printk(), panic() etc. [but let's keep them for now for
|
||||||
|
older compilers]
|
||||||
|
|
||||||
|
Early snapshots of gcc 4.3 don't support this and we can't detect this
|
||||||
|
in the preprocessor, but we can live with this because they're unreleased.
|
||||||
|
Maketime probing would be overkill here.
|
||||||
|
|
||||||
|
gcc also has a __attribute__((__hot__)) to move hot functions into
|
||||||
|
a special section, but I don't see any sense in this right now in
|
||||||
|
the kernel context */
|
||||||
|
#define __cold __attribute__((__cold__))
|
||||||
|
|
Loading…
Reference in New Issue