public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2022-10-04 12:57 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 12:57 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fc95f4d5415e5a892e0fbac8b667edd48657ec61

commit fc95f4d5415e5a892e0fbac8b667edd48657ec61
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index d59778d6fe..579c4baed8 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -47,6 +50,7 @@ resolver (void)
   ++resolver_called;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 2d72c54081..da73a54850 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index e01cc82879..d1c63f3e58 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -768,7 +769,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2022-10-28 17:39 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:39 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=24f34ab598e2ae3aeeaceb8466faa0a4f45b993b

commit 24f34ab598e2ae3aeeaceb8466faa0a4f45b993b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index d59778d6fe..579c4baed8 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -47,6 +50,7 @@ resolver (void)
   ++resolver_called;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 2d72c54081..da73a54850 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 140ee0ff6d..579eca0405 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -750,7 +751,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2023-02-09 19:46 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:46 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fd658f1deb6d089db98c6f9bc0e52e40f91a4921

commit fd658f1deb6d089db98c6f9bc0e52e40f91a4921
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index cab26af75c..e37c391f02 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -47,6 +50,7 @@ resolver (void)
   ++resolver_called;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 33d60196da..57b0a28306 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 41c5022e04..48e85f8d5d 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -683,7 +684,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2023-08-30 12:34 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:34 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8b8dfbeabb6456486f7a6aae3989a6a38d6523cd

commit 8b8dfbeabb6456486f7a6aae3989a6a38d6523cd
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index cab26af75c..e37c391f02 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -47,6 +50,7 @@ resolver (void)
   ++resolver_called;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 33d60196da..57b0a28306 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 2184522c93..ad3b800ccd 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -683,7 +684,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2023-09-28 17:49 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:49 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=88826cb4ab708aec2b6468075af550265beb116b

commit 88826cb4ab708aec2b6468075af550265beb116b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver
    
    The __ifunc_resolver macro expands to:
    
      extern __typeof (__redirect_name) name __attribute__ ((ifunc ("iname_ifunc")));
      static __typeof (__redirect_name) *name_ifunc (void) { [...] };
    
    And although NAME_IFUNC is and alias for NAME, clang still emits
    an 'unused function 'name_ifunc' [-Werror,-Wunused-function]'
    warning.  The static is used to avoid name pollution on static
    linkage.

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index cab26af75c..5fa25b6d1c 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -49,6 +52,7 @@ resolver (void)
 }
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 int
 main (void)
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 33d60196da..57b0a28306 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 2184522c93..ad3b800ccd 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -683,7 +684,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2023-12-21 18:51 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:51 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4b8c842ee20010ece92b302b35616f7e584ab7b3

commit 4b8c842ee20010ece92b302b35616f7e584ab7b3
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver
    
    The __ifunc_resolver macro expands to:
    
      extern __typeof (__redirect_name) name __attribute__ ((ifunc ("iname_ifunc")));
      static __typeof (__redirect_name) *name_ifunc (void) { [...] };
    
    And although NAME_IFUNC is and alias for NAME, clang still emits
    an 'unused function 'name_ifunc' [-Werror,-Wunused-function]'
    warning.  The static is used to avoid name pollution on static
    linkage.

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index cab26af75c..5fa25b6d1c 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -49,6 +52,7 @@ resolver (void)
 }
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 int
 main (void)
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 33d60196da..57b0a28306 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 6aa8300f2b..1bff8bac88 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -685,7 +686,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2024-01-29 17:54 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:54 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=34d0d58ef11aa95ccff3cb66760129924e492760

commit 34d0d58ef11aa95ccff3cb66760129924e492760
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver
    
    The __ifunc_resolver macro expands to:
    
      extern __typeof (__redirect_name) name __attribute__ ((ifunc ("iname_ifunc")));
      static __typeof (__redirect_name) *name_ifunc (void) { [...] };
    
    And although NAME_IFUNC is and alias for NAME, clang still emits
    an 'unused function 'name_ifunc' [-Werror,-Wunused-function]'
    warning.  The static is used to avoid name pollution on static
    linkage.

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index 43011452b7..a13020dc6d 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -49,6 +52,7 @@ resolver (void)
 }
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 int
 main (void)
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 5157c6cc6c..04448b2b15 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index d14837631b..1387525484 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -685,7 +686,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2024-02-07 14:04 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:04 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cc2dc55feb1324caec6dd5dfb522c958a558ae18

