Skip to contentSkip to conversation

remove old GCC version implementation

PATCH In review Mathieu Malaterre 3 participants 5 messages Oct 31, 2018 – Nov 26, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove old GCC version implementation

GCC 4.6 is the minimum supported now.

---
 scripts/mod/file2alias.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
scripts/mod/file2alias.c +1 -5
index 28a61665bb9c..4b59564d4706 100644
@@ -83,11 +83,7 @@ extern struct devtable *__start___devtable[], *__stop___devtable[];
 #endif /* __MACH__ */
 
 #if !defined(__used)
-# if __GNUC__ == 3 && __GNUC_MINOR__ < 3
-#  define __used			__attribute__((__unused__))
-# else
-#  define __used			__attribute__((__used__))
-# endif
+#define __used			__attribute__((__used__))
 #endif
 
 /* Define a variable f that holds the value of field f of struct devid
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Mathieu Malaterre

GCC 4.6 is the minimum supported now.

---
 scripts/mod/file2alias.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
scripts/mod/file2alias.c +0 -0
index 28a61665bb9c..4b59564d4706 100644
@@ -83,11 +83,7 @@ extern struct devtable *__start___devtable[], *__stop___devtable[];
 #endif /* __MACH__ */

scripts/mod/file2alias.c extern struct devtable *__start___devtable[], *__stop___devtable[]; · line 88

Quoted 10 lines
scripts/mod/file2alias.c +1 -5
 
 #if !defined(__used)
-# if __GNUC__ == 3 && __GNUC_MINOR__ < 3
-#  define __used                       __attribute__((__unused__))
-# else
-#  define __used                       __attribute__((__used__))
-# endif
+#define __used                 __attribute__((__used__))
 #endif
 

By the way, is it possible that scripts/ and similar stuff uses
directly include/linux/compiler_attributes.h (whenever it hits
mainline, see https://github.com/ojeda/linux/blob/compiler-attributes/include/linux/compiler_attributes.h
)? It is a header that does not depend on anything, so it could easily
be shared; and would avoid having to maintain two sets of attributes.
Let me know, I can take a look at it if you think it is a good idea.

Cheers,
Miguel

#2 lore raw
Quoted 29 lines · Miguel Ojeda
Quoted 14 lines · Mathieu Malaterre

GCC 4.6 is the minimum supported now.

---
 scripts/mod/file2alias.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
scripts/mod/file2alias.c +0 -0
index 28a61665bb9c..4b59564d4706 100644
@@ -83,11 +83,7 @@ extern struct devtable *__start___devtable[], *__stop___devtable[];
 #endif /* __MACH__ */

scripts/mod/file2alias.c extern struct devtable *__start___devtable[], *__stop___devtable[]; · line 88

Quoted 10 lines
scripts/mod/file2alias.c +1 -5
 
 #if !defined(__used)
-# if __GNUC__ == 3 && __GNUC_MINOR__ < 3
-#  define __used                       __attribute__((__unused__))
-# else
-#  define __used                       __attribute__((__used__))
-# endif
+#define __used                 __attribute__((__used__))
 #endif
 
Quoted 6 lines

By the way, is it possible that scripts/ and similar stuff uses
directly include/linux/compiler_attributes.h (whenever it hits
mainline, see https://github.com/ojeda/linux/blob/compiler-attributes/include/linux/compiler_attributes.h
)? It is a header that does not depend on anything, so it could easily
be shared; and would avoid having to maintain two sets of attributes.
Let me know, I can take a look at it if you think it is a good idea.

No.
I want to share a header file between kernel and host-tools only when we need to do so.

In this case, it is wrong to use the linker magic for the host tool if you look at the so ugly #if defined(__MACH__) part.

Quoted 2 lines

Cheers,
Miguel

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
Quoted 10 lines · Masahiro Yamada
Quoted 7 lines · Miguel Ojeda

By the way, is it possible that scripts/ and similar stuff uses
directly include/linux/compiler_attributes.h (whenever it hits
mainline, see https://github.com/ojeda/linux/blob/compiler-attributes/include/linux/compiler_attributes.h
)? It is a header that does not depend on anything, so it could easily
be shared; and would avoid having to maintain two sets of attributes.
Let me know, I can take a look at it if you think it is a good idea.

Landed a couple of weeks ago.

Quoted 6 lines

No.
I want to share a header file between kernel and host-tools only when we need to do so.

In this case, it is wrong to use the linker magic for the host tool if you look at the so ugly #if defined(__MACH__) part.

Do you mean this line?

  #define SECTION(name)   __attribute__((section("__TEXT, " #name)))

I would say having exceptions is fine, i.e. the idea was to reduce "duplicated" definitions. In this case, the #define has a different name and style, so I would say it is clear.

Anyway, if the policy is not sharing headers at all, that is fine!

Cheers,
Miguel

#4 lore raw
In reply to Mathieu Malaterre
Quoted 13 lines · Mathieu Malaterre

GCC 4.6 is the minimum supported now.

---
 scripts/mod/file2alias.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
scripts/mod/file2alias.c +0 -0
index 28a61665bb9c..4b59564d4706 100644

scripts/mod/file2alias.c extern struct devtable *__start___devtable[], *__stop___devtable[]; · line 87

Quoted 10 lines
scripts/mod/file2alias.c +1 -5
@@ -83,11 +83,7 @@ extern struct devtable *__start___devtable[], *__stop___devtable[];
 #endif /* __MACH__ */
 
 #if !defined(__used)
-# if __GNUC__ == 3 && __GNUC_MINOR__ < 3
-#  define __used                       __attribute__((__unused__))
-# else
-#  define __used                       __attribute__((__used__))
-# endif
+#define __used                 __attribute__((__used__))
 #endif

Superseded by:

https://patchwork.kernel.org/patch/10693483/

Quoted 4 lines
scripts/mod/file2alias.c +0 -1
 /* Define a variable f that holds the value of field f of struct devid
--

2.11.0