commit cc2dc55feb1324caec6dd5dfb522c958a558ae18
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver
    
    The __ifunc_resolver macro expands to:
    
      extern __typeof (__redirect_name) name __attribute__ ((ifunc ("iname_ifunc")));
      static __typeof (__redirect_name) *name_ifunc (void) { [...] };
    
    And although NAME_IFUNC is and alias for NAME, clang still emits
    an 'unused function 'name_ifunc' [-Werror,-Wunused-function]'
    warning.  The static is used to avoid name pollution on static
    linkage.

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index 43011452b7..a13020dc6d 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -49,6 +52,7 @@ resolver (void)
 }
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 int
 main (void)
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 5157c6cc6c..04448b2b15 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index d14837631b..1387525484 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -685,7 +686,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver
@ 2024-02-09 17:29 Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:29 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e34a1b7252b2dbdcf9668928b66746427f2b24e7

commit e34a1b7252b2dbdcf9668928b66746427f2b24e7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Aug 4 09:43:18 2022 -0300

    elf: Suppress unused function clang for __ifunc_resolver
    
    The __ifunc_resolver macro expands to:
    
      extern __typeof (__redirect_name) name __attribute__ ((ifunc ("iname_ifunc")));
      static __typeof (__redirect_name) *name_ifunc (void) { [...] };
    
    And although NAME_IFUNC is and alias for NAME, clang still emits
    an 'unused function 'name_ifunc' [-Werror,-Wunused-function]'
    warning.  The static is used to avoid name pollution on static
    linkage.

Diff:
---
 elf/ifuncmain9.c           | 4 ++++
 elf/tst-ifunc-fault-lazy.c | 4 ++++
 include/libc-symbols.h     | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index 43011452b7..a13020dc6d 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include <stdio.h>
+# include <libc-diag.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -40,6 +41,8 @@ implementation (void)
   return random_constant;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 inhibit_stack_protector
 resolver (void)
@@ -49,6 +52,7 @@ resolver (void)
 }
 
 static int magic (void) __attribute__ ((ifunc ("resolver")));
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 int
 main (void)
diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c
index 5157c6cc6c..04448b2b15 100644
--- a/elf/tst-ifunc-fault-lazy.c
+++ b/elf/tst-ifunc-fault-lazy.c
@@ -21,6 +21,7 @@
    relocations.  */
 
 #include <config.h>
+#include <libc-diag.h>
 
 #ifdef HAVE_GCC_IFUNC
 
@@ -34,6 +35,8 @@ implementation (void)
   *p = 0;
 }
 
+DIAG_PUSH_NEEDS_COMMENT_CLANG;
+DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");
 static __typeof__ (implementation) *
 resolver (void)
 {
@@ -42,6 +45,7 @@ resolver (void)
   *p = 0;
   return implementation;
 }
+DIAG_POP_NEEDS_COMMENT_CLANG;
 
 static void magic (void) __attribute__ ((ifunc ("resolver")));
 
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index d14837631b..1387525484 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -86,6 +86,7 @@
 
 /* Obtain the definition of symbol_version_reference.  */
 #include <libc-symver.h>
+#include <libc-diag.h>
 
 /* When PIC is defined and SHARED isn't defined, we are building PIE
    by default.  */
@@ -685,7 +686,10 @@ for linking")
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name __attribute__			\
 			      ((ifunc (#name "_ifunc")));		\
-  __ifunc_resolver (type_name, name, expr, arg, init, static)
+  DIAG_PUSH_NEEDS_COMMENT_CLANG;					\
+  DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function");		\
+  __ifunc_resolver (type_name, name, expr, arg, init, static);		\
+  DIAG_POP_NEEDS_COMMENT_CLANG;
 
 # define __ifunc_hidden(type_name, name, expr, arg, init)	\
   __ifunc (type_name, name, expr, arg, init)

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

end of thread, other threads:[~2024-02-09 17:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 12:57 [glibc/azanella/clang] elf: Suppress unused function clang for __ifunc_resolver Adhemerval Zanella
2022-10-28 17:39 Adhemerval Zanella
2023-02-09 19:46 Adhemerval Zanella
2023-08-30 12:34 Adhemerval Zanella
2023-09-28 17:49 Adhemerval Zanella
2023-12-21 18:51 Adhemerval Zanella
2024-01-29 17:54 Adhemerval Zanella
2024-02-07 14:04 Adhemerval Zanella
2024-02-09 17:29 Adhemerval Zanella

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 read-only IMAP folder(s) and NNTP newsgroup(s).